shellbrain
recall

not just rag.

shellbrain retrieves memories through two independent search lanes—keyword matching and semantic similarity—then fuses, expands, scores, and packs them into a bounded context window. every item explains why it was included. retrieval is precise, not exhaustive.

two search lanes.

keyword search.

BM25 full-text retrieval. finds memories that share the exact terms in your query. precise when you know the vocabulary—function names, error messages, specific subsystems.

semantic search.

vector embedding similarity. finds memories that are conceptually close even when they use different words. catches what keyword search would miss.

reciprocal rank fusion.

both lanes produce ranked lists. fusion merges them into one scored set. a memory that ranks well in both lanes scores highest. neither lane alone is sufficient. together they cover precision and recall.

the pipeline.

seed.

keyword and semantic search each produce a ranked list. reciprocal rank fusion merges them into one scored set of direct candidates.

expand.

each direct candidate grows outward. explicit expansion walks problem-attempt chains, fact-revision chains, and association edges. implicit expansion walks semantic neighbors. bounded depth. bounded breadth.

score and pack.

everything decays with distance. the further a memory is from the direct match, the lower it scores. the pipeline fills each section to its quota, deduplicates globally, and returns a bounded context pack. capped, explainable, precise.

the context pack.

direct.

memories that matched the query most directly. seeded from both keyword and semantic search, fused by reciprocal rank.

explicitly related.

memories reached through authored links. problem-attempt chains, fact-revision chains, and explicit association edges. structural knowledge, not guesswork.

implicitly related.

memories reached through semantic neighbor hops. bounded breadth-first traversal, scored by similarity decay. how recall expands past the first obvious match.

ask concrete questions.

name the actual problem, subsystem, decision, or constraint. every result in the context pack says why it was included—direct match, problem attempt, fact revision, association link, or semantic neighbor. the more specific the query, the sharper the recall.