Expand description
Embedding-based Knowledge Retrieval for ctx_knowledge.
Wraps ProjectKnowledge with a vector index for semantic recall.
Facts are automatically embedded on remember and searched via
cosine similarity on recall, with hybrid exact + semantic ranking.
Structs§
Constants§
- BACKFILL_
PER_ REMEMBER - Per-
remembercap for [backfill_missing]. One MiniLM mini-batch (embed_batchchunks at 64) — bounded latency on the write path while an actively-used project converges to full vector coverage within a few calls. - SEMANTIC_
DUP_ THRESHOLD - Cosine threshold above which a freshly-remembered fact is treated as a
semantic near-duplicate of an existing one. Deliberately conservative — only
genuine paraphrases (“DB is Postgres” / “we persist to PostgreSQL”) clear it,
so the advisory stays signal, not noise. Non-destructive: it nudges the agent
to
judge, never auto-merges (distinct facts can be near in embedding space, e.g. “Postgres 14” vs “Postgres 15”).
Functions§
- compact_
against_ knowledge - format_
scored_ facts - missing_
current_ facts - Current facts that have no vector in the side-car index, most valuable
first (same ordering as
embeddings_reindex: confidence, then recency). Engine-free so the selection is unit-testable with raw indices. - reset