# mridul-2003/evo_research_agent architecture

> Architecture diagram of the GitHub repository mridul-2003/evo_research_agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mridul-2003/evo_research_agent
- Repository: https://github.com/mridul-2003/evo_research_agent

## Overview

EVO Research is an Electron desktop client backed by a FastAPI research agent. A user submits a query in the renderer; the desktop bridge forwards it to the API, which loads session history, invokes research, saves the completed turn, and returns streamed events to the UI. Research supports web and paper discovery, source extraction, browser/app actions, and model-driven responses. The scraper provides HTTP and browser-based page retrieval. The README is empty, so capabilities are based on the supplied source excerpts; scraper wiring from research is not shown and is marked unverified.

Main entry points: [`src/agents/research.py`](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py) (Research orchestration), [`src/api.py`](https://github.com/mridul-2003/evo_research_agent/blob/master/src/api.py) (Chat API), [`desktop/main.js`](https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/main.js) (Electron main), [`src/agents/scraper.py`](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/scraper.py) (Page scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop client"]
  node_renderer["Chat renderer<br/>[renderer.js]"]
  node_bridge["Preload bridge<br/>[preload.js]"]
  node_electron["Electron main<br/>[main.js]"]
end

subgraph group_api["API and sessions"]
  node_launcher["API launcher<br/>[main.py]"]
  node_api_routes["Chat API<br/>[api.py]"]
  node_memory[("Session memory<br/>[memory.py]")]
end

subgraph group_agent["Research agent"]
  node_research["Research orchestration<br/>[research.py]"]
  node_web_search["Web search<br/>[research.py]"]
  node_paper_search["Paper discovery<br/>[research.py]"]
  node_source_extract["URL extraction<br/>[research.py]"]
  node_browser_action["Browser navigation<br/>[research.py]"]
  node_app_action["Desktop app action<br/>[research.py]"]
end

subgraph group_sources["Source retrieval"]
  node_scraper["Page scraper<br/>[scraper.py]"]
end

subgraph group_integrations["External integrations"]
  node_model{{"Language model"}}
  node_searx{{"SearXNG"}}
  node_websites{{"Web sources"}}
  node_arxiv{{"ArXiv"}}
  node_system_browser{{"System browser"}}
  node_desktop_apps{{"Allowlisted apps"}}
end

node_user(("User"))

node_user -->|"submits query"| node_renderer
node_renderer -->|"invokes chat"| node_bridge
node_bridge -->|"sends IPC"| node_electron
node_electron -->|"forwards HTTP"| node_api_routes
node_electron -->|"starts backend"| node_launcher
node_launcher -->|"serves app"| node_api_routes
node_api_routes -->|"reads and saves"| node_memory
node_api_routes -->|"invokes research"| node_research
node_research -->|"invokes model"| node_model
node_research -->|"dispatches tools"| node_web_search
node_research -->|"dispatches tools"| node_paper_search
node_research -->|"dispatches tools"| node_source_extract
node_research -->|"dispatches tools"| node_browser_action
node_research -->|"dispatches tools"| node_app_action
node_web_search -->|"searches"| node_searx
node_source_extract -.->|"fetches pages"| node_websites
node_source_extract -.->|"uses scraper"| node_scraper
node_scraper -->|"fetches pages"| node_websites
node_scraper -->|"selects controls"| node_model
node_paper_search -.->|"searches papers"| node_arxiv
node_browser_action -->|"opens URL"| node_system_browser
node_app_action -->|"launches app"| node_desktop_apps

click node_renderer "https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/renderer.js"
click node_bridge "https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/preload.js"
click node_electron "https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/main.js"
click node_launcher "https://github.com/mridul-2003/evo_research_agent/blob/master/main.py"
click node_api_routes "https://github.com/mridul-2003/evo_research_agent/blob/master/src/api.py"
click node_memory "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/memory.py"
click node_research "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py"
click node_web_search "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py"
click node_paper_search "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py"
click node_source_extract "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py"
click node_browser_action "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py"
click node_app_action "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py"
click node_scraper "https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/scraper.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_renderer,node_bridge,node_electron,node_user toneBlue
class node_launcher,node_api_routes,node_memory toneAmber
class node_research,node_web_search,node_paper_search,node_source_extract,node_browser_action,node_app_action toneMint
class node_scraper toneRose
class node_model,node_searx,node_websites,node_arxiv,node_system_browser,node_desktop_apps toneIndigo
```

## Components

### Desktop client

- [Chat renderer](https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/renderer.js): `desktop/renderer.js`
- [Preload bridge](https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/preload.js): `desktop/preload.js`
- [Electron main](https://github.com/mridul-2003/evo_research_agent/blob/master/desktop/main.js): `desktop/main.js`

### API and sessions

- [API launcher](https://github.com/mridul-2003/evo_research_agent/blob/master/main.py): `main.py`
- [Chat API](https://github.com/mridul-2003/evo_research_agent/blob/master/src/api.py): `src/api.py`
- [Session memory](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/memory.py): `src/agents/memory.py`

### Research agent

- [Research orchestration](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py): `src/agents/research.py`
- [Web search](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py): `src/agents/research.py`
- [Paper discovery](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py): `src/agents/research.py`
- [URL extraction](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py): `src/agents/research.py`
- [Browser navigation](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py): `src/agents/research.py`
- [Desktop app action](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/research.py): `src/agents/research.py`

### Source retrieval

- [Page scraper](https://github.com/mridul-2003/evo_research_agent/blob/master/src/agents/scraper.py): `src/agents/scraper.py`

### External integrations

- **Language model**
- **SearXNG**
- **Web sources**
- **ArXiv**
- **System browser**
- **Allowlisted apps**

### Other components

- **User**

## Connections

- User → Chat renderer: submits query (evidence: `desktop/renderer.js`)
- Chat renderer → Preload bridge: invokes chat (evidence: `desktop/renderer.js`)
- Preload bridge → Electron main: sends IPC (evidence: `desktop/preload.js`)
- Electron main → Chat API: forwards HTTP (evidence: `desktop/main.js`)
- Electron main → API launcher: starts backend (evidence: `desktop/main.js`)
- API launcher → Chat API: serves app (evidence: `main.py`)
- Chat API → Session memory: reads and saves (evidence: `src/api.py`)
- Chat API → Research orchestration: invokes research (evidence: `src/api.py`)
- Research orchestration → Language model: invokes model (evidence: `src/agents/research.py`)
- Research orchestration → Web search: dispatches tools (evidence: `src/agents/research.py`)
- Research orchestration → Paper discovery: dispatches tools (evidence: `src/agents/research.py`)
- Research orchestration → URL extraction: dispatches tools (evidence: `src/agents/research.py`)
- Research orchestration → Browser navigation: dispatches tools (evidence: `src/agents/research.py`)
- Research orchestration → Desktop app action: dispatches tools (evidence: `src/agents/research.py`)
- Web search → SearXNG: searches (evidence: `src/agents/research.py`)
- URL extraction → Web sources: fetches pages
- URL extraction → Page scraper: uses scraper (evidence: `src/agents/research.py`)
- Page scraper → Web sources: fetches pages (evidence: `src/agents/scraper.py`)
- Page scraper → Language model: selects controls (evidence: `src/agents/scraper.py`)
- Paper discovery → ArXiv: searches papers
- Browser navigation → System browser: opens URL (evidence: `src/agents/research.py`)
- Desktop app action → Allowlisted apps: launches app (evidence: `src/agents/research.py`)
