Repository navigation
Issues in Deep Researcher version 2.1.0 #26
pixelThreader
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Step-wise Reasoning Engine: Architectural Scan & Proposals
This document provides a comprehensive technical scan of the Deep-Researcher-V2 backend and presents architectural proposals to optimize the step-wise reasoning engine for local, resource-constrained systems running Ollama (with a strict 8k token context window).
1. Executive Summary
The deep researcher has a phenomenal foundation: it leverages
crawl4aifor parallelized high-performance scraping, maps data cleanups elegantly to local databases, and attempts a structured step-wise execution.However, running a deep research ReAct loop on local models (e.g., gemma4:e2b or gemma4:e4b) within an 8k token limit creates two massive bottlenecks:
thread_idand has no access to a vector database or running synthesis, leading to repetitive searches and fragmented findings.2. v2.0.1 Project Scan: Root Causes of Failure
🔍 Cause A: Raw Tool Output Context Blowouts
In
MCP_Tools_Server/main.pyandsrc/web/scraper.py, theweb_searchandread_webpagestools leveragecrawl4aito scrape full page markdown.web_search(query="...")orread_webpages(urls=[...]).ToolMessage(Observation).A single average webpage's markdown is 3,000 to 10,000 tokens. Scraped batches of 5–10 pages easily result in 30k–80k tokens.
Since the model's context window is only 8k tokens, Ollama is forced to truncate. This leads to:
🔍 Cause B: Total Step Isolation (Zero Inter-Step Memory)
In
backend/main/src/research/layer2/orchestrator1.py, the orchestrator processes the plan steps sequentially:thread_idand empty conversation history._build_system_messagemaps only the current step description and suggested tools. It never injects summaries, findings, or key facts discovered in steps0throughN-1.ChromaDBcollectionresearch_{research_id}) is defined inrag.py, it is never queried during the reasoning phase. It is only populated inorchestrator2.pyafter all steps are completed, andrag_searchis never added to the reasoning agent's tool set.🔍 Cause C: Local Model ReAct Instability
Local models have significantly weaker instruction-following capabilities than frontier APIs. ReAct loops require strict JSON block formatting or function-calling schemas.
When context limits are approached, local models lose their tracking accuracy. They begin to hallucinate tool names, skip arguments, fail to output the final answer, or loop endlessly calling the same search tool.
Core areas to focus on:
All reactions