Local lexical RAG search
rag_searchRetrieve relevant context from project documents, code documentation, and completed tickets using hybrid BM25 and local embeddings or lexical search.
Instructions
FBMCPF-264/315: local retrieval over this board's KB docs (incl. research briefs), the code repo's docs/ + root README, and Done tickets' title+completionSummary — zero model tokens. Two-stage HYBRID by default: BM25 preselects candidates, a LOCAL embedding model (Xenova/all-MiniLM-L6-v2 via the optional @xenova/transformers dependency; ~25MB model auto-downloaded ONCE on first semantic query, then cached and offline forever) re-ranks by cosine similarity, reciprocal-rank fusion blends the two. Response carries mode: "hybrid" or "lexical" — it falls back to pure BM25 (identical to the old behavior) whenever the optional dep isn't installed, FEATUREBOARD_NO_SEMANTIC=1, or embedding fails, with a note saying why. Pass mode:"lexical" to skip embeddings deliberately (deterministic/offline runs).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | How many chunks to return (default 5, max 20). | |
| mode | No | hybrid (default): BM25 + local embeddings when available. lexical: BM25 only, no model, fully deterministic. | hybrid |
| query | Yes | What to retrieve context for. | |
| project | Yes |