Give the model full retrieved chunks instead of 400-character snippets #83

Merged
ryan merged 1 commits from perf/full-search-chunks into main 2026-10-13 03:41:12 -04:00
Owner

Context compaction replaces a tool's text with its artifact, and the search.documents artifact only carries 400-character UI snippets. So the full ~1,000-character chunk the retriever found never reached the model, and answers were built on fragments.

  • simba_search and obsidian_search_notes attach the full chunk text as model_context, the mechanism focused note reads already use. Compaction prefers it, shortens content under budget pressure, and keeps source ids. When no row fits, the ids survive in results_compaction.omitted_source_refs.
  • The persisted artifact and the UI are unchanged: persistence only stores data.
  • The per-chunk Source: {raw metadata dict} line (about a fifth of search output tokens) becomes Title | Date | Source. The Citation: /sources/<id> line is unchanged.

Review: Sonnet worker plus two review rounds. Round 1 fixed a failing tight-budget test and an import that made rag depend on conversation at module load. Round 2 checked the zero-row case; I added a test for it.

547 unit tests, Ruff.

🤖 Generated with Claude Code

Context compaction replaces a tool's text with its artifact, and the `search.documents` artifact only carries 400-character UI snippets. So the full ~1,000-character chunk the retriever found never reached the model, and answers were built on fragments. - `simba_search` and `obsidian_search_notes` attach the full chunk text as `model_context`, the mechanism focused note reads already use. Compaction prefers it, shortens `content` under budget pressure, and keeps source ids. When no row fits, the ids survive in `results_compaction.omitted_source_refs`. - The persisted artifact and the UI are unchanged: persistence only stores `data`. - The per-chunk `Source: {raw metadata dict}` line (about a fifth of search output tokens) becomes `Title | Date | Source`. The `Citation: /sources/<id>` line is unchanged. **Review:** Sonnet worker plus two review rounds. Round 1 fixed a failing tight-budget test and an import that made `rag` depend on `conversation` at module load. Round 2 checked the zero-row case; I added a test for it. 547 unit tests, Ruff. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 1 commit 2026-10-13 03:41:07 -04:00
Give the model full retrieved chunks instead of 400-character snippets
CI / backend (pull_request) Successful in 41s
CI / frontend (pull_request) Failing after 7s
CI / backend (push) Successful in 42s
CI / frontend (push) Failing after 6s
b8ccc88b58
Compaction replaces a tool's text with its artifact, and the search artifact
only carries UI snippets, so the full chunk the retriever found never reached
the model. Search tools now attach the full text as model_context, which
compaction prefers and shortens under budget pressure while keeping source
ids; the persisted artifact and UI are unchanged. The per-chunk header drops
the raw metadata dict (about a fifth of search output tokens) for title, date
and source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryan merged commit 8c0cedb3db into main 2026-10-13 03:41:12 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#83