# brunoaadul/autonomous-research-agent architecture

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

- Interactive diagram: https://gitdiagram.com/brunoaadul/autonomous-research-agent
- Repository: https://github.com/brunoaadul/autonomous-research-agent

## Overview

Crokuta is a FastAPI research-agent API with two distinct capabilities: generating preliminary research briefs and routing chat requests through a multi-provider LLM gateway. The research path validates a topic, derives questions, areas and keywords, then assembles a structured report; it does not retrieve external sources. The LLM path accepts a typed request, resolves provider settings and delegates completion to LiteLLM. The excerpts show these entry points and internal calls; no persistent store or research-search integration is shown.

Main entry points: [`app/research.py`](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py) (Research engine), [`app/main.py`](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/main.py) (FastAPI endpoints), [`app/llm/gateway.py`](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/llm/gateway.py) (LLM gateway), [`app/schemas/llm.py`](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/schemas/llm.py) (LLM schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_research_request["Research request<br/>[main.py]"]
end

subgraph group_research["Research"]
  node_research_runner["Research runner<br/>[research.py]"]
  node_research_engine["Research engine<br/>[research.py]"]
  node_topic_validation["Topic validation<br/>[research.py]"]
  node_research_questions["Research questions<br/>[research.py]"]
  node_research_areas["Research areas<br/>[research.py]"]
  node_keyword_extraction["Keyword extraction<br/>[research.py]"]
  node_brief["Research brief<br/>[research.py]"]
end

subgraph group_llm["LLM gateway"]
  node_llm_schema["LLM schemas<br/>[llm.py]"]
  node_llm_gateway["LLM gateway<br/>[gateway.py]"]
end

node_user(("API caller"))
node_litellm["LiteLLM completion"]
node_llm_providers["LLM providers"]

node_user -->|"calls"| node_api
node_api -->|"validates topic"| node_research_request
node_api -->|"calls"| node_research_runner
node_research_runner -->|"delegates to"| node_research_engine
node_research_engine -->|"validates"| node_topic_validation
node_research_engine -->|"generates"| node_research_questions
node_research_engine -->|"identifies"| node_research_areas
node_research_engine -->|"extracts"| node_keyword_extraction
node_research_engine -->|"assembles"| node_brief
node_api -->|"accepts request"| node_llm_schema
node_api -->|"calls"| node_llm_gateway
node_llm_gateway -->|"normalizes response"| node_llm_schema
node_llm_gateway -->|"calls completion"| node_litellm
node_litellm -.->|"routes requests"| node_llm_providers

click node_api "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/main.py"
click node_research_request "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/main.py"
click node_llm_schema "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/schemas/llm.py"
click node_research_runner "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_research_engine "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_topic_validation "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_research_questions "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_research_areas "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_keyword_extraction "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_brief "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py"
click node_llm_gateway "https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/llm/gateway.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_research_request toneBlue
class node_research_runner,node_research_engine,node_topic_validation,node_research_questions,node_research_areas,node_keyword_extraction,node_brief toneAmber
class node_llm_schema,node_llm_gateway,node_user toneMint
class node_litellm,node_llm_providers toneIndigo
```

## Components

### API

- [FastAPI endpoints](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/main.py): `app/main.py`
- [Research request](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/main.py): `app/main.py`

### Research

- [Research runner](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`
- [Research engine](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`
- [Topic validation](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`
- [Research questions](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`
- [Research areas](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`
- [Keyword extraction](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`
- [Research brief](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/research.py): `app/research.py`

### LLM gateway

- [LLM schemas](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/schemas/llm.py): `app/schemas/llm.py`
- [LLM gateway](https://github.com/brunoaadul/autonomous-research-agent/blob/main/app/llm/gateway.py): `app/llm/gateway.py`

### Other components

- **API caller**
- **LiteLLM completion**
- **LLM providers**

## Connections

- API caller → FastAPI endpoints: calls (evidence: `app/main.py`)
- FastAPI endpoints → Research request: validates topic (evidence: `app/main.py`)
- FastAPI endpoints → Research runner: calls (evidence: `app/main.py`)
- Research runner → Research engine: delegates to (evidence: `app/research.py`)
- Research engine → Topic validation: validates (evidence: `app/research.py`)
- Research engine → Research questions: generates (evidence: `app/research.py`)
- Research engine → Research areas: identifies (evidence: `app/research.py`)
- Research engine → Keyword extraction: extracts (evidence: `app/research.py`)
- Research engine → Research brief: assembles (evidence: `app/research.py`)
- FastAPI endpoints → LLM schemas: accepts request (evidence: `app/main.py`)
- FastAPI endpoints → LLM gateway: calls (evidence: `app/main.py`)
- LLM gateway → LLM schemas: normalizes response (evidence: `app/llm/gateway.py`)
- LLM gateway → LiteLLM completion: calls completion (evidence: `app/llm/gateway.py`)
- LiteLLM completion → LLM providers: routes requests
