Repository navigation
Description
Part of #3640.
Context
Research often needs several independent searches. They can already run concurrently, but a bounded multi-query operation could reduce envelope overhead and repeated results. Its benefit and agent usability have not been established; this is an investigation, not a commitment to add a production API.
Read (searchDocuments, packages/core/src/lib/ops/read.ts:58-104), (brainSearchTool, packages/ui-backend-pi/src/brain-tools.ts:94-155), (hybridSearch, packages/core/src/lib/search-engine.ts:812-1023), docs/evaluating-search.md and the parent. Scope/exclusion semantics should compose with the context/discovery work without assuming those changes are already shipped.
Scope
- Compare current parallel single-query search with a bounded candidate that accepts named queries, preserves per-query filters/order/provenance, applies per-query and aggregate result/byte/work limits and accounts for omitted results.
- Evaluate the value of cross-query deduplication while retaining every relevant query association and score/rank meaning.
- Measure local FTS mechanics and model-visible response quality; separately identify embedding/reranker calls and paid work when those lanes are actually qualified.
Out of scope
Shipping new supported schemas, changing ranking constants/goldens, merging scores from unrelated queries without a defined meaning, provider migration, generic execution batching and automatic increases in paid retrieval work.
Acceptance criteria
- A reproducible Odysseus workload with overlapping and disjoint queries compares equivalent filters/results against already-parallel calls. Use the pinned date.
- The proposed contract covers query identity, deterministic association/order, per-query errors, duplicates, output/work caps, cancellation and compatibility with explicit path scope.
- Evidence reports useful answer coverage/attribution, duplicate bytes, total returned size, actual tool/provider requests where observable, latency and available token/cost dimensions. Unknowns and scripted-model limitations remain explicit.
- FTS proof is offline and exercises real core/MCP/Pi paths where comparing adapter behavior. Vector/reranker or real Terra usability claims are made only with matching authorized evidence outside tests.
- The written recommendation is go, no-go or bounded inconclusive, identifies affected contracts and tradeoffs, and gives a concrete follow-up brief only when warranted. A documented no closes this spike successfully.
Verification
Record exact fixture, source/runtime and commands; reuse the evaluation child's measurements/harness where available without adding a new orchestration seam. Run harness-only tests in experiments/ through bun run test. Do not make an API key/network necessary for committed tests or turn a private dataset into a public benchmark.
Contract impact
None for the written spike/private prototype. Any supported tool/CLI/export change is separately scoped with contract review and changeset before implementation. No release milestone is assigned.
Triage 2026-11-08 at main 1619741f291f525d17cde4970a5ada40644117c1: Verified the cited shared operations and concrete Pi adapters. The independent brief is complete; p2 reflects wanted unscheduled work. External model evidence is optional and does not block the specified keyless work.
Activity
schlessera commentedon Nov 8, 2026
Claimed as part of the #3640 epic run (claim token
c3640-ec699b9a-3645).spike/3645-multi-query-search, PR targeting the epic integration branchepic/3640-bounded-retrieval; the epic lands onmainas one batch.origin/main1619741): every code citation in this body still points at its named anchor.schlessera commentedon Nov 8, 2026
Claimed as part of the #3640 epic run (claim token
c3640-ec699b9a-3645).spike/3645-multi-query-search, with a PR targeting the epic integration branchepic/3640-bounded-retrieval.experiments/bounded-read/, merged on the epic branch at 8843b7b.docs: record a no-go for bounded multi-query search (#3645) (#3691)
schlessera commentedon Nov 8, 2026
Spike result (2026-11-08): no-go. Keep parallel single-query
brain_searchcalls.Delivered in #3691, merged into
epic/3640-bounded-retrievalas 1890c13. The record isdocs/decisions/multi-query-search.md, and the harness isexperiments/multi-query-search.test.ts, which reuses the #3641 helpers.brain_searchcalls in one assistant message already cost the same two provider requests as one batch. This was measured with Pi's scripted provider, so it shows runtime mechanics only, not what a model would choose.The record still specifies the contract a future proposal would start from: query names, order, per-query errors, repeated queries, limits, cancellation, one index snapshot and #3644 path scope. Its 11 mutation receipts are in #3691.
Follow-ups filed: #3695 (search path scope before ranking, the one gap with a measured cost), #3696 (Pi search limit bound), #3697 (cancelled searches keep running). This issue stays open until the epic lands on
main.Merge pull request #3721 from schlessera/epic/3640-bounded-retrieval