Skip to main content
Research is knowledge accumulation under uncertainty. You start with a question, gather information from multiple sources, evaluate what you find, synthesize it into understanding, and produce something useful—a report, a summary, an answer. Unlike the virtual office where work items have clear completion criteria, research tasks often expand as you learn more. A question about market trends leads to competitor analysis which surfaces regulatory considerations which require legal research. Good research systems handle this expansion gracefully while producing coherent outputs. This chapter builds a research system that accumulates knowledge over time. Each research task contributes to a growing knowledge base that informs future tasks. The system gets smarter with use—not through model fine-tuning, but through accumulated, retrievable knowledge that grounds future reasoning.

12.1 The Research Challenge

Research differs from other agentic tasks in several ways that affect system design. Uncertain scope. When you ask “What are the security implications of this architecture?”, you don’t know upfront how many sources you’ll need, how deep you’ll go, or what tangents matter. The system must explore adaptively rather than following a fixed plan. Variable source quality. Web search results, academic papers, internal documents, expert opinions—these sources have different reliability, different biases, different levels of detail. The system must assess and weight sources appropriately. Synthesis over retrieval. Finding information isn’t enough. Research requires connecting facts, identifying patterns, resolving contradictions, and producing coherent narratives from fragmented sources. This is generative work that uses retrieved information as input. Cumulative value. Research on one topic often relates to past or future research. A system that forgets everything after each task wastes the understanding it developed. Persistent knowledge makes the system more capable over time. These characteristics shape the architecture we’ll build: adaptive exploration rather than fixed plans, source evaluation and scoring, synthesis as a distinct phase, and a growing knowledge base that persists across tasks.

12.2 System Architecture

The research system has four main components that work together in a pipeline with feedback loops.
The Planner takes a research topic and decomposes it into specific questions. It consults the knowledge base to understand what’s already known and identifies gaps. Planning is adaptive—the plan may be revised as research reveals new questions. The Gatherer executes searches, retrieves documents, and collects raw information. It manages multiple source types—web search, document retrieval, database queries—and tracks provenance so findings can be cited. The Analyzer evaluates and processes gathered information. It scores sources for reliability, extracts key findings, identifies contradictions, and flags gaps that need more research. Analysis may trigger additional gathering cycles. The Writer synthesizes findings into coherent output. It structures information, ensures claims are supported by sources, and produces reports that answer the original questions. The Knowledge Base persists across all tasks. High-quality findings get stored with their sources and context. Future research retrieves relevant prior knowledge, building on what the system has learned.

12.3 The Knowledge Base

The knowledge base is the system’s long-term memory. Unlike conversation history (which stores what was said) or task state (which stores current progress), the knowledge base stores what the system knows—facts, findings, and insights extracted from research.
The knowledge base uses vector storage for semantic retrieval: each entry is embedded into a vector representation (for example, using an embedding model), and queries are embedded into the same space so the store can return entries with high similarity to the query vector. When researching a new topic, the system queries for related knowledge and incorporates it into context. This means research on “authentication best practices” can surface knowledge from earlier research on “OAuth implementation” or “session management.” To support semantic retrieval, deduplication, and cross-linking, you can implement the knowledge base as a thin wrapper around a vector store:
The knowledge base implements several patterns from earlier chapters. Memory provides the storage structure. Learning happens through accumulation—each research task potentially adds knowledge. Evaluation appears in confidence scores and source reliability ratings. The linking of related entries creates a semantic network that grows richer over time.

12.4 The Research Pipeline

With the knowledge base as foundation, let’s build the research pipeline that populates and uses it.

The Planner

The planner turns a topic into a prioritized question list, reusing prior knowledge to avoid redundant work:
The planner demonstrates context construction—it retrieves relevant prior knowledge and includes it when generating questions. This grounding prevents the system from researching what it already knows and focuses effort on actual gaps.

The Gatherer

The gatherer fans out across the configured sources and records provenance for each snippet it retrieves:
The gatherer demonstrates agency through its tools for searching different sources. Source reliability estimation implements simple evaluation—not all sources are equal. The streaming findings provide observability into gathering progress.

The Analyzer

Analysis transforms raw findings into evaluated, connected knowledge. This is where signal gets separated from noise.
The analyzer implements the generate-filter pattern—scoring findings and keeping only high-quality ones. Contradiction detection is a form of self-critique, catching inconsistencies before they reach the output. For example, if one fact claims “service A encrypts all data at rest” and another states “backups for service A are stored unencrypted”, the analyzer will flag this pair so the writer can either reconcile it or highlight the inconsistency explicitly in the report. Gap identification enables adaptive planning—if gaps exist, the system can trigger more gathering.

The Writer

Writing synthesizes analysis into coherent output. The writer’s job is to answer the original questions using the facts gathered, with appropriate citations. The writer assembles an outline, fills in sections from facts, and adds citations and summaries to produce a structured report:
The writer demonstrates structured artifact creation—the report has defined structure with sections, citations, and metadata. Citation compilation ensures grounding—claims trace back to sources.

12.5 The Complete System

Now we wire the components together into a complete research system.

12.6 Learning Through Accumulation

The research system learns by accumulating knowledge. Each research task potentially adds to the knowledge base, and future tasks retrieve relevant prior knowledge. As the knowledge base grows, later research can reuse earlier findings instead of rediscovering them, so the system needs fewer external queries to reach the same level of detail. Consider researching “Kubernetes security best practices” after previously researching “container isolation” and “network policies.” The planner retrieves related knowledge, identifies what’s already known, and focuses new research on actual gaps. The analyzer can cross-reference new findings against prior knowledge. The writer can draw on accumulated understanding to produce richer reports. For instance, once the system has accumulated patterns of common misconfigurations from several cloud security reviews, later Kubernetes security research can reuse those patterns to focus search on likely weak points rather than relearning them from scratch. This is learning without model fine-tuning. The model’s capabilities don’t change, but the context it operates in becomes richer. The knowledge base acts as an external memory that the model can draw upon, effectively expanding its expertise through accumulated research. This form of learning has limits: the knowledge base can become stale or contradictory, and retrieval quality degrades without curation. In practice you need periodic pruning, re-validation of older entries, and monitoring of retrieval quality as the store grows.

Key Takeaways

  • Research systems require adaptive exploration, not fixed plans
  • Source evaluation separates signal from noise—not all information is equally reliable
  • Synthesis is generative work distinct from retrieval
  • Knowledge accumulation lets later research reuse earlier findings instead of repeating work
  • The gather-analyze-write pipeline provides clear separation of concerns
  • Confidence scoring and gap identification enable adaptive depth

Transition

Chapter 12 built a system that accumulates knowledge through research. Chapter 13: Code Agent addresses a different domain—verification-driven development where tests provide the feedback signal that drives iteration toward correctness.