# mananjaykumar/enterprise-rag-ops-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/mananjaykumar/enterprise-rag-ops-intelligence
- Repository: https://github.com/mananjaykumar/enterprise-rag-ops-intelligence

## Overview

This is an enterprise knowledge and operations platform: users authenticate, ingest policy documents, then ask questions answered through permission-filtered hybrid RAG, secure SQL analytics, or a stateful agent that coordinates both. The frontend exposes chat, document ingestion, SQL, agent tracing, and telemetry experiences; the FastAPI application routes requests to domain services backed by PostgreSQL/pgvector and AI adapters. The README documents evaluation and observability capabilities. Source-index references establish several service and worker dependencies; links based only on README architecture are cited there. Unsampled implementation details are not inferred.

Main entry points: [`src/main.py`](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/main.py) (FastAPI application), [`frontend/src/app/page.tsx`](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/app/page.tsx) (Intelligence dashboard), [`src/services/ingestion.py`](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/ingestion.py) (Ingestion pipeline), [`frontend/src/lib/api.ts`](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Intelligence dashboard<br/>[page.tsx]"]
  node_chat["Unified chat"]
  node_ingest_ui["Document ingest UI"]
  node_policy_ui["Policy RAG view<br/>[PolicyRagView.tsx]"]
  node_sql_ui["SQL studio<br/>[SqlStudioView.tsx]"]
  node_agent_ui["Agent tracer"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and access"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_auth["Authentication and RBAC<br/>[auth.py]"]
  node_documents_api["Document endpoints<br/>[documents.py]"]
  node_rag_api["RAG endpoint<br/>[rag.py]"]
  node_retrieval_api["Retrieval endpoint<br/>[retrieval.py]"]
  node_sql_api["SQL endpoint<br/>[sql.py]"]
  node_agent_api["Agent endpoint<br/>[agent.py]"]
end

subgraph group_knowledge["Document knowledge"]
  node_ingestion["Ingestion pipeline<br/>[ingestion.py]"]
  node_parser["Document parser<br/>[parser.py]"]
  node_worker["Ingestion worker"]
  node_retrieval["Hybrid retrieval<br/>[retrieval.py]"]
end

subgraph group_intelligence["Query intelligence"]
  node_rag["Grounded RAG<br/>[rag.py]"]
  node_router["Intent router<br/>[router.py]"]
  node_text_sql["Text-to-SQL sandbox<br/>[text_to_sql.py]"]
  node_agent["Agent orchestrator"]
  node_evaluation["Benchmark evaluation<br/>[evaluation.py]"]
end

subgraph group_platform["Platform services"]
  node_ai_adapters["Gemini and reranking adapters"]
  node_storage["Local file storage<br/>[local.py]"]
  node_queue["Postgres job queue<br/>[postgres.py]"]
  node_database[("PostgreSQL and pgvector<br/>[session.py]")]
  node_observability["Tracing and telemetry<br/>[observability.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_dashboard
node_dashboard -.->|"presents"| node_chat
node_dashboard -.->|"presents"| node_ingest_ui
node_dashboard -.->|"presents"| node_policy_ui
node_dashboard -.->|"presents"| node_sql_ui
node_dashboard -.->|"presents"| node_agent_ui
node_chat -.->|"requests"| node_api_client
node_ingest_ui -.->|"requests"| node_api_client
node_policy_ui -.->|"requests"| node_api_client
node_sql_ui -.->|"requests"| node_api_client
node_agent_ui -.->|"requests"| node_api_client
node_api_client -->|"calls API"| node_fastapi
node_fastapi -->|"registers"| node_auth
node_fastapi -->|"registers"| node_documents_api
node_fastapi -->|"registers"| node_rag_api
node_fastapi -->|"registers"| node_retrieval_api
node_fastapi -->|"registers"| node_sql_api
node_fastapi -->|"registers"| node_agent_api
node_documents_api -.->|"enqueues documents"| node_ingestion
node_worker -->|"claims jobs"| node_queue
node_worker -->|"processes documents"| node_ingestion
node_ingestion -->|"parses files"| node_parser
node_ingestion -->|"reads files"| node_storage
node_ingestion -->|"embeds chunks"| node_ai_adapters
node_ingestion -->|"stores chunks"| node_database
node_retrieval_api -->|"calls search"| node_retrieval
node_rag_api -->|"calls answers"| node_rag
node_rag -->|"retrieves context"| node_retrieval
node_retrieval -->|"embeds and reranks"| node_ai_adapters
node_retrieval -->|"searches chunks"| node_database
node_sql_api -.->|"executes analytics"| node_text_sql
node_agent_api -.->|"starts workflow"| node_agent
node_agent -->|"routes intent"| node_router
node_agent -->|"requests policy answers"| node_rag
node_agent -->|"requests SQL analysis"| node_text_sql
node_router -->|"classifies query"| node_ai_adapters
node_text_sql -.->|"runs guarded queries"| node_database
node_fastapi -->|"flushes traces"| node_observability
node_fastapi -->|"starts worker"| node_worker
node_evaluation -.->|"benchmarks search"| node_retrieval
node_evaluation -.->|"scores answers"| node_rag
node_evaluation -.->|"checks SQL"| node_text_sql

click node_dashboard "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/app/page.tsx"
click node_chat "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/UnifiedChatView.tsx"
click node_ingest_ui "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/DocumentIngestView.tsx"
click node_policy_ui "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/PolicyRagView.tsx"
click node_sql_ui "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/SqlStudioView.tsx"
click node_agent_ui "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/AgentTracerView.tsx"
click node_api_client "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/lib/api.ts"
click node_fastapi "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/main.py"
click node_auth "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/auth.py"
click node_documents_api "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/documents.py"
click node_rag_api "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/rag.py"
click node_retrieval_api "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/retrieval.py"
click node_sql_api "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/sql.py"
click node_agent_api "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/agent.py"
click node_ingestion "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/ingestion.py"
click node_parser "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/parser.py"
click node_worker "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/workers/ingestion_worker.py"
click node_retrieval "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/retrieval.py"
click node_rag "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/rag.py"
click node_router "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/router.py"
click node_text_sql "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/text_to_sql.py"
click node_agent "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/agent_orchestrator.py"
click node_evaluation "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/evaluation.py"
click node_ai_adapters "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/tree/main/src/infrastructure/ai"
click node_storage "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/infrastructure/storage/local.py"
click node_queue "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/infrastructure/queue/postgres.py"
click node_database "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/db/session.py"
click node_observability "https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/observability.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_dashboard,node_chat,node_ingest_ui,node_policy_ui,node_sql_ui,node_agent_ui,node_api_client,node_user toneBlue
class node_fastapi,node_auth,node_documents_api,node_rag_api,node_retrieval_api,node_sql_api,node_agent_api toneAmber
class node_ingestion,node_parser,node_worker,node_retrieval toneMint
class node_rag,node_router,node_text_sql,node_agent,node_evaluation toneRose
class node_ai_adapters,node_storage,node_queue,node_database,node_observability toneIndigo
```

## Components

### User experience

- [Intelligence dashboard](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Unified chat](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/UnifiedChatView.tsx): `frontend/src/components/UnifiedChatView.tsx`
- [Document ingest UI](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/DocumentIngestView.tsx): `frontend/src/components/DocumentIngestView.tsx`
- [Policy RAG view](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/PolicyRagView.tsx): `frontend/src/components/PolicyRagView.tsx`
- [SQL studio](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/SqlStudioView.tsx): `frontend/src/components/SqlStudioView.tsx`
- [Agent tracer](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/components/AgentTracerView.tsx): `frontend/src/components/AgentTracerView.tsx`
- [API client](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API and access

- [FastAPI application](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/main.py): `src/main.py`
- [Authentication and RBAC](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/auth.py): `src/api/v1/auth.py`
- [Document endpoints](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/documents.py): `src/api/v1/documents.py`
- [RAG endpoint](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/rag.py): `src/api/v1/rag.py`
- [Retrieval endpoint](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/retrieval.py): `src/api/v1/retrieval.py`
- [SQL endpoint](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/sql.py): `src/api/v1/sql.py`
- [Agent endpoint](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/api/v1/agent.py): `src/api/v1/agent.py`

### Document knowledge

- [Ingestion pipeline](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/ingestion.py): `src/services/ingestion.py`
- [Document parser](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/parser.py): `src/services/parser.py`
- [Ingestion worker](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/workers/ingestion_worker.py): `src/workers/ingestion_worker.py`
- [Hybrid retrieval](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/retrieval.py): `src/services/retrieval.py`

### Query intelligence

- [Grounded RAG](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/rag.py): `src/services/rag.py`
- [Intent router](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/router.py): `src/services/router.py`
- [Text-to-SQL sandbox](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/text_to_sql.py): `src/services/text_to_sql.py`
- [Agent orchestrator](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/agent_orchestrator.py): `src/services/agent_orchestrator.py`
- [Benchmark evaluation](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/evaluation.py): `src/services/evaluation.py`

### Platform services

- [Gemini and reranking adapters](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/tree/main/src/infrastructure/ai): `src/infrastructure/ai`
- [Local file storage](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/infrastructure/storage/local.py): `src/infrastructure/storage/local.py`
- [Postgres job queue](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/infrastructure/queue/postgres.py): `src/infrastructure/queue/postgres.py`
- [PostgreSQL and pgvector](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/db/session.py): `src/db/session.py`
- [Tracing and telemetry](https://github.com/mananjaykumar/enterprise-rag-ops-intelligence/blob/main/src/services/observability.py): `src/services/observability.py`

### Other components

- **User**

## Connections

- User → Intelligence dashboard: uses (evidence: `README.md`)
- Intelligence dashboard → Unified chat: presents
- Intelligence dashboard → Document ingest UI: presents
- Intelligence dashboard → Policy RAG view: presents
- Intelligence dashboard → SQL studio: presents
- Intelligence dashboard → Agent tracer: presents
- Unified chat → API client: requests
- Document ingest UI → API client: requests
- Policy RAG view → API client: requests
- SQL studio → API client: requests
- Agent tracer → API client: requests
- API client → FastAPI application: calls API (evidence: `README.md`)
- FastAPI application → Authentication and RBAC: registers (evidence: `src/main.py`)
- FastAPI application → Document endpoints: registers (evidence: `src/main.py`)
- FastAPI application → RAG endpoint: registers (evidence: `src/main.py`)
- FastAPI application → Retrieval endpoint: registers (evidence: `src/main.py`)
- FastAPI application → SQL endpoint: registers (evidence: `src/main.py`)
- FastAPI application → Agent endpoint: registers (evidence: `src/main.py`)
- Document endpoints → Ingestion pipeline: enqueues documents
- Ingestion worker → Postgres job queue: claims jobs (evidence: `src/workers/ingestion_worker.py`)
- Ingestion worker → Ingestion pipeline: processes documents (evidence: `src/workers/ingestion_worker.py`)
- Ingestion pipeline → Document parser: parses files (evidence: `src/services/ingestion.py`)
- Ingestion pipeline → Local file storage: reads files (evidence: `src/services/ingestion.py`)
- Ingestion pipeline → Gemini and reranking adapters: embeds chunks (evidence: `src/services/ingestion.py`)
- Ingestion pipeline → PostgreSQL and pgvector: stores chunks (evidence: `src/services/ingestion.py`)
- Retrieval endpoint → Hybrid retrieval: calls search (evidence: `src/api/v1/retrieval.py`)
- RAG endpoint → Grounded RAG: calls answers (evidence: `src/api/v1/rag.py`)
- Grounded RAG → Hybrid retrieval: retrieves context (evidence: `src/services/rag.py`)
- Hybrid retrieval → Gemini and reranking adapters: embeds and reranks (evidence: `src/services/retrieval.py`)
- Hybrid retrieval → PostgreSQL and pgvector: searches chunks (evidence: `src/services/retrieval.py`)
- SQL endpoint → Text-to-SQL sandbox: executes analytics
- Agent endpoint → Agent orchestrator: starts workflow
- Agent orchestrator → Intent router: routes intent (evidence: `src/services/agent_orchestrator.py`)
- Agent orchestrator → Grounded RAG: requests policy answers (evidence: `src/services/agent_orchestrator.py`)
- Agent orchestrator → Text-to-SQL sandbox: requests SQL analysis (evidence: `src/services/agent_orchestrator.py`)
- Intent router → Gemini and reranking adapters: classifies query (evidence: `src/services/router.py`)
- Text-to-SQL sandbox → PostgreSQL and pgvector: runs guarded queries (evidence: `README.md`)
- FastAPI application → Tracing and telemetry: flushes traces (evidence: `src/main.py`)
- FastAPI application → Ingestion worker: starts worker (evidence: `src/main.py`)
- Benchmark evaluation → Hybrid retrieval: benchmarks search (evidence: `README.md`)
- Benchmark evaluation → Grounded RAG: scores answers (evidence: `README.md`)
- Benchmark evaluation → Text-to-SQL sandbox: checks SQL (evidence: `README.md`)
