# 0xai001/agentic-ai-public architecture

> Architecture diagram of the GitHub repository 0xai001/agentic-ai-public, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0xai001/agentic-ai-public
- Repository: https://github.com/0xai001/agentic-ai-public

## Overview

This is a FastAPI research-reporting application. A user submits a prompt through the web UI or API; the API creates a task, asks a planner for steps, and runs those steps in a background thread through research, writing, and editing agents. Progress is held in process memory, while task status and final results are stored in Postgres. The README also documents Tavily, arXiv, and Wikipedia research. Agent-to-tool and API relationships are shown where excerpts or README statements support them; unsampled dispatch details are not inferred.

Main entry points: [`main.py`](https://github.com/0xai001/agentic-ai-public/blob/main/main.py) (FastAPI endpoints), [`src/research_tools.py`](https://github.com/0xai001/agentic-ai-public/blob/main/src/research_tools.py) (Research tools), [`src/planning_agent.py`](https://github.com/0xai001/agentic-ai-public/blob/main/src/planning_agent.py) (Step executor), [`src/agents.py`](https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py) (Research agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Web API and Tasks"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_ui["Web UI<br/>[index.html]"]
  node_progress[("Progress state<br/>[main.py]")]
  node_tasks[("Task records<br/>[main.py]")]
end

subgraph group_workflow["Research Workflow"]
  node_planner["Workflow planner<br/>[planning_agent.py]"]
  node_executor["Step executor<br/>[planning_agent.py]"]
  node_research["Research agent<br/>[agents.py]"]
  node_writer["Report writer<br/>[agents.py]"]
  node_editor["Report editor<br/>[agents.py]"]
end

subgraph group_tools["Research Sources"]
  node_research_tools["Research tools<br/>[research_tools.py]"]
end

subgraph group_integrations["External Services"]
  node_tavily{{"Web search"}}
  node_arxiv{{"arXiv search"}}
  node_wikipedia{{"Wikipedia"}}
  node_llm{{"LLM service"}}
  node_postgres[("Postgres")]
end

node_user(("Researcher"))

node_user -->|"opens"| node_ui
node_ui -.->|"submits task"| node_api
node_user -->|"requests report"| node_api
node_api -->|"plans workflow"| node_planner
node_api -->|"runs steps"| node_executor
node_planner -.->|"generates plan"| node_llm
node_executor -->|"dispatches research"| node_research
node_executor -->|"dispatches writing"| node_writer
node_executor -->|"dispatches editing"| node_editor
node_research -->|"offers tools"| node_research_tools
node_research -->|"requests completion"| node_llm
node_writer -->|"drafts report"| node_llm
node_editor -->|"revises report"| node_llm
node_research_tools -->|"searches web"| node_tavily
node_research_tools -->|"searches papers"| node_arxiv
node_research_tools -->|"retrieves summaries"| node_wikipedia
node_research_tools -->|"fetches PDFs"| node_arxiv
node_api -->|"updates and serves"| node_progress
node_api -->|"stores task results"| node_tasks
node_tasks -->|"persists records"| node_postgres

click node_api "https://github.com/0xai001/agentic-ai-public/blob/main/main.py"
click node_ui "https://github.com/0xai001/agentic-ai-public/blob/main/templates/index.html"
click node_progress "https://github.com/0xai001/agentic-ai-public/blob/main/main.py"
click node_tasks "https://github.com/0xai001/agentic-ai-public/blob/main/main.py"
click node_planner "https://github.com/0xai001/agentic-ai-public/blob/main/src/planning_agent.py"
click node_executor "https://github.com/0xai001/agentic-ai-public/blob/main/src/planning_agent.py"
click node_research "https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py"
click node_writer "https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py"
click node_editor "https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py"
click node_research_tools "https://github.com/0xai001/agentic-ai-public/blob/main/src/research_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_api,node_ui,node_progress,node_tasks toneBlue
class node_planner,node_executor,node_research,node_writer,node_editor toneAmber
class node_research_tools toneMint
class node_tavily,node_arxiv,node_wikipedia,node_llm,node_postgres toneRose
class node_user toneIndigo
```

## Components

### Web API and Tasks

- [FastAPI endpoints](https://github.com/0xai001/agentic-ai-public/blob/main/main.py): `main.py`
- [Web UI](https://github.com/0xai001/agentic-ai-public/blob/main/templates/index.html): `templates/index.html`
- [Progress state](https://github.com/0xai001/agentic-ai-public/blob/main/main.py): `main.py`
- [Task records](https://github.com/0xai001/agentic-ai-public/blob/main/main.py): `main.py`

### Research Workflow

- [Workflow planner](https://github.com/0xai001/agentic-ai-public/blob/main/src/planning_agent.py): `src/planning_agent.py`
- [Step executor](https://github.com/0xai001/agentic-ai-public/blob/main/src/planning_agent.py): `src/planning_agent.py`
- [Research agent](https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py): `src/agents.py`
- [Report writer](https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py): `src/agents.py`
- [Report editor](https://github.com/0xai001/agentic-ai-public/blob/main/src/agents.py): `src/agents.py`

### Research Sources

- [Research tools](https://github.com/0xai001/agentic-ai-public/blob/main/src/research_tools.py): `src/research_tools.py`

### External Services

- **Web search**
- **arXiv search**
- **Wikipedia**
- **LLM service**
- **Postgres**

### Other components

- **Researcher**

## Connections

- Researcher → Web UI: opens (evidence: `README.md`)
- Web UI → FastAPI endpoints: submits task (evidence: `README.md`)
- Researcher → FastAPI endpoints: requests report (evidence: `README.md`)
- FastAPI endpoints → Workflow planner: plans workflow (evidence: `main.py`)
- FastAPI endpoints → Step executor: runs steps (evidence: `main.py`)
- Workflow planner → LLM service: generates plan (evidence: `src/planning_agent.py`)
- Step executor → Research agent: dispatches research (evidence: `src/planning_agent.py`)
- Step executor → Report writer: dispatches writing (evidence: `src/planning_agent.py`)
- Step executor → Report editor: dispatches editing (evidence: `src/planning_agent.py`)
- Research agent → Research tools: offers tools (evidence: `src/agents.py`)
- Research agent → LLM service: requests completion (evidence: `src/agents.py`)
- Report writer → LLM service: drafts report (evidence: `src/agents.py`)
- Report editor → LLM service: revises report (evidence: `src/agents.py`)
- Research tools → Web search: searches web (evidence: `README.md`)
- Research tools → arXiv search: searches papers (evidence: `src/research_tools.py`)
- Research tools → Wikipedia: retrieves summaries (evidence: `src/research_tools.py`)
- Research tools → arXiv search: fetches PDFs (evidence: `src/research_tools.py`)
- FastAPI endpoints → Progress state: updates and serves (evidence: `main.py`)
- FastAPI endpoints → Task records: stores task results (evidence: `main.py`)
- Task records → Postgres: persists records (evidence: `main.py`)
