Home / Articles

Building a Deep Research Agent with LangChain Deep Agents and

A deep research agent with LangChain Deep Agents and Liner search: why the search layer matters, search vs reasoning, and how the LLM plans its research.

Publisher: REACTAPP.TOP12 min read2724 words

This article is published in English.

Sources: Building a Deep Research Agent with LangChain Deep Agents and Liner

The following notes reconstruct a practical path around “Building a Deep Research Agent with LangChain Deep Agents and Liner”. Emphasis stays on contracts, checks, and drop-in code placeholders rather than motivational framing. When working through the Overview stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

What We’re Building

The What We re Building stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts.

User Question
                          │
                          ▼
                  ┌──────────────┐
                  │ Research Plan│
                  └──────┬───────┘
                         │
              Break question into tasks
                         │
                         ▼
                  ┌──────────────┐
                  │    Search    │
                  │    (Liner)   │
                  └──────┬───────┘
                         │
                         ▼
                  ┌──────────────┐
                  │   Sources    │
                  │ URLs / Dates │
                  │ Descriptions │
                  └──────┬───────┘
                         │
                         ▼
                  ┌──────────────┐
                  │    Agent     │
                  │   Reasoning  │
                  │   Synthesis  │
                  └──────┬───────┘
                         │
                         ▼
                  ┌──────────────┐
                  │ Cited Report │
                  └──────┬───────┘
                         │
                         ▼
                    Markdown File

Why the Search Layer Matters

The Why the Search Layer stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts.

Title
URL
Description
Date
Liner
  │
  ├── Find relevant information
  ├── Return search results
  └── Provide source metadata
          │
          ▼
Deep Research Agent
  │
  ├── Plan
  ├── Reason
  ├── Compare sources
  ├── Synthesize
  └── Cite

Search vs. Reasoning

The Search vs Reasoning stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Budget tokens per turn and per session. Agentic tools expand context aggressively; hard caps keep demos from becoming surprise invoices. The Search vs Reasoning stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

User Question
      │
      ▼
Search API
      │
      ▼
Final Answer
User Question
      │
      ▼
Research Agent
      │
      ├── Plan
      │
      ├── Search ───────► Liner
      │                    │
      │                    ▼
      │                 Sources
      │                    │
      ◄────────────────────┘
      │
      ├── Analyze
      ├── Compare
      ├── Synthesize
      └── Cite
             │
             ▼
        Final Report

The Research Workflow

For the The Research Workflow stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness.

Research
   ↓
Plan
   ↓
Search
   ↓
Collect Sources
   ↓
Synthesize
   ↓
Cite
   ↓
Save Report

1. Research

For the 1 Research stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness.

Research the current state of open-source
multimodal AI models.

2. Plan

For the 2 Plan stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness. For the 2 Plan stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

1. Identify major open-source multimodal models.
2. Compare their capabilities.
3. Check their latest releases.
4. Find benchmark information.
5. Identify their licenses.
6. Compare model sizes and requirements.

When working through the 3 Search stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Checkpoint after expensive steps. Resume should not re-bill the same LLM call when an operator retries a later node.

query = "latest open source multimodal AI models"
{
    "title": "Example AI Model",
    "url": "https://example.com/model",
    "description": "Information about the model...",
    "date": "2026-08-20"
}

4. Collect Sources

When working through the 4 Collect Sources stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Checkpoint after expensive steps. Resume should not re-bill the same LLM call when an operator retries a later node.

Query 1
  ↓
Sources A, B, C
Query 2
  ↓
Sources D, E, F
Query 3
  ↓
Sources G, H, I

5. Synthesize

When working through the 5 Synthesize stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Checkpoint after expensive steps. Resume should not re-bill the same LLM call when an operator retries a later node. When working through the 5 Synthesize stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

Source A → claims X
Source B → confirms X
Source C → provides additional context

6. Cite

The 6 Cite stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts.

## Overview
The project was released in 2026 and focuses on
efficient local inference. [1]
## Performance
According to the project's benchmark results,
the model improves performance compared with
the previous version. [2]
## Sources
[1] https://example.com/project
[2] https://example.com/benchmark

Saving the Research Report

The Saving the Research Report stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts.

research_report.md
Question
   ↓
Agent
   ↓
Research
   ↓
Sources
   ↓
Citations
   ↓
Markdown Report

Inspecting the Agent With Deep Agents UI

The Inspecting the Agent With stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts. The Inspecting the Agent With stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

Question → Answer
Research Question
      ↓
Research Plan
      ↓
Search Call
      ↓
Retrieved Sources
      ↓
Additional Search
      ↓
Source Analysis
      ↓
Final Synthesis
      ↓
Report

Project Requirements

For the Project Requirements stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness.

Clone the Repository

For the Clone the Repository stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness.

git clone https://github.com/Sumanth077/Hands-On-AI-Engineering.git
cd Hands-On-AI-Engineering/ai_agents/deep_research_assistant

Setting Up the Backend

For the Setting Up the Backend stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Put human approval on edges that spend money or change production data. Compile-time wiring does not equal business completeness. For the Setting Up the Backend stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
pip install -U "langgraph-cli[inmem]"

Configure Environment Variables

When working through the Configure Environment Variables stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Checkpoint after expensive steps. Resume should not re-bill the same LLM call when an operator retries a later node.

copy .env.example .env
MISTRAL_API_KEY=your_mistral_api_key
LINER_API_KEY=your_liner_api_key

Start the Backend

When working through the Start the Backend stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Checkpoint after expensive steps. Resume should not re-bill the same LLM call when an operator retries a later node.

langgraph dev --port 2024
http://localhost:2024

Setting Up the Frontend

When working through the Setting Up the Frontend stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Checkpoint after expensive steps. Resume should not re-bill the same LLM call when an operator retries a later node. When working through the Setting Up the Frontend stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish.

cd ../frontend
yarn install
yarn dev
http://localhost:3000

Connect the UI to the Agent

The Connect the UI to stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts.

http://localhost:3000
http://localhost:2024
agent

What Happens When You Ask a Question?

The What Happens When You stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Keep graph state flat and typed. Nested blobs hide which node wrote which field and break resume after interrupts.

What are the most promising open-source AI
coding agents available today?
User Question
      │
      ▼
Understand the problem
      │
      ▼
Create research plan
      │
      ├── Find major projects
      ├── Check current releases
      ├── Compare capabilities
      └── Find primary sources
      │
      ▼
Search with Liner
      │
      ▼
Collect results
      │
      ▼
Evaluate evidence
      │
      ▼
Search again if necessary
      │
      ▼
Synthesize findings
      │
      ▼
Add citations
      │
      ▼
Save Markdown report

Final Thoughts

The Final Thoughts stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope.

Plan
 ↓
Search
 ↓
Collect evidence
 ↓
Reason
 ↓
Synthesize
 ↓
Cite
 ↓
Save

Operational checklist