# prabhasmgit/multi-agent-ai-helpdesk architecture

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

- Interactive diagram: https://gitdiagram.com/prabhasmgit/multi-agent-ai-helpdesk
- Repository: https://github.com/prabhasmgit/multi-agent-ai-helpdesk

## Overview

Multi-Agent AI Helpdesk is a multi-tenant support platform with a web UI, API, and LangGraph assistant. The primary workflow takes an employee’s chat turn through intent and retrieval, grounded-answer verification, confidence-based L1/L2/L3 handling, and response; low-confidence cases can escalate to ticketing. Other major branches include document search, safe natural-language data operations, authentication/RBAC, ticket management, and a reviewed knowledge-base learning loop. Relationships for unsampled features follow the README; source excerpts provide further evidence for ingestion and orchestration details.

Main entry points: [`backend/app/api/v1/router.py`](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/router.py) (API routes), [`backend/app/api/v1/chat.py`](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/chat.py) (Chat endpoint), [`backend/app/agents/engine.py`](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/engine.py) (Agent engine), [`backend/app/agents/nodes/confidence_gate.py`](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/confidence_gate.py) (Confidence routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web_chat["Chat interface<br/>[ChatPage.tsx]"]
  node_web_portal["Helpdesk portal<br/>[App.tsx]"]
end

subgraph group_api["API and identity"]
  node_api_app["API application<br/>[main.py]"]
  node_api_router["API routes<br/>[router.py]"]
  node_auth["Authentication<br/>[auth_service.py]"]
  node_chat_api["Chat endpoint<br/>[chat.py]"]
end

subgraph group_assistant["AI assistance"]
  node_agent_engine["Agent engine<br/>[engine.py]"]
  node_agent_state["Shared turn state<br/>[state.py]"]
  node_intent_plan["Intent and planning<br/>[query_planner.py]"]
  node_retrieval["Hybrid retrieval<br/>[retriever.py]"]
  node_answer_verify["Answer and verify"]
  node_confidence_route["Confidence routing<br/>[confidence_gate.py]"]
end

subgraph group_knowledge["Knowledge and search"]
  node_kb_api["Knowledge management<br/>[kb.py]"]
  node_ingestion_worker["Ingestion worker<br/>[ingestion_tasks.py]"]
  node_ingestion_pipeline["Parse and index<br/>[ingestion.py]"]
  node_kb_store[("Knowledge store<br/>[kb_repo.py]")]
  node_vector_store[("Vector store<br/>[vectorstore.py]")]
  node_doc_search["Document search"]
end

subgraph group_operations["Support operations"]
  node_escalation["Human handoff<br/>[human_handoff.py]"]
  node_ticketing["Ticket management<br/>[tickets.py]"]
  node_ai_data["Natural-language data<br/>[ai_data_api.py]"]
  node_analytics["Analytics<br/>[analytics.py]"]
end

node_employee(("Employee"))
node_postgres[("PostgreSQL")]
node_llm_provider{{"Model provider"}}

node_employee -->|"asks question"| node_web_chat
node_employee -->|"uses support tools"| node_web_portal
node_web_chat -.->|"sends turn"| node_chat_api
node_web_portal -.->|"uses API"| node_api_app
node_api_app -->|"mounts routes"| node_api_router
node_api_router -->|"routes chat"| node_chat_api
node_api_router -->|"routes sign-in"| node_auth
node_chat_api -->|"runs turn"| node_agent_engine
node_agent_engine -->|"seeds state"| node_agent_state
node_agent_engine -->|"runs graph"| node_intent_plan
node_intent_plan -->|"plans retrieval"| node_retrieval
node_retrieval -->|"supplies sources"| node_answer_verify
node_answer_verify -->|"checks grounding"| node_confidence_route
node_confidence_route -->|"delivers answer"| node_chat_api
node_confidence_route -->|"escalates"| node_escalation
node_escalation -->|"creates ticket"| node_ticketing
node_kb_api -.->|"queues indexing"| node_ingestion_worker
node_ingestion_worker -->|"indexes text"| node_ingestion_pipeline
node_ingestion_worker -->|"writes chunks"| node_kb_store
node_ingestion_pipeline -->|"upserts vectors"| node_vector_store
node_ingestion_pipeline -.->|"embeds chunks"| node_llm_provider
node_kb_store -.->|"persists articles"| node_postgres
node_vector_store -.->|"stores vectors"| node_postgres
node_doc_search -->|"searches passages"| node_postgres
node_doc_search -.->|"summarizes hits"| node_llm_provider
node_api_router -->|"routes knowledge"| node_kb_api
node_api_router -->|"routes tickets"| node_ticketing
node_api_router -->|"routes data queries"| node_ai_data
node_api_router -->|"routes analytics"| node_analytics
node_ticketing -.->|"drafts resolution article"| node_kb_api

click node_web_chat "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/frontend/src/modules/chat/ChatPage.tsx"
click node_web_portal "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/frontend/src/App.tsx"
click node_api_app "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/main.py"
click node_api_router "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/router.py"
click node_auth "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/services/auth_service.py"
click node_chat_api "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/chat.py"
click node_agent_engine "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/engine.py"
click node_agent_state "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/state.py"
click node_intent_plan "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/query_planner.py"
click node_retrieval "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/rag/retriever.py"
click node_answer_verify "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/grounding_verifier.py"
click node_confidence_route "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/confidence_gate.py"
click node_escalation "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/human_handoff.py"
click node_ticketing "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/tickets.py"
click node_kb_api "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/kb.py"
click node_ingestion_worker "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/workers/ingestion_tasks.py"
click node_ingestion_pipeline "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/rag/ingestion.py"
click node_kb_store "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/repositories/kb_repo.py"
click node_vector_store "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/rag/vectorstore.py"
click node_doc_search "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/services/docsearch_service.py"
click node_ai_data "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/services/ai_data_api.py"
click node_analytics "https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/analytics.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_web_chat,node_web_portal toneBlue
class node_api_app,node_api_router,node_auth,node_chat_api,node_postgres toneAmber
class node_agent_engine,node_agent_state,node_intent_plan,node_retrieval,node_answer_verify,node_confidence_route toneMint
class node_kb_api,node_ingestion_worker,node_ingestion_pipeline,node_kb_store,node_vector_store,node_doc_search toneRose
class node_escalation,node_ticketing,node_ai_data,node_analytics,node_employee,node_llm_provider toneIndigo
```

## Components

### User experience

- [Chat interface](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/frontend/src/modules/chat/ChatPage.tsx): `frontend/src/modules/chat/ChatPage.tsx`
- [Helpdesk portal](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### API and identity

- [API application](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Authentication](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Chat endpoint](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/chat.py): `backend/app/api/v1/chat.py`

### AI assistance

- [Agent engine](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/engine.py): `backend/app/agents/engine.py`
- [Shared turn state](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/state.py): `backend/app/agents/state.py`
- [Intent and planning](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/query_planner.py): `backend/app/agents/nodes/query_planner.py`
- [Hybrid retrieval](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/rag/retriever.py): `backend/app/rag/retriever.py`
- [Answer and verify](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/grounding_verifier.py): `backend/app/agents/nodes/grounding_verifier.py`
- [Confidence routing](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/confidence_gate.py): `backend/app/agents/nodes/confidence_gate.py`

### Knowledge and search

- [Knowledge management](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/kb.py): `backend/app/api/v1/kb.py`
- [Ingestion worker](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/workers/ingestion_tasks.py): `backend/app/workers/ingestion_tasks.py`
- [Parse and index](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/rag/ingestion.py): `backend/app/rag/ingestion.py`
- [Knowledge store](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/repositories/kb_repo.py): `backend/app/repositories/kb_repo.py`
- [Vector store](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/rag/vectorstore.py): `backend/app/rag/vectorstore.py`
- [Document search](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/services/docsearch_service.py): `backend/app/services/docsearch_service.py`

### Support operations

- [Human handoff](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/agents/nodes/human_handoff.py): `backend/app/agents/nodes/human_handoff.py`
- [Ticket management](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/tickets.py): `backend/app/api/v1/tickets.py`
- [Natural-language data](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/services/ai_data_api.py): `backend/app/services/ai_data_api.py`
- [Analytics](https://github.com/prabhasmgit/multi-agent-ai-helpdesk/blob/main/backend/app/api/v1/analytics.py): `backend/app/api/v1/analytics.py`

### Other components

- **Employee**
- **PostgreSQL**
- **Model provider**

## Connections

- Employee → Chat interface: asks question
- Employee → Helpdesk portal: uses support tools
- Chat interface → Chat endpoint: sends turn
- Helpdesk portal → API application: uses API
- API application → API routes: mounts routes (evidence: `backend/app/main.py`)
- API routes → Chat endpoint: routes chat (evidence: `backend/app/api/v1/router.py`)
- API routes → Authentication: routes sign-in (evidence: `backend/app/api/v1/router.py`)
- Chat endpoint → Agent engine: runs turn
- Agent engine → Shared turn state: seeds state (evidence: `backend/app/agents/engine.py`)
- Agent engine → Intent and planning: runs graph
- Intent and planning → Hybrid retrieval: plans retrieval
- Hybrid retrieval → Answer and verify: supplies sources
- Answer and verify → Confidence routing: checks grounding
- Confidence routing → Chat endpoint: delivers answer
- Confidence routing → Human handoff: escalates
- Human handoff → Ticket management: creates ticket
- Knowledge management → Ingestion worker: queues indexing
- Ingestion worker → Parse and index: indexes text (evidence: `backend/app/workers/ingestion_tasks.py`)
- Ingestion worker → Knowledge store: writes chunks (evidence: `backend/app/workers/ingestion_tasks.py`)
- Parse and index → Vector store: upserts vectors (evidence: `backend/app/rag/ingestion.py`)
- Parse and index → Model provider: embeds chunks
- Knowledge store → PostgreSQL: persists articles
- Vector store → PostgreSQL: stores vectors
- Document search → PostgreSQL: searches passages (evidence: `backend/app/services/docsearch_service.py`)
- Document search → Model provider: summarizes hits
- API routes → Knowledge management: routes knowledge (evidence: `backend/app/api/v1/router.py`)
- API routes → Ticket management: routes tickets (evidence: `backend/app/api/v1/router.py`)
- API routes → Natural-language data: routes data queries (evidence: `backend/app/api/v1/router.py`)
- API routes → Analytics: routes analytics (evidence: `backend/app/api/v1/router.py`)
- Ticket management → Knowledge management: drafts resolution article
