# srikanth903/agentic-rag-research-assistant. architecture

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

- Interactive diagram: https://gitdiagram.com/srikanth903/agentic-rag-research-assistant.
- Repository: https://github.com/srikanth903/agentic-rag-research-assistant.

## Overview

This is an Agentic RAG Research Assistant: users upload documents, then ask questions through a FastAPI service or its browser interface and receive grounded answers with traceable sources. The documented answer path retrieves local evidence, optionally reranks it, builds context and prompts, and uses an LLM; agent workflows can add iterative retrieval and web research. Ingestion, authentication, conversation memory, and evidence verification are distinct capabilities. The README supports several workflow links; source excerpts confirm the RAG, retrieval, and service-layer calls. Other subsystem links are omitted where wiring was not shown.

Main entry points: [`app/rag/rag_pipeline.py`](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/rag/rag_pipeline.py) (RAG Pipeline), [`app/main.py`](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/main.py) (FastAPI App), [`app/services/retrieval_service.py`](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/retrieval_service.py) (Retrieval Service), [`app/retrieval/retriever.py`](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/retrieval/retriever.py) (Semantic Retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Interface"]
  node_frontend["Browser App<br/>[router.tsx]"]
end

subgraph group_api["API and Access"]
  node_server["FastAPI App<br/>[main.py]"]
  node_auth["JWT Access<br/>[service.py]"]
  node_docapi["Document Routes<br/>[documents.py]"]
  node_ragapi["RAG Routes<br/>[rag.py]"]
  node_searchapi["Search Routes<br/>[search.py]"]
  node_conversationapi["Conversation Routes<br/>[conversation.py]"]
end

subgraph group_ingestion["Document Indexing"]
  node_ingest["Document Extraction"]
  node_chunking["Text Chunking<br/>[text_chunker.py]"]
  node_embedding["Embeddings"]
  node_vectorstore[("Chroma Index<br/>[chroma_store.py]")]
end

subgraph group_research["Research and Answers"]
  node_ragservice["RAG Service<br/>[rag_service.py]"]
  node_pipeline["RAG Pipeline<br/>[rag_pipeline.py]"]
  node_retrieval["Semantic Retrieval<br/>[retriever.py]"]
  node_retrievalservice["Retrieval Service"]
  node_reranker["Cross-Encoder Reranker<br/>[reranker.py]"]
  node_prompt["Context and Prompts<br/>[prompt_builder.py]"]
  node_llmservice["LLM Service<br/>[llm_service.py]"]
  node_providers["LLM Providers<br/>[factory.py]"]
  node_agent["Research Agent<br/>[research_agent.py]"]
  node_websearch["Web Research<br/>[duckduckgo.py]"]
  node_evidence["Evidence Verification"]
end

subgraph group_state["Conversation and Evaluation"]
  node_conversation["Conversation Service<br/>[service.py]"]
  node_memory[("Conversation Memory<br/>[memory.py]")]
  node_rewriter["Query Rewriting<br/>[query_rewriter.py]"]
  node_evaluation["RAG Evaluation"]
end

node_user(("Researcher"))

node_user -->|"uses"| node_frontend
node_user -->|"requests"| node_server
node_frontend -.->|"calls API"| node_server
node_server -->|"registers routes"| node_docapi
node_server -->|"registers routes"| node_ragapi
node_server -->|"registers routes"| node_searchapi
node_server -->|"registers routes"| node_conversationapi
node_user -->|"authenticates"| node_auth
node_docapi -->|"ingests files"| node_ingest
node_ingest -->|"extracts then chunks"| node_chunking
node_chunking -->|"embeds chunks"| node_embedding
node_embedding -->|"indexes vectors"| node_vectorstore
node_user -->|"asks question"| node_ragapi
node_ragapi -->|"answers via"| node_ragservice
node_ragservice -->|"runs pipeline"| node_pipeline
node_pipeline -->|"retrieves evidence"| node_retrievalservice
node_retrievalservice -->|"fetches candidates"| node_retrieval
node_retrieval -->|"embeds query"| node_embedding
node_retrieval -->|"searches index"| node_vectorstore
node_retrievalservice -->|"reranks results"| node_reranker
node_pipeline -->|"builds context"| node_prompt
node_pipeline -->|"generates answer"| node_llmservice
node_llmservice -->|"selects provider"| node_providers
node_pipeline -->|"verifies claims"| node_evidence
node_user -->|"continues chat"| node_conversationapi
node_conversationapi -->|"handles chat"| node_conversation
node_conversation -->|"rewrites queries"| node_rewriter
node_rewriter -->|"requests rewrite"| node_llmservice
node_conversation -->|"persists history"| node_memory
node_user -->|"requests research"| node_agent
node_agent -->|"retrieves locally"| node_retrievalservice
node_agent -->|"searches web"| node_websearch
node_pipeline -.->|"assessed by"| node_evaluation

click node_frontend "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/frontend/src/app/router.tsx"
click node_server "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/main.py"
click node_auth "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/auth/service.py"
click node_docapi "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/documents.py"
click node_ragapi "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/rag.py"
click node_searchapi "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/search.py"
click node_conversationapi "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/conversation.py"
click node_ingest "https://github.com/srikanth903/agentic-rag-research-assistant./tree/main/app/ingestion"
click node_chunking "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/chunking/text_chunker.py"
click node_embedding "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/embeddings/sentence_transformer.py"
click node_vectorstore "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/vectorstore/chroma_store.py"
click node_ragservice "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/rag_service.py"
click node_pipeline "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/rag/rag_pipeline.py"
click node_retrieval "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/retrieval/retriever.py"
click node_retrievalservice "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/retrieval_service.py"
click node_reranker "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/retrieval/reranker.py"
click node_prompt "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/rag/prompt_builder.py"
click node_llmservice "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/llm_service.py"
click node_providers "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/llm/factory.py"
click node_agent "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/agents/research_agent.py"
click node_websearch "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/websearch/duckduckgo.py"
click node_evidence "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/evidenceguard/evidence_verifier.py"
click node_conversation "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/conversation/service.py"
click node_memory "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/conversation/memory.py"
click node_rewriter "https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/conversation/query_rewriter.py"
click node_evaluation "https://github.com/srikanth903/agentic-rag-research-assistant./tree/main/app/evaluation"

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 toneBlue
class node_server,node_auth,node_docapi,node_ragapi,node_searchapi,node_conversationapi toneAmber
class node_ingest,node_chunking,node_embedding,node_vectorstore toneMint
class node_ragservice,node_pipeline,node_retrieval,node_retrievalservice,node_reranker,node_prompt,node_llmservice,node_providers,node_agent,node_websearch,node_evidence toneRose
class node_conversation,node_memory,node_rewriter,node_evaluation,node_user toneIndigo
```

## Components

### User Interface

- [Browser App](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`

### API and Access

- [FastAPI App](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/main.py): `app/main.py`
- [JWT Access](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/auth/service.py): `app/auth/service.py`
- [Document Routes](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/documents.py): `app/api/routes/documents.py`
- [RAG Routes](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/rag.py): `app/api/routes/rag.py`
- [Search Routes](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/search.py): `app/api/routes/search.py`
- [Conversation Routes](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/api/routes/conversation.py): `app/api/routes/conversation.py`

### Document Indexing

- [Document Extraction](https://github.com/srikanth903/agentic-rag-research-assistant./tree/main/app/ingestion): `app/ingestion`
- [Text Chunking](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/chunking/text_chunker.py): `app/chunking/text_chunker.py`
- [Embeddings](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/embeddings/sentence_transformer.py): `app/embeddings/sentence_transformer.py`
- [Chroma Index](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/vectorstore/chroma_store.py): `app/vectorstore/chroma_store.py`

### Research and Answers

- [RAG Service](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/rag_service.py): `app/services/rag_service.py`
- [RAG Pipeline](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/rag/rag_pipeline.py): `app/rag/rag_pipeline.py`
- [Semantic Retrieval](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/retrieval/retriever.py): `app/retrieval/retriever.py`
- [Retrieval Service](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/retrieval_service.py): `app/services/retrieval_service.py`
- [Cross-Encoder Reranker](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/retrieval/reranker.py): `app/retrieval/reranker.py`
- [Context and Prompts](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/rag/prompt_builder.py): `app/rag/prompt_builder.py`
- [LLM Service](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/services/llm_service.py): `app/services/llm_service.py`
- [LLM Providers](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/llm/factory.py): `app/llm/factory.py`
- [Research Agent](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/agents/research_agent.py): `app/agents/research_agent.py`
- [Web Research](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/websearch/duckduckgo.py): `app/websearch/duckduckgo.py`
- [Evidence Verification](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/evidenceguard/evidence_verifier.py): `app/evidenceguard/evidence_verifier.py`

### Conversation and Evaluation

- [Conversation Service](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/conversation/service.py): `app/conversation/service.py`
- [Conversation Memory](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/conversation/memory.py): `app/conversation/memory.py`
- [Query Rewriting](https://github.com/srikanth903/agentic-rag-research-assistant./blob/main/app/conversation/query_rewriter.py): `app/conversation/query_rewriter.py`
- [RAG Evaluation](https://github.com/srikanth903/agentic-rag-research-assistant./tree/main/app/evaluation): `app/evaluation`

### Other components

- **Researcher**

## Connections

- Researcher → Browser App: uses (evidence: `frontend/src/app/router.tsx`)
- Researcher → FastAPI App: requests (evidence: `README.md`)
- Browser App → FastAPI App: calls API
- FastAPI App → Document Routes: registers routes (evidence: `app/main.py`)
- FastAPI App → RAG Routes: registers routes (evidence: `app/main.py`)
- FastAPI App → Search Routes: registers routes (evidence: `app/main.py`)
- FastAPI App → Conversation Routes: registers routes (evidence: `app/main.py`)
- Researcher → JWT Access: authenticates (evidence: `README.md`)
- Document Routes → Document Extraction: ingests files (evidence: `README.md`)
- Document Extraction → Text Chunking: extracts then chunks (evidence: `README.md`)
- Text Chunking → Embeddings: embeds chunks (evidence: `README.md`)
- Embeddings → Chroma Index: indexes vectors (evidence: `README.md`)
- Researcher → RAG Routes: asks question (evidence: `README.md`)
- RAG Routes → RAG Service: answers via (evidence: `README.md`)
- RAG Service → RAG Pipeline: runs pipeline (evidence: `app/services/rag_service.py`)
- RAG Pipeline → Retrieval Service: retrieves evidence (evidence: `app/rag/rag_pipeline.py`)
- Retrieval Service → Semantic Retrieval: fetches candidates (evidence: `app/services/retrieval_service.py`)
- Semantic Retrieval → Embeddings: embeds query (evidence: `app/retrieval/retriever.py`)
- Semantic Retrieval → Chroma Index: searches index (evidence: `app/retrieval/retriever.py`)
- Retrieval Service → Cross-Encoder Reranker: reranks results (evidence: `app/services/retrieval_service.py`)
- RAG Pipeline → Context and Prompts: builds context (evidence: `app/rag/rag_pipeline.py`)
- RAG Pipeline → LLM Service: generates answer (evidence: `app/rag/rag_pipeline.py`)
- LLM Service → LLM Providers: selects provider (evidence: `app/services/llm_service.py`)
- RAG Pipeline → Evidence Verification: verifies claims (evidence: `app/rag/rag_pipeline.py`)
- Researcher → Conversation Routes: continues chat (evidence: `README.md`)
- Conversation Routes → Conversation Service: handles chat (evidence: `README.md`)
- Conversation Service → Query Rewriting: rewrites queries (evidence: `app/conversation/service.py`)
- Query Rewriting → LLM Service: requests rewrite (evidence: `app/conversation/query_rewriter.py`)
- Conversation Service → Conversation Memory: persists history (evidence: `app/conversation/service.py`)
- Researcher → Research Agent: requests research (evidence: `README.md`)
- Research Agent → Retrieval Service: retrieves locally (evidence: `app/agents/research_agent.py`)
- Research Agent → Web Research: searches web (evidence: `app/agents/research_agent.py`)
- RAG Pipeline → RAG Evaluation: assessed by
