# muthukamalan/agentic-rag architecture

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

- Interactive diagram: https://gitdiagram.com/muthukamalan/agentic-rag
- Repository: https://github.com/muthukamalan/agentic-rag

## Overview

This repository is an early-stage RAG library. Its clearest implemented workflow is document ingestion: an ingestion service extracts content, chunks it, embeds text, images, and tables, then submits chunks to a vector store. Source adapters, format extractors, chunking strategies, vector-store backends, and retrieval/evaluation modules are present, but many are stubs or were not sampled. The query orchestrator is only a skeleton; the graph therefore shows no inferred retrieval pipeline.

Main entry points: [`src/rag/services/ingestion.py`](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/services/ingestion.py) (Ingestion Service), [`src/rag/interfaces.py`](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/interfaces.py) (Service Interfaces), [`src/rag/extractors`](https://github.com/muthukamalan/agentic-rag/tree/master/src/rag/extractors) (File Extractors), [`src/rag/embedding/embedding_gemm2.py`](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/embedding/embedding_gemm2.py) (Gemma2 Embedder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion"]
  node_ingestion["Ingestion Service<br/>[ingestion.py]"]
end

subgraph group_processing["Content Processing"]
  node_extractors["File Extractors"]
  node_chunking["Chunking Strategies"]
  node_embedder["Gemma2 Embedder<br/>[embedding_gemm2.py]"]
end

subgraph group_storage["Sources and Indexes"]
  node_local_source["Local Source<br/>[localsource.py]"]
  node_s3_source["S3 Source<br/>[s3source.py]"]
  node_elastic_store[("Elasticsearch Store<br/>[elastic_search.py]")]
  node_qdrant_store[("Qdrant Store<br/>[qdrant.py]")]
end

subgraph group_query["Query and Evaluation"]
  node_orchestrator["RAG Orchestrator<br/>[orchestrors.py]"]
  node_retrieval_metrics["Retrieval Metrics"]
  node_reranker_metrics["Reranker Metrics"]
end

subgraph group_contracts["Domain Contracts"]
  node_interfaces["Service Interfaces<br/>[interfaces.py]"]
  node_models["RAG Data Models<br/>[models.py]"]
end

node_ingestion -->|"extracts via"| node_extractors
node_ingestion -->|"chunks via"| node_chunking
node_ingestion -->|"embeds via"| node_embedder
node_ingestion -.->|"indexes via"| node_elastic_store
node_ingestion -.->|"indexes via"| node_qdrant_store
node_extractors -->|"implements"| node_interfaces
node_embedder -->|"implements"| node_interfaces
node_local_source -->|"implements"| node_interfaces

click node_ingestion "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/services/ingestion.py"
click node_extractors "https://github.com/muthukamalan/agentic-rag/tree/master/src/rag/extractors"
click node_chunking "https://github.com/muthukamalan/agentic-rag/tree/master/src/rag/chunking"
click node_embedder "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/embedding/embedding_gemm2.py"
click node_local_source "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/sources/localsource.py"
click node_s3_source "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/sources/s3source.py"
click node_elastic_store "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/vectorstores/elastic_search.py"
click node_qdrant_store "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/vectorstores/qdrant.py"
click node_orchestrator "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/services/orchestrors.py"
click node_retrieval_metrics "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/metrics/retrival_metrics.py"
click node_reranker_metrics "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/metrics/reranker_metrics.py"
click node_interfaces "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/interfaces.py"
click node_models "https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/models.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_ingestion toneBlue
class node_extractors,node_chunking,node_embedder toneAmber
class node_local_source,node_s3_source,node_elastic_store,node_qdrant_store toneMint
class node_orchestrator,node_retrieval_metrics,node_reranker_metrics toneRose
class node_interfaces,node_models toneIndigo
```

## Components

### Ingestion

- [Ingestion Service](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/services/ingestion.py): `src/rag/services/ingestion.py`

### Content Processing

- [File Extractors](https://github.com/muthukamalan/agentic-rag/tree/master/src/rag/extractors): `src/rag/extractors`
- [Chunking Strategies](https://github.com/muthukamalan/agentic-rag/tree/master/src/rag/chunking): `src/rag/chunking`
- [Gemma2 Embedder](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/embedding/embedding_gemm2.py): `src/rag/embedding/embedding_gemm2.py`

### Sources and Indexes

- [Local Source](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/sources/localsource.py): `src/rag/sources/localsource.py`
- [S3 Source](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/sources/s3source.py): `src/rag/sources/s3source.py`
- [Elasticsearch Store](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/vectorstores/elastic_search.py): `src/rag/vectorstores/elastic_search.py`
- [Qdrant Store](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/vectorstores/qdrant.py): `src/rag/vectorstores/qdrant.py`

### Query and Evaluation

- [RAG Orchestrator](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/services/orchestrors.py): `src/rag/services/orchestrors.py`
- [Retrieval Metrics](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/metrics/retrival_metrics.py): `src/rag/metrics/retrival_metrics.py`
- [Reranker Metrics](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/metrics/reranker_metrics.py): `src/rag/metrics/reranker_metrics.py`

### Domain Contracts

- [Service Interfaces](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/interfaces.py): `src/rag/interfaces.py`
- [RAG Data Models](https://github.com/muthukamalan/agentic-rag/blob/master/src/rag/models.py): `src/rag/models.py`

## Connections

- Ingestion Service → File Extractors: extracts via (evidence: `src/rag/services/ingestion.py`)
- Ingestion Service → Chunking Strategies: chunks via (evidence: `src/rag/services/ingestion.py`)
- Ingestion Service → Gemma2 Embedder: embeds via (evidence: `src/rag/services/ingestion.py`)
- Ingestion Service → Elasticsearch Store: indexes via
- Ingestion Service → Qdrant Store: indexes via
- File Extractors → Service Interfaces: implements (evidence: `src/rag/extractors/pdf_extractors.py`)
- Gemma2 Embedder → Service Interfaces: implements (evidence: `src/rag/embedding/embedding_gemm2.py`)
- Local Source → Service Interfaces: implements (evidence: `src/rag/sources/localsource.py`)
