Refactor analysis sandbox with document VFS and expanded search#342
Merged
Refactor analysis sandbox with document VFS and expanded search#342
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #342 +/- ##
==========================================
- Coverage 92.18% 91.78% -0.41%
==========================================
Files 75 73 -2
Lines 3954 3942 -12
==========================================
- Hits 3645 3618 -27
- Misses 309 324 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
12561ed to
0fa7271
Compare
Replace get_document() and get_docling_document() with a VFS at
/documents/{id}/ with metadata.json (eager), content.txt (lazy),
and items.jsonl (lazy). Keep search(), list_documents() (now returns
all), and llm() as external functions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
/documents/{id}/withmetadata.json(eager),content.txt(lazy), anditems.jsonl(lazy). Standard Pythonpathlib.Pathfor browsing and reading document content and structure.execute_codeskill tool: Direct code execution in the sandbox, surfaced as individual AG-UI events in the chat TUI. Items VFS uses a lazy bulk cache (~1s for 1000 documents vs 60s+ per-document queries).citeskill tool: Explicit citation registration with per-turn tracking viacitation_indexandcitationsfields in state--skillflag for chat TUI:haiku-rag chat -s rag -s analysisto enable specific skills--modeloverrides all agents: Chat, QA, research, and analysis agents all use the specified modelChanged
search,execute_code,cite,list_documents,get_documentdirectly — every tool call surfaces as an AG-UI event. Removes the 3rd agent layer whereask/analyze/researchspawned inner agents whose tool calls were invisible.agents/rlm/→agents/analysis/, all classes renamed (RLMResult→AnalysisResult, etc.)client.rlm()→client.analyze()haiku-rag rlm→haiku-rag analyzerlm_question→analyzerlm:→analysis:in YAML,RLMConfig→AnalysisConfigrag-rlm→rag-analysissearch()returns expanded results withdoc_item_refsandlabelsfor cross-referencing withitems.jsonllist_documentsskill tool takes no parameters — returns all documentscitation_index: dict[str, Citation](deduplicated) +citations: list[list[str]](per-turn chunk IDs) replaces flat citation listconfig.qa.max_searchesvisualize_chunkexpands context before resolving bounding boxes, so all pages the section spans get highlighted.Removed
askskill tool: Replaced by directsearch+cite— the skill sub-agent searches and answers directlyanalyzeskill tool: Replaced by directexecute_code+search+citeresearchskill tool: Removed from skill layer (still available via CLIhaiku-rag researchand MCP)get_document(),get_docling_document(): Removed from analysis sandbox — replaced by VFSget_chunk(): Removed from analysis sandbox — search results include expanded contextcreate_analysis_toolset(): Removed unusedtools/analysis.pymoduleqa_history,reportsfrom skill state: Conversational context handled by the outer chat agentcombine_filters,build_document_filter: Removed from public APImax_context_items: Removed fromSearchConfig—max_context_charsis the sole expansion constraintQAHistoryEntry,tools/qa.py: Removed unused QA history model and relevance threshold