Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Pre-alpha. APIs may change. Feedback welcome.
agentgrep 0.1.0a45 documentation
Light Logo Dark Logo
agentgrep 0.1.0a45 documentation
  • Getting Started
    • Installation
    • MCP Clients
    • Configuration
  • CLI
    • agentgrep grep
    • agentgrep search
    • agentgrep find
    • API Reference
  • TUI
    • API Reference
  • Library
    • Tutorial
    • How to
    • Event-stream engine
    • Query language
    • API Reference
    • Examples
  • MCP
    • Tools
    • Resources
    • Prompts
    • API Reference
  • Backends
    • Codex
    • Claude Code
    • Cursor CLI
    • Cursor IDE
    • Gemini CLI
    • Antigravity
    • Antigravity CLI
    • Antigravity IDE
    • Grok CLI
    • Pi
    • OpenCode
    • VS Code (GitHub Copilot Chat)
    • Unsupported backends
      • Windsurf (unsupported)
  • Development
    • Benchmark harness
    • Storage catalogue
    • Architecture decisions
      • ADR 0001: Storage version detection
      • ADR 0002: Pure Python/Rust accelerator module compatibility requirements
      • ADR 0003: Native boundary and execution architecture
      • ADR 0004: Headless query planning and non-blocking execution
      • ADR 0005: Local insights reports and model-backed enrichment
      • ADR 0006: Public CLI and MCP surface
      • ADR 0007: Query language comparison and full queryability
      • ADR 0008: Unsupported backends with obfuscated storage
      • ADR 0009: Cross-host discovery and remote-workspace path mapping
      • ADR 0010: Module boundaries and the facade re-export contract
      • ADR 0011: Non-blocking TUI invariants
      • ADR 0012: Reusable TUI widget architecture
      • ADR 0013: Pluggable TUI layouts and workflows
      • ADR 0014: Result order, limit, and the streaming merge contract
      • ADR 0020: Progressive deep search
      • ADR 0021: Prompt-guided conversation routing
  • Changelog
  • GitHub

team git-pull / Tony Narlock:

vcs-python vcspull (libvcs), g

tmux-python tmuxp libtmux (mcp, pytest)

cihai unihan-etl (db) cihai (cli)

django django-slugify-processor django-docutils django-search-query (admin)

AI libtmux-mcp agentgrep (mcp)

docs + tests gp-libs gp-sphinx

web social-embed

Back to top
View this page
Edit this page

ADR 0020: Progressive deep search¶

Status¶

Accepted. The effort ladder is implemented.

Context¶

Prompt history is cheap to search but does not contain every conversation record. Opening every transcript for every request is complete but costs more I/O and parsing than a prompt-only question needs. The public request must make that trade-off explicit without turning scope, result limits, and routing into competing depth controls.

Decision¶

Search effort is an engine-owned, ordered read policy with three values:

  • prompt discovers and reads only prompt-history sources. It does not open conversation bodies.

  • targeted searches prompt evidence, then uses the fixed routing decision in ADR 0021 to add selected conversations. It is approximate because candidate selection can omit a conversation.

  • exhaustive discovers and reads every eligible conversation source admitted by the normalized scope and source predicates.

The CLI normalizes --deep to targeted and --exhaustive to exhaustive; a bare CLI --exhaustive retains prompt scope. MCP exposes the same prompt, targeted, and exhaustive vocabulary, but an omitted scope with targeted or exhaustive effort infers all; an explicitly supplied scope="prompts" remains invalid for targeted effort. scope controls record kinds, while effort controls how broadly the engine reads sources, and neither is a result limit.

Each effort uses the same matcher, declared order, dedupe policy, and result limit. The result summary reports requested and completed effort, status, coverage, diagnostics, and engine-authored escalation actions. A targeted summary reports approximate with the candidate-selection condition unless a higher-precedence failure, cancellation, or truncation condition applies.

Consequences¶

Readers can begin with prompt history and explicitly spend more I/O only when their question warrants it. An empty result remains interpretable: the summary distinguishes no prompt match, no candidate conversation, no match in selected conversations, and no exhaustive match. Frontends must use that engine-owned evidence and next actions rather than infer coverage from an empty result list.

This ADR owns effort semantics and normalization. ADR 0021 owns targeted candidate selection. ADR 0014 owns ordering and result limits; a result-limit migration to 25 did not occur.

Next
ADR 0021: Prompt-guided conversation routing
Previous
ADR 0014: Result order, limit, and the streaming merge contract
Copyright © 2026, Tony Narlock
Made with Sphinx and gp-sphinx (fork of Furo by @pradyunsg)
Source: docs/dev/adr/0020-progressive-deep-search.md · Machine-readable: Markdown, raw source, docs.json, llms.txt, llms-full.txt
On this page
  • ADR 0020: Progressive deep search
    • Status
    • Context
    • Decision
    • Consequences