# koushiksamudrala/langgraph-multi-agent-research-assistant architecture

> Architecture diagram of the GitHub repository koushiksamudrala/langgraph-multi-agent-research-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/koushiksamudrala/langgraph-multi-agent-research-assistant
- Repository: https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant

## Overview

A web research assistant takes a user question through a Streamlit UI and FastAPI endpoint into a LangGraph search–critique loop, then synthesizes a structured report. The API loads related research memories before graph execution; completed reports are compressed and persisted for future runs. The graph and agents use a shared typed state, while Gemini, Tavily, and Chroma provide model, search, and storage services. The README documents these capabilities; sampled source confirms the main calls and routing. The request’s max_iterations field is reserved; the graph currently uses a fixed limit.

Main entry points: [`app/graph.py`](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/graph.py) (Graph Orchestrator), [`app/api.py`](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/api.py) (Research API), [`app/agents.py`](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py) (Report Synthesis), [`app/memory.py`](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py) (Chroma Collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_ui["Streamlit UI<br/>[streamlit_app.py]"]
  node_api["Research API<br/>[api.py]"]
end

subgraph group_workflow["Research Workflow"]
  node_state["Research State<br/>[state.py]"]
  node_graph["Graph Orchestrator<br/>[graph.py]"]
  node_router["Loop Decision<br/>[graph.py]"]
end

subgraph group_agents["Research Agents"]
  node_search["Web Search<br/>[agents.py]"]
  node_critique["Results Critique<br/>[agents.py]"]
  node_synthesis["Report Synthesis<br/>[agents.py]"]
  node_llm["Gemini Factory<br/>[llm.py]"]
end

subgraph group_memory["Research Memory"]
  node_retrieve["Memory Retrieval<br/>[memory.py]"]
  node_compress["Report Compression<br/>[memory.py]"]
  node_chroma[("Chroma Collection<br/>[memory.py]")]
end

node_user(("Research User"))
node_gemini["Google Gemini"]
node_tavily["Tavily Search"]
node_embeddings["Hugging Face Embeddings"]

node_user -->|"asks question"| node_ui
node_ui -->|"posts query"| node_api
node_api -->|"loads memories"| node_retrieve
node_retrieve -->|"similarity search"| node_chroma
node_chroma -->|"embeds queries"| node_embeddings
node_api -->|"invokes graph"| node_graph
node_graph -->|"dispatches"| node_search
node_search -->|"searches web"| node_tavily
node_graph -->|"dispatches"| node_critique
node_graph -->|"routes by critique"| node_router
node_router -->|"repeats search"| node_search
node_graph -->|"dispatches"| node_synthesis
node_critique -->|"gets model"| node_llm
node_synthesis -->|"gets model"| node_llm
node_llm -->|"configures model"| node_gemini
node_synthesis -->|"uses past reports"| node_retrieve
node_synthesis -->|"saves report"| node_compress
node_compress -->|"summarizes report"| node_llm
node_compress -->|"stores summary"| node_chroma
node_chroma -->|"embeds documents"| node_embeddings
node_api -->|"returns report"| node_ui

click node_ui "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/frontend/streamlit_app.py"
click node_api "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/api.py"
click node_state "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/state.py"
click node_graph "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/graph.py"
click node_search "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py"
click node_critique "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py"
click node_router "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/graph.py"
click node_synthesis "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py"
click node_llm "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/llm.py"
click node_retrieve "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py"
click node_compress "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py"
click node_chroma "https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_api,node_user toneBlue
class node_state,node_graph,node_router toneAmber
class node_search,node_critique,node_synthesis,node_llm toneMint
class node_retrieve,node_compress,node_chroma toneRose
class node_gemini,node_tavily,node_embeddings toneIndigo
```

## Components

### User Interface

- [Streamlit UI](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/frontend/streamlit_app.py): `frontend/streamlit_app.py`
- [Research API](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/api.py): `app/api.py`

### Research Workflow

- [Research State](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/state.py): `app/state.py`
- [Graph Orchestrator](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/graph.py): `app/graph.py`
- [Loop Decision](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/graph.py): `app/graph.py`

### Research Agents

- [Web Search](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py): `app/agents.py`
- [Results Critique](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py): `app/agents.py`
- [Report Synthesis](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/agents.py): `app/agents.py`
- [Gemini Factory](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/llm.py): `app/llm.py`

### Research Memory

- [Memory Retrieval](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py): `app/memory.py`
- [Report Compression](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py): `app/memory.py`
- [Chroma Collection](https://github.com/koushiksamudrala/langgraph-multi-agent-research-assistant/blob/main/app/memory.py): `app/memory.py`

### Other components

- **Research User**
- **Google Gemini**
- **Tavily Search**
- **Hugging Face Embeddings**

## Connections

- Research User → Streamlit UI: asks question (evidence: `frontend/streamlit_app.py`)
- Streamlit UI → Research API: posts query (evidence: `frontend/streamlit_app.py`)
- Research API → Memory Retrieval: loads memories (evidence: `app/api.py`)
- Memory Retrieval → Chroma Collection: similarity search (evidence: `app/memory.py`)
- Chroma Collection → Hugging Face Embeddings: embeds queries (evidence: `app/memory.py`)
- Research API → Graph Orchestrator: invokes graph (evidence: `app/api.py`)
- Graph Orchestrator → Web Search: dispatches (evidence: `app/graph.py`)
- Web Search → Tavily Search: searches web (evidence: `app/agents.py`)
- Graph Orchestrator → Results Critique: dispatches (evidence: `app/graph.py`)
- Graph Orchestrator → Loop Decision: routes by critique (evidence: `app/graph.py`)
- Loop Decision → Web Search: repeats search (evidence: `app/graph.py`)
- Graph Orchestrator → Report Synthesis: dispatches (evidence: `app/graph.py`)
- Results Critique → Gemini Factory: gets model (evidence: `app/agents.py`)
- Report Synthesis → Gemini Factory: gets model (evidence: `app/agents.py`)
- Gemini Factory → Google Gemini: configures model (evidence: `app/llm.py`)
- Report Synthesis → Memory Retrieval: uses past reports (evidence: `app/agents.py`)
- Report Synthesis → Report Compression: saves report (evidence: `app/agents.py`)
- Report Compression → Gemini Factory: summarizes report (evidence: `app/memory.py`)
- Report Compression → Chroma Collection: stores summary (evidence: `app/memory.py`)
- Chroma Collection → Hugging Face Embeddings: embeds documents (evidence: `app/memory.py`)
- Research API → Streamlit UI: returns report (evidence: `README.md`)
