graflo.architecture.schema.context.card¶
Compact orientation card: the cheapest useful thing to hand an agent first.
Answers "what kind of graph is this, where do I start, how much is here" in a payload that stays small no matter how large the schema is.
EntryPoint
¶
Bases: ConfigBaseModel
A vertex type an agent can look up directly.
The single most useful fact about an unfamiliar graph: a type with a natural identity and a secondary index is one you can filter on cheaply, which is where a query should start.
Source code in graflo/architecture/schema/context/card.py
SchemaCard
¶
Bases: ConfigBaseModel
Bounded orientation summary of a whole schema.
Source code in graflo/architecture/schema/context/card.py
build_card(schema, *, top_n=10, max_names=25, graph=None)
¶
Summarize schema for an agent's first contact with it.
Every list on the card is bounded, with a count reported alongside. A card whose size grows with the schema is not a card — it is the problem this wave exists to solve, wearing a summary's clothes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
Schema
|
Schema to summarize. Never mutated. |
required |
top_n
|
int
|
How many hub types and entry points to list. |
10
|
max_names
|
int
|
How many isolated types and relation names to list. |
25
|
graph
|
SchemaGraph | None
|
Prebuilt index, if the caller already has one. |
None
|