{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package recall\n\nPackage recall answers natural-language questions about a repository's prose memory — \"where did we decide X?\", \"what's our policy on Y?\" — by ranking the corpus of source docs, adjudicated claims, and human decisions against the question with BM25 plus memcode-aware boosts (claim status, recency, scope, source kind, exact phrase). It is deliberately NOT embeddings: lexical search over prose is cheap, offline, deterministic, and \"good enough\" until a measured recall eval proves otherwise. Code questions (\"where is this handler/symbol/test?\") are answered by exact tools instead — \\`memcode explore\\` and the agent's rg/read/git tools — not here.\n\nThe ranking respects memcode doctrine: current beats stale, scope matters, recent reality matters, evidence is not truth — but a query that explicitly asks about history/conflicts surfaces stale and conflicted material instead of burying it.\n\n## Types\n\n```go\ntype Category string\n```\nCategory groups a chunk by its source kind, which drives weighting.\n\n```go\nconst (\n\tCatDoc   Category = \"doc\"   // a source document (CLAUDE.md, README, AGENTS.md, docs)\n\tCatClaim Category = \"claim\" // an adjudicated claim\n\tCatEvent Category = \"event\" // a human decision/assertion/note\n\tCatRule  Category = \"rule\"  // a promoted standing rule (confirmed preference / distilled lesson)\n)\n```\n\n```go\ntype Chunk struct {\n\tID     string\n\tText   string\n\tSource string // human-readable provenance\n\n\tCat    Category\n\tKind   string    // doc: claude/readme/docs/…; claim: claim type; event: decision/…\n\tStatus string    // claim status (current|candidate|stale|conflicted)\n\tStale  bool      // source doc is stale relative to the code it governs\n\tScope  string    // dir it governs (\".\" = repo, \"\" = none)\n\tWhen   time.Time // recency signal (doc git date / event timestamp)\n}\n```\nChunk is one unit of prose with its provenance and ranking signals.\n\n```go\nfunc Corpus(ctx context.Context, st store.Store, root string) ([]Chunk, error)\n```\nCorpus assembles the prose corpus from source docs, adjudicated claims, and decision-bearing events, each tagged with its ranking signals.\n\n```go\ntype Hit struct {\n\tChunk Chunk\n\tScore float64\n}\n```\nHit is a ranked chunk.\n\n```go\nfunc Recall(ctx context.Context, st store.Store, root, query, scopePath string, k int) ([]Hit, error)\n```\nRecall ranks the prose corpus against query and returns the top k hits with a positive score. scopePath (may be \"\") boosts chunks governing that path.\n\n","path":"github.com/memcode-ai/memcode/internal/recall","name":"recall","synopsis":"Package recall answers natural-language questions about a repository's prose memory — \"where did we decide X?\", \"what's our policy on Y?\" — by ranking the corpus of source docs, adjudicated claims, and human decisions against the question with BM25 plus memcode-aware boosts (claim status, recency, scope, source kind, exact phrase).","isRedistributable":true}
