# manikantasai1724/academiaai architecture

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

- Interactive diagram: https://gitdiagram.com/manikantasai1724/academiaai
- Repository: https://github.com/manikantasai1724/academiaai

## Overview

AcademiaAI is a local academic-document ingestion, semantic-search, and grounded question-answering application. A user uploads a document through the React workspace; the API extracts structured text, chunks it, embeds it, and indexes passages with provenance. Users can then search passages or ask questions: retrieval supplies evidence to the answer generator, which returns citations. The interface also supports corpus listing and passage inspection. The README documents formats and capabilities beyond the sampled excerpts; evaluation tooling is excluded as non-user-facing.

Main entry points: [`backend/app/api/routes.py`](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/api/routes.py) (REST endpoints), [`frontend/src/App.tsx`](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/App.tsx) (Workspace), [`frontend/src/services/api.ts`](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/services/api.ts) (API client), [`backend/app/rag/generator.py`](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/rag/generator.py) (RAG orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Research workspace"]
  node_app["Workspace<br/>[App.tsx]"]
  node_upload_ui["Document upload<br/>[DocumentUpload.tsx]"]
  node_search_ui["Literature search"]
  node_qa_ui["Question answering<br/>[QASection.tsx]"]
  node_library_ui["Document library"]
  node_inspector["Passage inspector"]
  node_client["API client<br/>[api.ts]"]
end

subgraph group_api["API orchestration"]
  node_main["FastAPI app<br/>[main.py]"]
  node_routes["REST endpoints<br/>[routes.py]"]
end

subgraph group_ingestion["Document ingestion"]
  node_extract["Format extraction<br/>[extractors.py]"]
  node_chunk["Passage chunking<br/>[chunker.py]"]
end

subgraph group_retrieval["Search and storage"]
  node_embed["Dense embeddings<br/>[manager.py]"]
  node_store[("FAISS index<br/>[store.py]")]
end

subgraph group_qa["Grounded answers"]
  node_rag["RAG orchestration<br/>[generator.py]"]
  node_gemini{{"Google Gemini"}}
end

node_user(("Researcher"))

node_user -->|"uses"| node_app
node_app -->|"presents"| node_upload_ui
node_app -->|"presents"| node_search_ui
node_app -->|"presents"| node_qa_ui
node_app -->|"presents"| node_library_ui
node_app -->|"opens"| node_inspector
node_app -->|"lists documents"| node_client
node_upload_ui -->|"uploads files"| node_client
node_search_ui -->|"searches"| node_client
node_qa_ui -->|"asks questions"| node_client
node_library_ui -->|"loads library"| node_client
node_main -->|"mounts"| node_routes
node_client -->|"HTTP requests"| node_routes
node_routes -->|"extracts document"| node_extract
node_routes -->|"chunks text"| node_chunk
node_routes -->|"embeds passages"| node_embed
node_routes -->|"indexes passages"| node_store
node_routes -->|"embeds search query"| node_embed
node_routes -->|"searches index"| node_store
node_routes -->|"answers question"| node_rag
node_rag -->|"embeds question"| node_embed
node_rag -->|"retrieves evidence"| node_store
node_rag -.->|"generates answer"| node_gemini

click node_app "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/App.tsx"
click node_upload_ui "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/DocumentUpload.tsx"
click node_search_ui "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/SemanticSearchSection.tsx"
click node_qa_ui "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/QASection.tsx"
click node_library_ui "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/DocumentLibrary.tsx"
click node_inspector "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/ChunkInspectorModal.tsx"
click node_client "https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/services/api.ts"
click node_main "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/main.py"
click node_routes "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/api/routes.py"
click node_extract "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/documents/extractors.py"
click node_chunk "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/nlp/chunker.py"
click node_embed "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/embeddings/manager.py"
click node_store "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/retrieval/store.py"
click node_rag "https://github.com/manikantasai1724/academiaai/blob/main/backend/app/rag/generator.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_app,node_upload_ui,node_search_ui,node_qa_ui,node_library_ui,node_inspector,node_client toneBlue
class node_main,node_routes toneAmber
class node_extract,node_chunk toneMint
class node_embed,node_store toneRose
class node_rag,node_gemini,node_user toneIndigo
```

## Components

### Research workspace

- [Workspace](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Document upload](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/DocumentUpload.tsx): `frontend/src/components/DocumentUpload.tsx`
- [Literature search](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/SemanticSearchSection.tsx): `frontend/src/components/SemanticSearchSection.tsx`
- [Question answering](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/QASection.tsx): `frontend/src/components/QASection.tsx`
- [Document library](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/DocumentLibrary.tsx): `frontend/src/components/DocumentLibrary.tsx`
- [Passage inspector](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/components/ChunkInspectorModal.tsx): `frontend/src/components/ChunkInspectorModal.tsx`
- [API client](https://github.com/manikantasai1724/academiaai/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API orchestration

- [FastAPI app](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/main.py): `backend/app/main.py`
- [REST endpoints](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`

### Document ingestion

- [Format extraction](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/documents/extractors.py): `backend/app/documents/extractors.py`
- [Passage chunking](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/nlp/chunker.py): `backend/app/nlp/chunker.py`

### Search and storage

- [Dense embeddings](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/embeddings/manager.py): `backend/app/embeddings/manager.py`
- [FAISS index](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/retrieval/store.py): `backend/app/retrieval/store.py`

### Grounded answers

- [RAG orchestration](https://github.com/manikantasai1724/academiaai/blob/main/backend/app/rag/generator.py): `backend/app/rag/generator.py`
- **Google Gemini**

### Other components

- **Researcher**

## Connections

- Researcher → Workspace: uses
- Workspace → Document upload: presents
- Workspace → Literature search: presents
- Workspace → Question answering: presents
- Workspace → Document library: presents
- Workspace → Passage inspector: opens
- Workspace → API client: lists documents
- Document upload → API client: uploads files
- Literature search → API client: searches
- Question answering → API client: asks questions
- Document library → API client: loads library
- FastAPI app → REST endpoints: mounts
- API client → REST endpoints: HTTP requests
- REST endpoints → Format extraction: extracts document
- REST endpoints → Passage chunking: chunks text
- REST endpoints → Dense embeddings: embeds passages
- REST endpoints → FAISS index: indexes passages
- REST endpoints → Dense embeddings: embeds search query
- REST endpoints → FAISS index: searches index
- REST endpoints → RAG orchestration: answers question
- RAG orchestration → Dense embeddings: embeds question
- RAG orchestration → FAISS index: retrieves evidence
- RAG orchestration → Google Gemini: generates answer
