# priyanshuvijay1402/ai-powered-research-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/priyanshuvijay1402/ai-powered-research-assistant
- Repository: https://github.com/priyanshuvijay1402/ai-powered-research-assistant

## Overview

The product is a web-based personal research assistant: a user submits a topic, the CrewAI workflow refines it, retrieves arXiv papers, summarizes them, and formats a report for display. The frontend and Flask request path are explicit in source. The README and task descriptions document arXiv retrieval, but the implementation of that integration is not shown. Also, importing `main.py` runs a CLI prompt and crew before the Flask server can start, which may interfere with the documented web workflow.

Main entry points: [`main.py`](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py) (Crew orchestrator), [`agents.py`](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/agents.py) (Agent definitions), [`server.py`](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/server.py) (Flask server), [`frontend/script.js`](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/frontend/script.js) (Research form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_frontend["Research form<br/>[script.js]"]
  node_server["Flask server<br/>[server.py]"]
end

subgraph group_workflow["Research workflow"]
  node_crew["Crew orchestrator<br/>[main.py]"]
  node_query["Query interpretation<br/>[main.py]"]
  node_search["Paper retrieval<br/>[main.py]"]
  node_summarize["Paper summarization<br/>[main.py]"]
  node_format["Report formatting<br/>[main.py]"]
  node_agents["Agent definitions<br/>[agents.py]"]
end

subgraph group_integrations["External services"]
  node_llm["ChatLiteLLM<br/>[agents.py]"]
  node_openrouter{{"OpenRouter"}}
  node_arxiv{{"arXiv"}}
end

node_user(("Researcher"))

node_user -->|"enters topic"| node_frontend
node_frontend -->|"posts topic"| node_server
node_server -->|"serves assets"| node_frontend
node_server -->|"starts workflow"| node_crew
node_crew -->|"runs task"| node_query
node_crew -->|"runs task"| node_search
node_crew -->|"runs task"| node_summarize
node_crew -->|"runs task"| node_format
node_search -->|"uses context"| node_query
node_summarize -->|"uses context"| node_search
node_format -->|"uses context"| node_summarize
node_agents -->|"configures agent"| node_query
node_agents -->|"configures agent"| node_search
node_agents -->|"configures agent"| node_summarize
node_agents -->|"configures agent"| node_format
node_agents -->|"configures model"| node_llm
node_llm -->|"sends prompts"| node_openrouter
node_search -.->|"searches papers"| node_arxiv
node_crew -->|"returns report"| node_server
node_server -->|"returns response"| node_frontend
node_frontend -->|"shows response"| node_user

click node_frontend "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/frontend/script.js"
click node_server "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/server.py"
click node_crew "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py"
click node_query "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py"
click node_search "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py"
click node_summarize "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py"
click node_format "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py"
click node_agents "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/agents.py"
click node_llm "https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/agents.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_frontend,node_server toneBlue
class node_crew,node_query,node_search,node_summarize,node_format,node_agents toneAmber
class node_llm,node_openrouter,node_arxiv toneMint
class node_user toneIndigo
```

## Components

### Web interface

- [Research form](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/frontend/script.js): `frontend/script.js`
- [Flask server](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/server.py): `server.py`

### Research workflow

- [Crew orchestrator](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py): `main.py`
- [Query interpretation](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py): `main.py`
- [Paper retrieval](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py): `main.py`
- [Paper summarization](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py): `main.py`
- [Report formatting](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/main.py): `main.py`
- [Agent definitions](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/agents.py): `agents.py`

### External services

- [ChatLiteLLM](https://github.com/priyanshuvijay1402/ai-powered-research-assistant/blob/main/agents.py): `agents.py`
- **OpenRouter**
- **arXiv**

### Other components

- **Researcher**

## Connections

- Researcher → Research form: enters topic
- Research form → Flask server: posts topic
- Flask server → Research form: serves assets
- Flask server → Crew orchestrator: starts workflow
- Crew orchestrator → Query interpretation: runs task
- Crew orchestrator → Paper retrieval: runs task
- Crew orchestrator → Paper summarization: runs task
- Crew orchestrator → Report formatting: runs task
- Paper retrieval → Query interpretation: uses context
- Paper summarization → Paper retrieval: uses context
- Report formatting → Paper summarization: uses context
- Agent definitions → Query interpretation: configures agent
- Agent definitions → Paper retrieval: configures agent
- Agent definitions → Paper summarization: configures agent
- Agent definitions → Report formatting: configures agent
- Agent definitions → ChatLiteLLM: configures model
- ChatLiteLLM → OpenRouter: sends prompts
- Paper retrieval → arXiv: searches papers
- Crew orchestrator → Flask server: returns report
- Flask server → Research form: returns response
- Research form → Researcher: shows response
