Expand description
Graph-aware AI context assembly with token budgeting.
Pipeline used by crate::Brain::context_for_prompt:
- Ranked FTS seeds (
crate::query) with stopword-aware query rewrite - Optional CSR k-hop expansion from
.brain/graph.mmap(doc seeds preferred) - Score fusion (seed score × edge weight × hop decay) + symbol quality filters
- Pack nodes with body excerpts until the approximate character/token budget is exhausted
Token accounting is intentionally simple (chars / 4). It is good enough for
agent prompt packing, not for billing-grade tokenizer parity.
Structs§
- Context
Options - Options controlling
assemble_contextandcrate::Brain::context_for_prompt_with. - Workspace
Hit - Multi-workspace ranked hit (workspace path + hit).
Functions§
- assemble_
context - Assemble a graph-aware context bundle for an agent prompt.
- hits_
to_ nodes - Convert ranked hits to nodes (helper for CLI / adapters).