Local lexical RAG search
rag_searchRetrieves relevant context from board docs, code documentation, and completed tickets using hybrid BM25 and local embedding search, with lexical fallback for deterministic offline queries.
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).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"query": "<query>"
},
"name": "rag_search"
}
}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 |