# jadeharsha/documind-ai architecture

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

- Interactive diagram: https://gitdiagram.com/jadeharsha/documind-ai
- Repository: https://github.com/jadeharsha/documind-ai

## Overview

Documind AI is a workspace-based document intelligence application. Users sign in, organize documents into workspaces, upload them for extraction and indexing, then use grounded chat and research or study features to work with the indexed material. The frontend exposes those capabilities through routed pages and a shared API client; backend ingestion and retrieval support document processing and RAG. Several feature implementations and backend routes were not sampled, so those connections are marked unverified rather than asserted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/App.tsx) (Routes and layouts), [`frontend/src/services/api.ts`](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/services/api.ts) (API client), [`backend/apps/ingestion/tasks.py`](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/tasks.py) (Ingestion task), [`backend/config/urls.py`](https://github.com/jadeharsha/documind-ai/blob/main/backend/config/urls.py) (Backend API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Routes and layouts<br/>[App.tsx]"]
  node_auth["Authentication state<br/>[authStore.ts]"]
  node_workspace_state["Workspace state<br/>[workspaceStore.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_documents_ui["Document management<br/>[DocumentsPage.tsx]"]
  node_chat_ui["Grounded chat<br/>[ChatPage.tsx]"]
  node_agent_ui["Agent tasks<br/>[AgentPage.tsx]"]
  node_research_ui["Research analysis<br/>[ResearchPage.tsx]"]
  node_study_ui["Study tools<br/>[QuizzesPage.tsx]"]
  node_analytics_ui["Analytics<br/>[AnalyticsPage.tsx]"]
  node_content_ui["Summaries and comparisons<br/>[SummariesPage.tsx]"]
end

subgraph group_content["Document processing"]
  node_documents[("Document records<br/>[models.py]")]
  node_ingestion_task["Ingestion task<br/>[tasks.py]"]
  node_storage["File storage<br/>[storage.py]"]
  node_extractor["Text extraction<br/>[extractor.py]"]
  node_chunker["Page-aware chunking<br/>[chunker.py]"]
end

subgraph group_intelligence["AI capabilities"]
  node_embedding["Text embeddings"]
  node_vector_store[("Vector retrieval<br/>[qdrant_service.py]")]
  node_rag_engine["RAG engine<br/>[rag_engine.py]"]
  node_llm["LLM providers<br/>[llm_service.py]"]
  node_agent_workflow["Agent workflow"]
  node_agent_tools["Agent tools<br/>[registry.py]"]
end

subgraph group_workspace["Workspace services"]
  node_backend_api["Backend API routes<br/>[urls.py]"]
  node_feature_services["Other feature APIs"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_documents_ui
node_app -->|"routes to"| node_chat_ui
node_app -->|"routes to"| node_agent_ui
node_app -->|"routes to"| node_research_ui
node_app -->|"routes to"| node_study_ui
node_app -->|"routes to"| node_analytics_ui
node_app -->|"routes to"| node_content_ui
node_auth -->|"calls"| node_api_client
node_workspace_state -->|"calls"| node_api_client
node_documents_ui -->|"calls"| node_api_client
node_chat_ui -->|"calls"| node_api_client
node_agent_ui -->|"calls"| node_api_client
node_research_ui -->|"calls"| node_api_client
node_study_ui -->|"calls"| node_api_client
node_analytics_ui -->|"calls"| node_api_client
node_api_client -.->|"HTTP requests"| node_backend_api
node_backend_api -.->|"routes requests"| node_documents
node_ingestion_task -->|"updates records"| node_documents
node_ingestion_task -->|"loads files"| node_storage
node_ingestion_task -->|"extracts text"| node_extractor
node_ingestion_task -->|"chunks pages"| node_chunker
node_ingestion_task -->|"embeds chunks"| node_embedding
node_ingestion_task -->|"indexes chunks"| node_vector_store
node_rag_engine -->|"embeds queries"| node_embedding
node_rag_engine -->|"retrieves context"| node_vector_store
node_rag_engine -->|"generates answers"| node_llm
node_backend_api -.->|"dispatches queries"| node_rag_engine
node_backend_api -.->|"dispatches tasks"| node_agent_workflow
node_agent_workflow -.->|"uses tools"| node_agent_tools
node_backend_api -.->|"serves features"| node_feature_services

click node_app "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/stores/authStore.ts"
click node_workspace_state "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/stores/workspaceStore.ts"
click node_api_client "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/services/api.ts"
click node_documents_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/DocumentsPage.tsx"
click node_chat_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/ChatPage.tsx"
click node_agent_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/AgentPage.tsx"
click node_research_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/ResearchPage.tsx"
click node_study_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/QuizzesPage.tsx"
click node_analytics_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/AnalyticsPage.tsx"
click node_content_ui "https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/SummariesPage.tsx"
click node_backend_api "https://github.com/jadeharsha/documind-ai/blob/main/backend/config/urls.py"
click node_documents "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/documents/models.py"
click node_ingestion_task "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/tasks.py"
click node_storage "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/services/storage.py"
click node_extractor "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/services/extractor.py"
click node_chunker "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/services/chunker.py"
click node_embedding "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/embeddings/services/embedding_service.py"
click node_vector_store "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/retrieval/services/qdrant_service.py"
click node_rag_engine "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/rag/services/rag_engine.py"
click node_llm "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/rag/services/llm_service.py"
click node_agent_workflow "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/agent/orchestrator/langgraph_workflow.py"
click node_agent_tools "https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/agent/tools/registry.py"
click node_feature_services "https://github.com/jadeharsha/documind-ai/tree/main/backend/apps"

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_auth,node_workspace_state,node_api_client,node_documents_ui,node_chat_ui,node_agent_ui,node_research_ui,node_study_ui,node_analytics_ui,node_content_ui,node_user toneBlue
class node_documents,node_ingestion_task,node_storage,node_extractor,node_chunker toneAmber
class node_embedding,node_vector_store,node_rag_engine,node_llm,node_agent_workflow,node_agent_tools toneMint
class node_backend_api,node_feature_services toneRose
```

## Components

### Web application

- [Routes and layouts](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication state](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/stores/authStore.ts): `frontend/src/stores/authStore.ts`
- [Workspace state](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/stores/workspaceStore.ts): `frontend/src/stores/workspaceStore.ts`
- [API client](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Document management](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/DocumentsPage.tsx): `frontend/src/pages/DocumentsPage.tsx`
- [Grounded chat](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/ChatPage.tsx): `frontend/src/pages/ChatPage.tsx`
- [Agent tasks](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/AgentPage.tsx): `frontend/src/pages/AgentPage.tsx`
- [Research analysis](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/ResearchPage.tsx): `frontend/src/pages/ResearchPage.tsx`
- [Study tools](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/QuizzesPage.tsx): `frontend/src/pages/QuizzesPage.tsx`
- [Analytics](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/AnalyticsPage.tsx): `frontend/src/pages/AnalyticsPage.tsx`
- [Summaries and comparisons](https://github.com/jadeharsha/documind-ai/blob/main/frontend/src/pages/SummariesPage.tsx): `frontend/src/pages/SummariesPage.tsx`

### Document processing

- [Document records](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/documents/models.py): `backend/apps/documents/models.py`
- [Ingestion task](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/tasks.py): `backend/apps/ingestion/tasks.py`
- [File storage](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/services/storage.py): `backend/apps/ingestion/services/storage.py`
- [Text extraction](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/services/extractor.py): `backend/apps/ingestion/services/extractor.py`
- [Page-aware chunking](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/ingestion/services/chunker.py): `backend/apps/ingestion/services/chunker.py`

### AI capabilities

- [Text embeddings](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/embeddings/services/embedding_service.py): `backend/apps/embeddings/services/embedding_service.py`
- [Vector retrieval](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/retrieval/services/qdrant_service.py): `backend/apps/retrieval/services/qdrant_service.py`
- [RAG engine](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/rag/services/rag_engine.py): `backend/apps/rag/services/rag_engine.py`
- [LLM providers](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/rag/services/llm_service.py): `backend/apps/rag/services/llm_service.py`
- [Agent workflow](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/agent/orchestrator/langgraph_workflow.py): `backend/apps/agent/orchestrator/langgraph_workflow.py`
- [Agent tools](https://github.com/jadeharsha/documind-ai/blob/main/backend/apps/agent/tools/registry.py): `backend/apps/agent/tools/registry.py`

### Workspace services

- [Backend API routes](https://github.com/jadeharsha/documind-ai/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [Other feature APIs](https://github.com/jadeharsha/documind-ai/tree/main/backend/apps): `backend/apps`

### Other components

- **User**

## Connections

- User → Routes and layouts: uses (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Document management: routes to (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Grounded chat: routes to (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Agent tasks: routes to (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Research analysis: routes to (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Study tools: routes to (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Analytics: routes to (evidence: `frontend/src/App.tsx`)
- Routes and layouts → Summaries and comparisons: routes to (evidence: `frontend/src/App.tsx`)
- Authentication state → API client: calls (evidence: `frontend/src/stores/authStore.ts`)
- Workspace state → API client: calls (evidence: `frontend/src/stores/workspaceStore.ts`)
- Document management → API client: calls (evidence: `frontend/src/pages/DocumentsPage.tsx`)
- Grounded chat → API client: calls (evidence: `frontend/src/pages/ChatPage.tsx`)
- Agent tasks → API client: calls (evidence: `frontend/src/pages/AgentPage.tsx`)
- Research analysis → API client: calls (evidence: `frontend/src/pages/ResearchPage.tsx`)
- Study tools → API client: calls (evidence: `frontend/src/pages/QuizzesPage.tsx`)
- Analytics → API client: calls (evidence: `frontend/src/pages/AnalyticsPage.tsx`)
- API client → Backend API routes: HTTP requests
- Backend API routes → Document records: routes requests
- Ingestion task → Document records: updates records (evidence: `backend/apps/ingestion/tasks.py`)
- Ingestion task → File storage: loads files (evidence: `backend/apps/ingestion/tasks.py`)
- Ingestion task → Text extraction: extracts text (evidence: `backend/apps/ingestion/tasks.py`)
- Ingestion task → Page-aware chunking: chunks pages (evidence: `backend/apps/ingestion/tasks.py`)
- Ingestion task → Text embeddings: embeds chunks (evidence: `backend/apps/ingestion/tasks.py`)
- Ingestion task → Vector retrieval: indexes chunks (evidence: `backend/apps/ingestion/tasks.py`)
- RAG engine → Text embeddings: embeds queries (evidence: `backend/apps/rag/services/rag_engine.py`)
- RAG engine → Vector retrieval: retrieves context (evidence: `backend/apps/rag/services/rag_engine.py`)
- RAG engine → LLM providers: generates answers (evidence: `backend/apps/rag/services/rag_engine.py`)
- Backend API routes → RAG engine: dispatches queries
- Backend API routes → Agent workflow: dispatches tasks
- Agent workflow → Agent tools: uses tools
- Backend API routes → Other feature APIs: serves features
