# srinivas626/multi-agent-support-ai architecture

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

- Interactive diagram: https://gitdiagram.com/srinivas626/multi-agent-support-ai
- Repository: https://github.com/srinivas626/multi-agent-support-ai

## Overview

Multi-Agent Support AI accepts support questions through a FastAPI chat API and returns a composed answer. The graph routes each request to document-grounded retrieval, general chat, or an action path; actions pass role checks, approval gating, and argument validation before mock ticket/email tools. The README also documents a static chat UI and an offline knowledge-index build path. Edges follow explicit workflow wiring, sampled calls, or README statements; unsampled endpoint and indexing internals are represented only where documented.

Main entry points: [`app/graph/nodes.py`](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/nodes.py) (Workflow nodes), [`app/graph/workflow.py`](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/workflow.py) (Workflow graph), [`app/main.py`](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/main.py) (Chat API), [`app/rag/qa.py`](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/qa.py) (Grounded answering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User access"]
  node_api["Chat API<br/>[main.py]"]
  node_webui["Chat page<br/>[index.html]"]
end

subgraph group_workflow["Agent workflow"]
  node_graph["Workflow graph<br/>[workflow.py]"]
  node_state["Request state<br/>[state.py]"]
  node_router["Route classifier<br/>[router.py]"]
  node_nodes["Workflow nodes<br/>[nodes.py]"]
  node_general_agent["General chat<br/>[general_agent.py]"]
  node_action_agent["Action selector<br/>[action_agent.py]"]
  node_response_agent["Response formatter<br/>[response_agent.py]"]
end

subgraph group_knowledge["Knowledge retrieval"]
  node_knowledge_agent["Knowledge agent<br/>[knowledge_agent.py]"]
  node_rag_qa["Grounded answering<br/>[qa.py]"]
  node_retrieval["Document search<br/>[retriever.py]"]
  node_embeddings["Text embeddings<br/>[embeddings.py]"]
  node_index_builder["Index preparation<br/>[build_index.py]"]
  node_source_docs["Support documents"]
  node_vector_index[("FAISS index<br/>[index.faiss]")]
end

subgraph group_safety["Action safeguards"]
  node_permissions["Role permissions<br/>[permissions.py]"]
  node_risk["Approval rules<br/>[risk.py]"]
  node_validation["Argument validation<br/>[validation.py]"]
end

subgraph group_integrations["Models and tools"]
  node_ticket_tool["Ticket tool<br/>[ticket_tool.py]"]
  node_email_tool["Email tool<br/>[email_tool.py]"]
  node_bedrock["Bedrock model"]
end

node_user(("Support user"))

node_user -->|"submits chat"| node_api
node_user -->|"uses chat"| node_webui
node_webui -.->|"sends chat"| node_api
node_api -->|"invokes workflow"| node_graph
node_graph -->|"uses state"| node_state
node_graph -->|"registers nodes"| node_nodes
node_nodes -->|"classifies request"| node_router
node_nodes -->|"runs retrieval agent"| node_knowledge_agent
node_knowledge_agent -->|"answers question"| node_rag_qa
node_rag_qa -->|"searches documents"| node_retrieval
node_retrieval -->|"creates embeddings"| node_embeddings
node_retrieval -->|"loads and searches"| node_vector_index
node_source_docs -.->|"provides source text"| node_index_builder
node_index_builder -->|"builds index"| node_vector_index
node_nodes -->|"runs general chat"| node_general_agent
node_nodes -->|"selects action"| node_action_agent
node_nodes -->|"checks role"| node_permissions
node_nodes -->|"checks approval"| node_risk
node_nodes -->|"validates arguments"| node_validation
node_nodes -->|"executes ticket"| node_ticket_tool
node_nodes -->|"executes email"| node_email_tool
node_nodes -->|"formats result"| node_response_agent
node_router -->|"classifies with"| node_bedrock
node_action_agent -->|"selects with"| node_bedrock
node_rag_qa -->|"generates answer"| node_bedrock
node_general_agent -->|"generates reply"| node_bedrock
node_response_agent -->|"composes response"| node_bedrock
node_graph -.->|"returns result"| node_api

click node_api "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/main.py"
click node_webui "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/static/index.html"
click node_graph "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/workflow.py"
click node_state "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/state.py"
click node_router "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/router.py"
click node_nodes "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/nodes.py"
click node_knowledge_agent "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/knowledge_agent.py"
click node_rag_qa "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/qa.py"
click node_retrieval "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/retriever.py"
click node_embeddings "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/embeddings.py"
click node_index_builder "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/build_index.py"
click node_source_docs "https://github.com/srinivas626/multi-agent-support-ai/blob/main/data/documents/company_support.txt"
click node_vector_index "https://github.com/srinivas626/multi-agent-support-ai/blob/main/data/vectorstore/index.faiss"
click node_general_agent "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/general_agent.py"
click node_action_agent "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/action_agent.py"
click node_permissions "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/guardrails/permissions.py"
click node_risk "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/guardrails/risk.py"
click node_validation "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/guardrails/validation.py"
click node_ticket_tool "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/tools/ticket_tool.py"
click node_email_tool "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/tools/email_tool.py"
click node_response_agent "https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/response_agent.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_api,node_webui,node_user toneBlue
class node_graph,node_state,node_router,node_nodes,node_general_agent,node_action_agent,node_response_agent toneAmber
class node_knowledge_agent,node_rag_qa,node_retrieval,node_embeddings,node_index_builder,node_source_docs,node_vector_index toneMint
class node_permissions,node_risk,node_validation toneRose
class node_ticket_tool,node_email_tool,node_bedrock toneIndigo
```

## Components

### User access

- [Chat API](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/main.py): `app/main.py`
- [Chat page](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/static/index.html): `app/static/index.html`

### Agent workflow

- [Workflow graph](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/workflow.py): `app/graph/workflow.py`
- [Request state](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/state.py): `app/graph/state.py`
- [Route classifier](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/router.py): `app/agents/router.py`
- [Workflow nodes](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/graph/nodes.py): `app/graph/nodes.py`
- [General chat](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/general_agent.py): `app/agents/general_agent.py`
- [Action selector](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/action_agent.py): `app/agents/action_agent.py`
- [Response formatter](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/response_agent.py): `app/agents/response_agent.py`

### Knowledge retrieval

- [Knowledge agent](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/agents/knowledge_agent.py): `app/agents/knowledge_agent.py`
- [Grounded answering](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/qa.py): `app/rag/qa.py`
- [Document search](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/retriever.py): `app/rag/retriever.py`
- [Text embeddings](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/embeddings.py): `app/rag/embeddings.py`
- [Index preparation](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/rag/build_index.py): `app/rag/build_index.py`
- [Support documents](https://github.com/srinivas626/multi-agent-support-ai/blob/main/data/documents/company_support.txt): `data/documents/company_support.txt`
- [FAISS index](https://github.com/srinivas626/multi-agent-support-ai/blob/main/data/vectorstore/index.faiss): `data/vectorstore/index.faiss`

### Action safeguards

- [Role permissions](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/guardrails/permissions.py): `app/guardrails/permissions.py`
- [Approval rules](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/guardrails/risk.py): `app/guardrails/risk.py`
- [Argument validation](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/guardrails/validation.py): `app/guardrails/validation.py`

### Models and tools

- [Ticket tool](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/tools/ticket_tool.py): `app/tools/ticket_tool.py`
- [Email tool](https://github.com/srinivas626/multi-agent-support-ai/blob/main/app/tools/email_tool.py): `app/tools/email_tool.py`
- **Bedrock model**

### Other components

- **Support user**

## Connections

- Support user → Chat API: submits chat (evidence: `README.md`)
- Support user → Chat page: uses chat (evidence: `README.md`)
- Chat page → Chat API: sends chat
- Chat API → Workflow graph: invokes workflow (evidence: `app/main.py`)
- Workflow graph → Request state: uses state (evidence: `app/graph/workflow.py`)
- Workflow graph → Workflow nodes: registers nodes (evidence: `app/graph/workflow.py`)
- Workflow nodes → Route classifier: classifies request (evidence: `app/graph/nodes.py`)
- Workflow nodes → Knowledge agent: runs retrieval agent (evidence: `app/graph/nodes.py`)
- Knowledge agent → Grounded answering: answers question (evidence: `app/agents/knowledge_agent.py`)
- Grounded answering → Document search: searches documents (evidence: `app/rag/qa.py`)
- Document search → Text embeddings: creates embeddings (evidence: `app/rag/retriever.py`)
- Document search → FAISS index: loads and searches (evidence: `app/rag/retriever.py`)
- Support documents → Index preparation: provides source text
- Index preparation → FAISS index: builds index (evidence: `README.md`)
- Workflow nodes → General chat: runs general chat (evidence: `app/graph/nodes.py`)
- Workflow nodes → Action selector: selects action (evidence: `app/graph/nodes.py`)
- Workflow nodes → Role permissions: checks role (evidence: `app/graph/nodes.py`)
- Workflow nodes → Approval rules: checks approval (evidence: `app/graph/nodes.py`)
- Workflow nodes → Argument validation: validates arguments (evidence: `app/graph/nodes.py`)
- Workflow nodes → Ticket tool: executes ticket (evidence: `app/graph/nodes.py`)
- Workflow nodes → Email tool: executes email (evidence: `app/graph/nodes.py`)
- Workflow nodes → Response formatter: formats result (evidence: `app/graph/nodes.py`)
- Route classifier → Bedrock model: classifies with (evidence: `app/agents/router.py`)
- Action selector → Bedrock model: selects with (evidence: `app/agents/action_agent.py`)
- Grounded answering → Bedrock model: generates answer (evidence: `app/rag/qa.py`)
- General chat → Bedrock model: generates reply (evidence: `app/agents/general_agent.py`)
- Response formatter → Bedrock model: composes response (evidence: `app/agents/response_agent.py`)
- Workflow graph → Chat API: returns result (evidence: `app/main.py`)
