Expand description
Knowledge-store capability for gonzalo.
A single “what do we know about X” surface that composes the existing
capability layers (ADR 0011): a [Store] for records, a [VectorIndex] for
semantic retrieval, and an [Embedder] for turning text into vectors — all
addressed by the shared RecordKey. Queries return first-class
[Record]s as Hits, not bare ids.
Which record kinds are knowledge-bearing, and how their text is split into
embeddable pieces, lives in chunk (with knowledge_text as the joined
one-document view). Records are embedded at chunk granularity — a Session
by turn, a long MemoryTier/Ticket by paragraph, a Topic by bullet — so
a query matching one turn/section isn’t drowned out by a document average;
KnowledgeStore::query de-dups chunk matches back to one hit per record.
A graph-backed join ([KnowledgeStore::query_in_subgraph]) is a further
refinement behind this same surface.
Structs§
- Chunk
Hit - One chunk-granular search hit: the parent [
Record], the matching chunk’s score, itsordinalwithin the record, and that chunk’stext. Unlike aHit, chunk hits are not de-duped to one-per-record. - Hit
- One search hit: a first-class record and its similarity score (higher is more similar).
- Knowledge
Store - Composes a [
Store], a [VectorIndex], and an [Embedder] into one retrieval surface keyed byRecordKey.
Functions§
- chunk
- Split a record into ordered chunk texts. Returns
Ok(None)if the kind is definitionally not knowledge-bearing (Checkpoint/GraphManifest, ADR 0011), andErrif a knowledge-bearing body fails to parse — so a corrupt record is distinguishable from a genuinely non-indexable one (#139). Chunking is per-kind: aSessionby turn, a longMemoryTier/Ticketby section/paragraph, aTopicby bullet. The kind’s title/name is folded into the first chunk so it stays searchable. A kind that yields a single piece is the one-document fallback — identical to phase-1 behavior. Extraction goes through thegonzalo-domaintyped views. - knowledge_
text - The embeddable text for a record, or
Noneif its kind is not knowledge-bearing (ADR 0011). Kept as the one-document view: thechunks joined back into a single string.