You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user has an embedding provider configured, we get better recall than BM25 — especially for paraphrased queries ("fetch latest tickets" → `jira.getIssues`). Zoo Code's `CodeIndexManager` already wires Ollama / OpenAI-compatible / Semble embedders, so users don't need to configure anything twice.
Depends on #575 (Bm25Ranker) being merged so the `Ranker` interface exists.
Reuse the embedding provider exposed by `CodeIndexManager` — add a thin `embedText(text: string): Promise<number[]>` facade if one doesn't already exist.
Maintain an in-memory `Map<toolKey, vector>` cache. Invalidate when the `ToolDoc[]` input set changes.
Cosine similarity for ranking. Top-K by score.
Factory in `src/services/tools/index.ts`: return `EmbeddingsRanker` if `CodeIndexManager.hasEmbeddingProvider()` is true; fall back to `Bm25Ranker` otherwise, or if any embedding call throws.
Acceptance Criteria
`EmbeddingsRanker` implements `Ranker` interface
Unit test with mock embedding provider returning known vectors — cosine ranking is correct
Context
When the user has an embedding provider configured, we get better recall than BM25 — especially for paraphrased queries ("fetch latest tickets" → `jira.getIssues`). Zoo Code's `CodeIndexManager` already wires Ollama / OpenAI-compatible / Semble embedders, so users don't need to configure anything twice.
Depends on #575 (Bm25Ranker) being merged so the `Ranker` interface exists.
Developer Notes
Acceptance Criteria