# yxsh-codes/multi-agent-ai-research-system architecture

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

- Interactive diagram: https://gitdiagram.com/yxsh-codes/multi-agent-ai-research-system
- Repository: https://github.com/yxsh-codes/multi-agent-ai-research-system

## Overview

SwarmScholar takes a research topic through web search, page scraping, report drafting, and critique. Users can run this flow through the Streamlit interface or the command-line pipeline; both invoke agent and chain components defined in agents.py. The search and reader agents are configured with tools.py functions, which connect to Tavily and fetch web pages. The sampled code supports these main calls and data handoffs; no README was provided, and app.py was only partially excerpted.

Main entry points: [`app.py`](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/app.py) (Streamlit UI), [`pipeline.py`](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/pipeline.py) (CLI Pipeline), [`agents.py`](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py) (Search Agent), [`tools.py`](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/tools.py) (Web Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_ui["Streamlit UI<br/>[app.py]"]
  node_pipeline["CLI Pipeline<br/>[pipeline.py]"]
end

subgraph group_research["Research Workflow"]
  node_search["Search Agent<br/>[agents.py]"]
  node_reader["Reader Agent<br/>[agents.py]"]
  node_writer["Writer Chain<br/>[agents.py]"]
  node_critic["Critic Chain<br/>[agents.py]"]
end

subgraph group_integrations["Models And Tools"]
  node_search_tool["Web Search<br/>[tools.py]"]
  node_scraper["URL Scraper<br/>[tools.py]"]
  node_groq{{"Groq LLM"}}
  node_tavily{{"Tavily Search"}}
  node_web{{"Web Pages"}}
end

node_user(("Researcher"))

node_user -->|"enters topic"| node_ui
node_user -->|"enters topic"| node_pipeline
node_ui -->|"invokes"| node_search
node_ui -->|"invokes"| node_reader
node_ui -->|"invokes"| node_writer
node_ui -->|"invokes"| node_critic
node_pipeline -->|"invokes"| node_search
node_pipeline -->|"invokes"| node_reader
node_pipeline -->|"invokes"| node_writer
node_pipeline -->|"invokes"| node_critic
node_search -->|"registers tool"| node_search_tool
node_reader -->|"registers tool"| node_scraper
node_search_tool -->|"queries"| node_tavily
node_scraper -->|"fetches page"| node_web
node_search -->|"uses model"| node_groq
node_reader -->|"uses model"| node_groq
node_writer -->|"uses model"| node_groq
node_critic -->|"uses model"| node_groq

click node_ui "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/app.py"
click node_pipeline "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/pipeline.py"
click node_search "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py"
click node_reader "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py"
click node_writer "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py"
click node_critic "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py"
click node_search_tool "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/tools.py"
click node_scraper "https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/tools.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_pipeline toneBlue
class node_search,node_reader,node_writer,node_critic toneAmber
class node_search_tool,node_scraper,node_groq,node_tavily,node_web toneMint
class node_user toneIndigo
```

## Components

### User Entry

- [Streamlit UI](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/app.py): `app.py`
- [CLI Pipeline](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/pipeline.py): `pipeline.py`

### Research Workflow

- [Search Agent](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py): `agents.py`
- [Reader Agent](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py): `agents.py`
- [Writer Chain](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py): `agents.py`
- [Critic Chain](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/agents.py): `agents.py`

### Models And Tools

- [Web Search](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/tools.py): `tools.py`
- [URL Scraper](https://github.com/yxsh-codes/multi-agent-ai-research-system/blob/main/tools.py): `tools.py`
- **Groq LLM**
- **Tavily Search**
- **Web Pages**

### Other components

- **Researcher**

## Connections

- Researcher → Streamlit UI: enters topic (evidence: `app.py`)
- Researcher → CLI Pipeline: enters topic (evidence: `pipeline.py`)
- Streamlit UI → Search Agent: invokes (evidence: `app.py`)
- Streamlit UI → Reader Agent: invokes (evidence: `app.py`)
- Streamlit UI → Writer Chain: invokes (evidence: `app.py`)
- Streamlit UI → Critic Chain: invokes (evidence: `app.py`)
- CLI Pipeline → Search Agent: invokes (evidence: `pipeline.py`)
- CLI Pipeline → Reader Agent: invokes (evidence: `pipeline.py`)
- CLI Pipeline → Writer Chain: invokes (evidence: `pipeline.py`)
- CLI Pipeline → Critic Chain: invokes (evidence: `pipeline.py`)
- Search Agent → Web Search: registers tool (evidence: `agents.py`)
- Reader Agent → URL Scraper: registers tool (evidence: `agents.py`)
- Web Search → Tavily Search: queries (evidence: `tools.py`)
- URL Scraper → Web Pages: fetches page (evidence: `tools.py`)
- Search Agent → Groq LLM: uses model (evidence: `agents.py`)
- Reader Agent → Groq LLM: uses model (evidence: `agents.py`)
- Writer Chain → Groq LLM: uses model (evidence: `agents.py`)
- Critic Chain → Groq LLM: uses model (evidence: `agents.py`)
