# palakkumari19/multi-agent-research-assistant architecture

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

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

## Overview

The product is a Streamlit research assistant. A user submits a query; the app retrieves similar in-memory research, invokes the LangGraph workflow, displays the plan, findings, critique, and report, and saves the result to MongoDB and FAISS. The workflow explicitly dispatches Planner → Researcher → Critic → Writer. The README also documents history management and PDF export. The graph follows shown calls and documented capabilities; unsampled implementation details are not inferred.

Main entry points: [`app.py`](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/app.py) (Streamlit App), [`graph/workflow.py`](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/graph/workflow.py) (LangGraph Workflow), [`utils/llm.py`](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/llm.py) (LLM Client), [`memory/mongo_store.py`](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/memory/mongo_store.py) (MongoDB Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_ui["Streamlit App<br/>[app.py]"]
  node_pdf["PDF Generator<br/>[pdf_generator.py]"]
end

subgraph group_orchestration["Workflow Orchestration"]
  node_workflow["LangGraph Workflow<br/>[workflow.py]"]
  node_state["Research State<br/>[state.py]"]
end

subgraph group_research["Research Agents"]
  node_planner["Planner Agent<br/>[planner.py]"]
  node_researcher["Researcher Agent<br/>[researcher.py]"]
  node_critic["Critic Agent<br/>[critic.py]"]
  node_writer["Writer Agent<br/>[writer.py]"]
  node_websearch["Web Search<br/>[search.py]"]
end

subgraph group_services["AI and Search Services"]
  node_llm["LLM Client<br/>[llm.py]"]
  node_groq{{"Groq API"}}
  node_tavily{{"Tavily Search"}}
  node_config["Secret Configuration<br/>[config.py]"]
end

subgraph group_memory["Research Memory"]
  node_mongo["MongoDB Store<br/>[mongo_store.py]"]
  node_mongodb[("MongoDB Atlas")]
  node_faiss[("FAISS Memory<br/>[faiss_store.py]")]
  node_embeddings["Embedding Model<br/>[embeddings.py]"]
end

node_user(("Research User"))

node_user -->|"submits query"| node_ui
node_ui -->|"invokes"| node_workflow
node_workflow -->|"uses state"| node_state
node_workflow -->|"dispatches"| node_planner
node_workflow -->|"dispatches"| node_researcher
node_workflow -->|"dispatches"| node_critic
node_workflow -->|"dispatches"| node_writer
node_planner -->|"invokes"| node_llm
node_researcher -->|"searches questions"| node_websearch
node_websearch -->|"queries"| node_tavily
node_critic -->|"invokes"| node_llm
node_writer -->|"invokes"| node_llm
node_llm -->|"runs inference"| node_groq
node_llm -->|"gets API key"| node_config
node_websearch -->|"gets API key"| node_config
node_mongo -->|"gets connection URI"| node_config
node_ui -->|"retrieves similar"| node_faiss
node_ui -->|"stores research"| node_faiss
node_faiss -->|"embeds queries"| node_embeddings
node_ui -->|"loads and deletes history"| node_mongo
node_ui -->|"saves research"| node_mongo
node_mongo -->|"reads and writes"| node_mongodb
node_ui -->|"generates report PDF"| node_pdf

click node_ui "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/app.py"
click node_pdf "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/pdf_generator.py"
click node_workflow "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/graph/workflow.py"
click node_state "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/graph/state.py"
click node_planner "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/planner.py"
click node_researcher "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/researcher.py"
click node_critic "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/critic.py"
click node_writer "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/writer.py"
click node_websearch "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/search.py"
click node_llm "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/llm.py"
click node_config "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/config.py"
click node_mongo "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/memory/mongo_store.py"
click node_faiss "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/memory/faiss_store.py"
click node_embeddings "https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/embeddings.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_pdf,node_user toneBlue
class node_workflow,node_state toneAmber
class node_planner,node_researcher,node_critic,node_writer,node_websearch toneMint
class node_llm,node_groq,node_tavily,node_config toneRose
class node_mongo,node_mongodb,node_faiss,node_embeddings toneIndigo
```

## Components

### User Interface

- [Streamlit App](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/app.py): `app.py`
- [PDF Generator](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/pdf_generator.py): `utils/pdf_generator.py`

### Workflow Orchestration

- [LangGraph Workflow](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/graph/workflow.py): `graph/workflow.py`
- [Research State](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/graph/state.py): `graph/state.py`

### Research Agents

- [Planner Agent](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/planner.py): `agents/planner.py`
- [Researcher Agent](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/researcher.py): `agents/researcher.py`
- [Critic Agent](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/critic.py): `agents/critic.py`
- [Writer Agent](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/agents/writer.py): `agents/writer.py`
- [Web Search](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/search.py): `utils/search.py`

### AI and Search Services

- [LLM Client](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/llm.py): `utils/llm.py`
- **Groq API**
- **Tavily Search**
- [Secret Configuration](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/config.py): `utils/config.py`

### Research Memory

- [MongoDB Store](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/memory/mongo_store.py): `memory/mongo_store.py`
- **MongoDB Atlas**
- [FAISS Memory](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/memory/faiss_store.py): `memory/faiss_store.py`
- [Embedding Model](https://github.com/palakkumari19/multi-agent-research-assistant/blob/main/utils/embeddings.py): `utils/embeddings.py`

### Other components

- **Research User**

## Connections

- Research User → Streamlit App: submits query (evidence: `app.py`)
- Streamlit App → LangGraph Workflow: invokes (evidence: `app.py`)
- LangGraph Workflow → Research State: uses state (evidence: `graph/workflow.py`)
- LangGraph Workflow → Planner Agent: dispatches (evidence: `graph/workflow.py`)
- LangGraph Workflow → Researcher Agent: dispatches (evidence: `graph/workflow.py`)
- LangGraph Workflow → Critic Agent: dispatches (evidence: `graph/workflow.py`)
- LangGraph Workflow → Writer Agent: dispatches (evidence: `graph/workflow.py`)
- Planner Agent → LLM Client: invokes (evidence: `agents/planner.py`)
- Researcher Agent → Web Search: searches questions (evidence: `agents/researcher.py`)
- Web Search → Tavily Search: queries (evidence: `utils/search.py`)
- Critic Agent → LLM Client: invokes (evidence: `agents/critic.py`)
- Writer Agent → LLM Client: invokes (evidence: `agents/writer.py`)
- LLM Client → Groq API: runs inference (evidence: `utils/llm.py`)
- LLM Client → Secret Configuration: gets API key (evidence: `utils/llm.py`)
- Web Search → Secret Configuration: gets API key (evidence: `utils/search.py`)
- MongoDB Store → Secret Configuration: gets connection URI (evidence: `memory/mongo_store.py`)
- Streamlit App → FAISS Memory: retrieves similar (evidence: `app.py`)
- Streamlit App → FAISS Memory: stores research (evidence: `app.py`)
- FAISS Memory → Embedding Model: embeds queries (evidence: `memory/faiss_store.py`)
- Streamlit App → MongoDB Store: loads and deletes history (evidence: `app.py`)
- Streamlit App → MongoDB Store: saves research (evidence: `app.py`)
- MongoDB Store → MongoDB Atlas: reads and writes (evidence: `memory/mongo_store.py`)
- Streamlit App → PDF Generator: generates report PDF (evidence: `app.py`)
