About Sweet Search
Sweet Search is an MCP server published by mrsladoje in the RAG category: local code search for AI agents: cheaper, faster and sweeter. Because maybe grep isn't all you need... 🍬. Conduid read 10 tools from its source: grep, health, index, pattern_search, read, read-semantic and 4 more. It is published to npm as sweet-search and starts with npx.
The repository has 121 stars and 5 forks, is licensed Apache-2.0, and its last commit was on 29 Nov 2026. The latest release is v2.9.2. It follows v2.10.5, and the 5 most recent releases go back to v2.10.0. It passes all 4 static checks Conduid ran on the repository. Its topics include code-graph, code-retrieval, code-search, coding-agent, colbert and devtools.
Install
claude mcp add sweet-search -- npx -y sweet-searchnpx -y sweet-searchgit clone https://github.com/mrsladoje/sweet-searchTools (10)
grepSearch for a regex pattern in the codebase. Returns file:line matches.| Parameter | Type | Description |
|---|---|---|
| max_results | number | Max results to return (default: 20) |
| pattern * | string | Regex pattern to search for |
healthCheck health of every sweet-search subsystem (index, embedding model, late-interaction reranker, structural graph, daemon). USE WHEN searches return empty unexpectedly, results look stale, or latency is unusual — diagnoses missing index, model load failures, daemon issues. Read-only, fast.indexIndex or re-index the codebase. USE BEFORE first search if the project has not been indexed yet, or after large source changes (`mode="full"`). The Claude Code SessionStart hook installed by `sweet-search init` keeps the incremental index fresh during normal sessions, so manual re-indexing is rarely needed.| Parameter | Type | Description |
|---|---|---|
| mode | string | Indexing mode |
pattern_searchSearch for code using regex + semantic ranking (ColGrep). Returns ranked results with FULL CODE BLOCKS, confidence signals, and token usage. You do NOT need to read files — the code is included in the results.| Parameter | Type | Description |
|---|---|---|
| k | number | Number of results (default: 5) |
| query * | string | Semantic query for MaxSim ranking |
| regex * | string | Regex pattern for candidate generation |
readRead 1-20 files (with optional line ranges) for exact code understanding. USE INSTEAD OF the native Read tool for code-discovery reads — batches multiple files in one call, attaches symbol-aware chunk metadata when the file is indexed, and returns the exact bytes from disk. Native Read remains fine for files you are about to Edit (Edit needs a prior Read of that exact file).| Parameter | Type | Description |
|---|---|---|
| files | array | File path relative to project root (or absolute) |
| force | boolean | |
| includeMetadata | boolean | Attach symbol-aware chunk metadata when the file is indexed |
read-semanticRead only the spans of a file relevant to a question. USE WHEN you know the file but the relevant span is unclear — selects spans via hybrid retrieval (lexical + symbol + ColBERT MaxSim, RRF-fused and LI-reranked), then re-reads exact lines from disk. Returns 1-N small spans instead of the full file. Avoid running this on multiple files unless the task is explicitly multi-file — call `search` with the question instead. Falls back to a plain read when the file is not indexed.| Parameter | Type | Description |
|---|---|---|
| contextLines | number | Pre/post context lines per span (default: 2) |
| file * | string | File path (project-relative or absolute) |
| maxChars | number | Hard cap on returned text (default: 8000 chars) |
| maxTokens | number | Convenience cap (~chars/4) |
| query * | string | What you want to understand about this file |
| threshold | number | MaxSim score floor (default: 0.4) |
| topK | number | Maximum spans before merging (default: 5) |
| verbose | boolean | Include timings + per-signal scores |
repo-mapCompressed structural overview of the codebase as a PageRank-scored symbol list, fitted to a token budget. USE FIRST when exploring an unfamiliar repo to orient yourself, or to brief a delegated agent before handing off a task. Not for targeted lookups — use `search` for that. Pass `focusFiles` / `focusEntities` to bias the map toward the area you care about.| Parameter | Type | Description |
|---|---|---|
| focusEntities | array | Boost importance of entities with these names |
| focusFiles | array | Boost importance of entities in these files |
| tokenBudget | number | Maximum token budget for the output (default: 1024) |
searchHybrid code search (semantic + lexical + structural). USE INSTEAD OF native Grep for code-discovery tasks. Returns ranked, auto-expanded, self-contained code blocks by default (`format="agent"`) — no follow-up Read needed. Pass `regex` for ColGrep pattern search (regex anchor + semantic re-rank), `structural=true` for callers/callees/impact, or omit for hybrid auto-routing. Pass `format="benchmark"` only for retrieval-quality measurement, not agent consumption.| Parameter | Type | Description |
|---|---|---|
| format | string | Output format. Default "agent" returns ranked, self-contained code blocks for agent consumption. Use "benchmark" only for retrieval-quality measurement. |
| k | number | Number of results (1-200) |
| mode | string | Search mode |
| query * | string | Search query (1-1000 chars) |
| regex | string | Regex pattern for ColGrep pattern search (implies mode=pattern) |
| structural | boolean | Force structural graph search mode (callers, callees, implementations) |
| tokenBudget | number | Agent mode: optional token budget override. Omit to let the tool pick. |
traceTrace callers, callees, and transitive impact paths for one specific symbol — returns a single structural-context package adapted to the token budget. USE WHEN the question is "who calls X", "what does X depend on", or "what would break if I changed X". For general code discovery use `search` instead; for navigation around an unfamiliar repo use `repo-map` first.| Parameter | Type | Description |
|---|---|---|
| file | string | Optional indexed file path to disambiguate duplicate symbol names |
| maxDepth | number | Maximum transitive impact depth (default: 3, capped at 4) |
| query | string | Optional natural-language hint used only to rank structural context |
| symbol * | string | Symbol/entity name to trace, e.g. processOrder or EmployeeService.processOrder |
| tokenBudget | number | Optional token budget. Omit for adaptive 3k/8k/12k selection. |
vocab-prewarmPre-warm sweet-search caches by mining the codebase for project-specific vocabulary across lexical / semantic / hybrid modes. USE ONCE after a fresh index to make the first batch of searches faster; generally not needed for one-off queries because the daemon-prewarm hook handles cold-start warmup automatically.| Parameter | Type | Description |
|---|---|---|
| depth | string | Mining depth |
| dryRun | boolean | Show what would be mined without actually warming |
| incremental | boolean | Only process changes since last warmup |
| localWarmup | boolean | Force local model for warmup even when remote provider is active |
| modes | array | Search modes to warm |
| provider | string | Override embedding provider (voyage/mistral/jina/local) |
| stats | boolean | Return current warmup statistics |
| top | number | Number of top terms to warm |
Security checks
- ✓README presentThe repository's README runs to about 13K words.
- ✓License declaredThe repository declares the Apache-2.0 license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
2 checks have not been run yet.
Releases
README
The repository's README runs to about 13K words, fetched 12 days ago. The original in the repository is authoritative.
Read full README