Skip to content

Tony1986111/LangGraph_Research_Assistant

Repository files navigation

Research Assistant

A multi-agent research assistant built with LangGraph. Given a research topic, it generates a team of AI analyst personas that conduct parallel web-search-backed interviews, then synthesises their findings into a structured report.

Architecture

Graph structure

Node Role
create_analysts Generates analyst personas with distinct research angles using structured LLM output
human_feedback Interrupt point — user approves analysts or provides feedback to regenerate
conduct_interview Subgraph: each analyst asks questions, searches the web, and writes a section
write_report / write_introduction / write_conclusion Parallel synthesis nodes
finalize_report Assembles the final markdown report

See ARCHITECTURE.md for detailed design decisions.

Design Decisions

Parallel interviews via Send() — each analyst runs as a fully independent subgraph in parallel rather than sequentially, cutting total research time proportionally to the number of analysts.

Human-in-the-loop — the graph pauses after analyst generation so the user can steer the research direction before committing to the expensive interview phase.

Dual search (Tavily + Exa) — Tavily provides broad web coverage while Exa's highlight retrieval finds semantically relevant passages, giving the expert node richer and more targeted context.

SQLite checkpointing — every graph state transition is persisted, so sessions survive server restarts and can be resumed by thread ID.

Quick Start

1. Clone and configure

git clone https://github.com/Tony1986111/LangGraph_Research_Assistant
cd research_assistant
cp .env.example .env

Edit .env with your API keys:

DEEPSEEK_API_KEY=your_key_here
TAVILY_API_KEY=your_key_here
EXA_API_KEY=your_key_here

2. Run the backend

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn backend.app:app --reload --host 127.0.0.1 --port 8000

3. Run the frontend

In a separate terminal:

cd frontend
npm install
npm run dev

Open http://localhost:5173 (Vite's default port).

Docker (alternative)

If you prefer to run the backend in a container:

docker build -t research_assistant-backend .
docker run --env-file .env -p 8000:8000 research_assistant-backend

Then run the frontend as above.

Usage

  1. Enter a research topic and choose the number of analysts (1–5).
  2. Review the generated analyst personas.
  3. Approve them to start research, or provide feedback to regenerate.
  4. Watch the event timeline as parallel interviews run.
  5. Read the final report and explore each analyst's interview, search queries, and sources in the Interviews tab.

LangSmith (optional)

Add to .env to enable tracing of all LLM calls, tool calls, and graph runs:

LANGSMITH_API_KEY=your_key_here
LANGSMITH_TRACING_V2=true
LANGSMITH_PROJECT=research_assistant
LANGSMITH_ENDPOINT=https://api.smith.langchain.com

LangGraph Studio (optional)

To inspect and interact with the graph directly:

pip install "langgraph-cli[inmem]"
langgraph dev --port 8123

Open https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:8123.

Note: LangGraph Studio provides its own checkpointer. Before running Studio, remove the checkpointer argument from the final builder.compile() call in research_assistant.py:

# For Studio — remove checkpointer
graph = builder.compile(interrupt_before=['human_feedback'])

# For normal use — keep checkpointer
graph = builder.compile(interrupt_before=['human_feedback'], checkpointer=memory)

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors