# zak-7869/research-ai-platform architecture

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

- Interactive diagram: https://gitdiagram.com/zak-7869/research-ai-platform
- Repository: https://github.com/zak-7869/research-ai-platform

## Overview

Research AI accepts a topic in its web interface, sends it to the FastAPI research endpoint, searches Tavily for evidence, and uses a Groq model to produce a cited report. The endpoint returns the report and sources for display. The graph separates search from report generation, while the backend also exposes health and Prometheus metrics endpoints. Source excerpts show these runtime links; the repository has no README content, so product scope is based on the supplied source and interface.

Main entry points: [`backend/app/main.py`](https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/main.py) (Research API), [`frontend/app/page.tsx`](https://github.com/zak-7869/research-ai-platform/blob/main/frontend/app/page.tsx) (Topic and results UI), [`backend/app/graph.py`](https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.py) (Evidence search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Research interface"]
  node_research_ui["Topic and results UI<br/>[page.tsx]"]
end

subgraph group_api["API service"]
  node_api_service["Research API<br/>[main.py]"]
end

subgraph group_workflow["Research workflow"]
  node_graph_builder["Graph builder<br/>[graph.py]"]
  node_web_search["Evidence search<br/>[graph.py]"]
  node_report_writer["Report generation<br/>[graph.py]"]
end

subgraph group_providers["External providers"]
  node_tavily["Tavily search"]
  node_groq["Groq model"]
end

node_user(("Research user"))

node_user -->|"enters topic"| node_research_ui
node_research_ui -->|"submits request"| node_api_service
node_api_service -->|"builds graph"| node_graph_builder
node_api_service -->|"invokes graph"| node_web_search
node_web_search -->|"searches topic"| node_tavily
node_web_search -->|"passes results"| node_report_writer
node_report_writer -->|"generates report"| node_groq
node_api_service -->|"returns report and sources"| node_research_ui
node_research_ui -->|"displays results"| node_user

click node_research_ui "https://github.com/zak-7869/research-ai-platform/blob/main/frontend/app/page.tsx"
click node_api_service "https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/main.py"
click node_graph_builder "https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.py"
click node_web_search "https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.py"
click node_report_writer "https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.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_research_ui,node_user toneBlue
class node_api_service toneAmber
class node_graph_builder,node_web_search,node_report_writer toneMint
class node_tavily,node_groq toneRose
```

## Components

### Research interface

- [Topic and results UI](https://github.com/zak-7869/research-ai-platform/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`

### API service

- [Research API](https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/main.py): `backend/app/main.py`

### Research workflow

- [Graph builder](https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.py): `backend/app/graph.py`
- [Evidence search](https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.py): `backend/app/graph.py`
- [Report generation](https://github.com/zak-7869/research-ai-platform/blob/main/backend/app/graph.py): `backend/app/graph.py`

### External providers

- **Tavily search**
- **Groq model**

### Other components

- **Research user**

## Connections

- Research user → Topic and results UI: enters topic (evidence: `frontend/app/page.tsx`)
- Topic and results UI → Research API: submits request (evidence: `frontend/app/page.tsx`)
- Research API → Graph builder: builds graph (evidence: `backend/app/main.py`)
- Research API → Evidence search: invokes graph (evidence: `backend/app/main.py`)
- Evidence search → Tavily search: searches topic (evidence: `backend/app/graph.py`)
- Evidence search → Report generation: passes results (evidence: `backend/app/graph.py`)
- Report generation → Groq model: generates report (evidence: `backend/app/graph.py`)
- Research API → Topic and results UI: returns report and sources (evidence: `frontend/app/page.tsx`)
- Topic and results UI → Research user: displays results (evidence: `frontend/app/page.tsx`)
