# maria-chaudhary/researchpilot-ai architecture

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

- Interactive diagram: https://gitdiagram.com/maria-chaudhary/researchpilot-ai
- Repository: https://github.com/maria-chaudhary/researchpilot-ai

## Overview

ResearchPilot AI lets users upload a PDF, extract page-aware text, split it into overlapping chunks, index embeddings, and ask questions answered from retrieved passages with page citations and source text. A separate evaluation workflow checks retrieval page matches and answer citation matches against sample questions. The sampled code shows the Gradio wiring, FAISS/embedding calls, and Groq request. Other than the README (empty), no product capabilities are documented; edges for unsampled implementation are omitted.

Main entry points: [`run_evaluation.py`](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/run_evaluation.py) (Evaluation workflow), [`web_app.py`](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/web_app.py) (Gradio app), [`app/generation/answer_service.py`](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/generation/answer_service.py) (Grounded answers), [`app/retrieval/vector_store.py`](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/retrieval/vector_store.py) (FAISS index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_web["Gradio app<br/>[web_app.py]"]
end

subgraph group_document["Document processing"]
  node_parser["PDF extraction<br/>[pdf_parser.py]"]
  node_chunking["Text chunking<br/>[chunking.py]"]
  node_embeddings["Text embeddings<br/>[embeddings.py]"]
  node_store[("FAISS index<br/>[vector_store.py]")]
end

subgraph group_qa["Question answering"]
  node_answer["Grounded answers<br/>[answer_service.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_eval_runner["Evaluation workflow<br/>[run_evaluation.py]"]
  node_metrics["Evaluation metrics<br/>[metrics.py]"]
  node_questions["Sample questions"]
end

node_user(("PDF user"))
node_groq{{"Groq API"}}

node_user -->|"uploads and asks"| node_web
node_web -->|"extracts PDF"| node_parser
node_web -->|"chunks pages"| node_chunking
node_web -->|"indexes chunks"| node_store
node_store -->|"embeds text"| node_embeddings
node_web -->|"requests answer"| node_answer
node_answer -->|"searches passages"| node_store
node_answer -->|"requests completion"| node_groq
node_eval_runner -->|"loads questions"| node_questions
node_eval_runner -->|"extracts PDF"| node_parser
node_eval_runner -->|"chunks pages"| node_chunking
node_eval_runner -->|"indexes and searches"| node_store
node_eval_runner -->|"generates answers"| node_answer
node_eval_runner -->|"checks results"| node_metrics

click node_web "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/web_app.py"
click node_parser "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/ingestion/pdf_parser.py"
click node_chunking "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/ingestion/chunking.py"
click node_embeddings "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/retrieval/embeddings.py"
click node_store "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/retrieval/vector_store.py"
click node_answer "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/generation/answer_service.py"
click node_eval_runner "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/run_evaluation.py"
click node_metrics "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/evaluation/metrics.py"
click node_questions "https://github.com/maria-chaudhary/researchpilot-ai/blob/main/data/sample_questions.json"

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_web,node_user toneBlue
class node_parser,node_chunking,node_embeddings,node_store toneAmber
class node_answer,node_groq toneMint
class node_eval_runner,node_metrics,node_questions toneRose
```

## Components

### User interface

- [Gradio app](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/web_app.py): `web_app.py`

### Document processing

- [PDF extraction](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/ingestion/pdf_parser.py): `app/ingestion/pdf_parser.py`
- [Text chunking](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/ingestion/chunking.py): `app/ingestion/chunking.py`
- [Text embeddings](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/retrieval/embeddings.py): `app/retrieval/embeddings.py`
- [FAISS index](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/retrieval/vector_store.py): `app/retrieval/vector_store.py`

### Question answering

- [Grounded answers](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/generation/answer_service.py): `app/generation/answer_service.py`

### Evaluation

- [Evaluation workflow](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/run_evaluation.py): `run_evaluation.py`
- [Evaluation metrics](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/app/evaluation/metrics.py): `app/evaluation/metrics.py`
- [Sample questions](https://github.com/maria-chaudhary/researchpilot-ai/blob/main/data/sample_questions.json): `data/sample_questions.json`

### Other components

- **PDF user**
- **Groq API**

## Connections

- PDF user → Gradio app: uploads and asks (evidence: `web_app.py`)
- Gradio app → PDF extraction: extracts PDF (evidence: `web_app.py`)
- Gradio app → Text chunking: chunks pages (evidence: `web_app.py`)
- Gradio app → FAISS index: indexes chunks (evidence: `web_app.py`)
- FAISS index → Text embeddings: embeds text (evidence: `app/retrieval/vector_store.py`)
- Gradio app → Grounded answers: requests answer (evidence: `web_app.py`)
- Grounded answers → FAISS index: searches passages (evidence: `app/generation/answer_service.py`)
- Grounded answers → Groq API: requests completion (evidence: `app/generation/answer_service.py`)
- Evaluation workflow → Sample questions: loads questions (evidence: `run_evaluation.py`)
- Evaluation workflow → PDF extraction: extracts PDF (evidence: `run_evaluation.py`)
- Evaluation workflow → Text chunking: chunks pages (evidence: `run_evaluation.py`)
- Evaluation workflow → FAISS index: indexes and searches (evidence: `run_evaluation.py`)
- Evaluation workflow → Grounded answers: generates answers (evidence: `run_evaluation.py`)
- Evaluation workflow → Evaluation metrics: checks results (evidence: `run_evaluation.py`)
