Reasoner-Executor-Synthesizer: Scalable Agentic Architecture with Static O(1) Context Window
New three-layer agent design eliminates data hallucination and keeps token costs flat regardless of dataset size.
A new research paper by Ivan Dobrovolskyi introduces the Reasoner-Executor-Synthesizer (RES) architecture, a novel framework designed to solve two major problems plaguing current LLM agents: escalating token costs and data hallucination. Traditional Retrieval-Augmented Generation (RAG) systems feed entire retrieved documents into an LLM's context window, causing costs to scale linearly with dataset size and increasing the risk of the model generating false information. RES tackles this with a strict three-layer separation of duties.
The Reasoner layer parses user intent, the Executor layer performs deterministic data retrieval and aggregation using zero LLM tokens, and the Synthesizer layer generates the final narrative. Crucially, the Executor passes only fixed-size statistical summaries to the Synthesizer, not raw data. This design formally achieves O(1) token complexity, meaning query cost remains constant regardless of how large the underlying database grows.
The architecture was validated on ScholarSearch, a research assistant backed by the Crossref API containing over 130 million scholarly articles. Across 100 benchmark runs, RES queries cost a consistent mean of 1,574 tokens, whether searching through 42,000 or 16.3 million articles. By ensuring the LLM never sees raw records, the system eliminates data hallucination by construction, a significant step toward more reliable and predictable AI agents.
- Achieves O(1) token complexity, keeping costs at ~1,574 tokens regardless of dataset size from 42k to 16.3M articles.
- Eliminates data hallucination by design by preventing the LLM from ever seeing raw, retrieved data records.
- Uses a three-layer architecture (Reasoner, Executor, Synthesizer) where the Executor layer consumes zero LLM tokens.
Why It Matters
Enables cost-effective, reliable AI agents that can query massive databases without ballooning costs or generating false information.