Retrieval guide

Scout search modes

Scout is a code search server for AI coding agents. It works with any repository and any programming language.

Each search mode answers a different retrieval question. The agent chooses the mode from the task instead of treating every search as a text lookup.

Choose the retrieval primitive

Strict lexical search

Use it for exact, exhaustive lookup.

find
  • literal finds an exact text sequence.
  • regex finds text that matches a regular expression.
  • word finds whole words and excludes substring-only matches.
  • Strict results report whether the scan was exhaustive. Partial scans report their limit and coverage.
{ "query": "deprecated_api", "target": "content", "match": "word" }

Fuzzy ranked search

Use it for approximate file, path, or identifier discovery.

find
  • Fuzzy search ranks a bounded result set. It is not an exhaustive audit.
  • It fits incomplete spellings, remembered fragments, and exploratory navigation.
{ "query": "usrctrl", "target": "files", "match": "fuzzy" }

Semantic search

Use it for concept discovery when the query and code use different words.

find
  • Scout embeds local code chunks and accepts a natural-language query.
  • The semantic tier is local and off by default. Pass --semantic to turn it on; Scout then downloads and verifies its model once per user.
  • If the tier is unavailable, Scout reports the lexical fallback in meta.degraded.
{ "query": "where request retries are limited", "target": "semantic" }

Hybrid retrieval

Use it when concept similarity and shared vocabulary both matter.

find
  • Semantic queries fuse embedding search with a lexical ranking over the same chunks.
  • route.tier reports hybrid when both rankings contribute.
  • The returned score orders that result set. It is not a similarity percentage.

Structural search

Use it for syntax-aware matching by code shape.

find
  • target: structural runs ast-grep patterns with $NAME and $$$ captures.
  • target: symbols returns a declaration outline with names, kinds, and containers.
  • Native syntax support depends on a linked grammar. Scout reports degradation for uncovered languages.
{ "query": "fn $NAME($$$) -> Option<$T>", "target": "structural" }

Resident index and freshness

Use the same search surface across repeated agent steps.

server_statussync
  • Scout keeps a resident workspace index and updates it from filesystem events.
  • Each query applies pending watcher changes before it reads the index.
  • server_status reports index revision, file count, tier state, and watcher state.

Scout and text search

  • ripgrep performs lexical text search. Scout also provides fuzzy, semantic, hybrid, and structural retrieval through one MCP surface.
  • With its index built and its server running, Scout answered every text search in our measurements faster than ripgrep. ripgrep needs neither an index nor a running server, which makes it the better tool for a one-off search in a terminal. Scout benchmarks publishes every number, the one-time setup cost, and the searches ripgrep cannot express at all.
  • Use Glider for compiler-backed C# relationships and TGlider for TypeScript and JavaScript workspace semantics. Scout keeps covering every other language, and text search in all of them.

What the benchmark covers

Scout benchmarks publishes warm and cold latency, lexical and semantic index build time, resident memory, and match parity against ripgrep, on a pinned public repository and a private enterprise monorepo. The repositories, the hardware, and the raw results are on the page. The harness in benchmarks/scout-vs-grep/ carries the commands and the measurement rules.

Update latency, repository scaling, and ranked retrieval quality are not measured yet. Retrieval quality in particular needs a labelled dataset rather than a stopwatch, so no number is published for it.

↑/↓ NavigateEnter OpenSpace Expand