# davidsandeep1996-spec/fca-multi-agent-support architecture

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

- Interactive diagram: https://gitdiagram.com/davidsandeep1996-spec/fca-multi-agent-support
- Repository: https://github.com/davidsandeep1996-spec/fca-multi-agent-support

## Overview

This is an FCA-focused financial-services customer-support system. A customer submits a message through the client/API; the coordinator runs a stateful LangGraph workflow that applies security checks, classifies intent, dispatches a specialist agent, and returns or pauses the response for compliance review. Supporting capabilities include account and product data access, FAQ/RAG retrieval, persistent conversation state, and document ingestion. The graph preserves README-documented integrations; some subsystem links are based on README statements because their implementation was not sampled.

Main entry points: [`app/workflows/message_workflow.py`](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/workflows/message_workflow.py) (Message workflow), [`app/database.py`](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/database.py) (Database sessions), [`app/coordinator/agent_coordinator.py`](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/coordinator/agent_coordinator.py) (Agent coordinator), [`app/api/routes/messages.py`](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/api/routes/messages.py) (FastAPI routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client and API"]
  node_client["Streamlit client<br/>[streamlit_app.py]"]
  node_api["FastAPI routes<br/>[messages.py]"]
end

subgraph group_orchestration["Workflow and agents"]
  node_coordinator["Agent coordinator"]
  node_workflow["Message workflow"]
  node_agent_base["Agent foundation<br/>[base.py]"]
  node_intent["Intent classifier"]
  node_account_agent["Account agent<br/>[account_agent.py]"]
  node_general_agent["General agent<br/>[general_agent.py]"]
  node_human_agent["Human escalation<br/>[human_agent.py]"]
  node_product_agent["Product recommender"]
  node_compliance["FCA compliance"]
end

subgraph group_data["Support data"]
  node_relational[("Support records<br/>[customer.py]")]
  node_conversation[("Conversation state<br/>[conversation.py]")]
  node_product_model[("Financial products<br/>[product.py]")]
  node_database[("Database sessions<br/>[database.py]")]
end

subgraph group_platform["Runtime services"]
  node_security["Security and PII"]
  node_rag["RAG retrieval<br/>[rag_service.py]"]
  node_worker["Ingestion worker<br/>[worker.py]"]
end

subgraph group_integrations["External services"]
  node_groq{{"Groq inference"}}
  node_lakera{{"Lakera Guard"}}
  node_langfuse{{"Langfuse tracing"}}
  node_redis[("Redis cache")]
  node_celery["Celery workers"]
end

node_customer(("Customer"))
node_human_review(("Administrator review"))

node_customer -->|"submits query"| node_client
node_client -.->|"sends request"| node_api
node_api -->|"forwards message"| node_coordinator
node_coordinator -->|"runs workflow"| node_workflow
node_workflow -->|"checks prompt"| node_security
node_security -->|"checks injection"| node_lakera
node_workflow -->|"classifies intent"| node_intent
node_workflow -->|"dispatches account"| node_account_agent
node_workflow -->|"dispatches general"| node_general_agent
node_workflow -->|"dispatches escalation"| node_human_agent
node_workflow -->|"dispatches product"| node_product_agent
node_workflow -->|"checks recommendation"| node_compliance
node_compliance -->|"pauses for review"| node_human_review
node_workflow -->|"invokes inference"| node_groq
node_workflow -.->|"emits traces"| node_langfuse
node_general_agent -->|"retrieves knowledge"| node_rag
node_rag -->|"queries vectors"| node_database
node_worker -->|"ingests documents"| node_rag
node_worker -->|"runs background"| node_celery
node_account_agent -.->|"reads account data"| node_relational
node_product_agent -.->|"queries products"| node_product_model
node_coordinator -->|"persists conversation"| node_conversation
node_coordinator -->|"opens session"| node_database
node_database -.->|"stores records"| node_relational
node_database -.->|"stores state"| node_conversation
node_database -.->|"stores products"| node_product_model
node_api -.->|"triggers ingestion"| node_celery
node_general_agent -.->|"uses cache"| node_redis

click node_client "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/frontend/streamlit_app.py"
click node_api "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/api/routes/messages.py"
click node_coordinator "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/coordinator/agent_coordinator.py"
click node_workflow "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/workflows/message_workflow.py"
click node_agent_base "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/base.py"
click node_intent "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/intent_classifier.py"
click node_account_agent "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/account_agent.py"
click node_general_agent "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/general_agent.py"
click node_human_agent "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/human_agent.py"
click node_product_agent "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/product_recommender.py"
click node_compliance "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/compliance_checker.py"
click node_security "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/services/security_service.py"
click node_rag "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/services/rag_service.py"
click node_worker "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/worker.py"
click node_relational "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/models/customer.py"
click node_conversation "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/models/conversation.py"
click node_product_model "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/models/product.py"
click node_database "https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/database.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_client,node_api,node_human_review toneBlue
class node_coordinator,node_workflow,node_agent_base,node_intent,node_account_agent,node_general_agent,node_human_agent,node_product_agent,node_compliance toneAmber
class node_relational,node_conversation,node_product_model,node_database toneMint
class node_security,node_rag,node_worker toneRose
class node_groq,node_lakera,node_langfuse,node_redis,node_celery,node_customer toneIndigo
```

## Components

### Client and API

- [Streamlit client](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/frontend/streamlit_app.py): `frontend/streamlit_app.py`
- [FastAPI routes](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/api/routes/messages.py): `app/api/routes/messages.py`

### Workflow and agents

- [Agent coordinator](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/coordinator/agent_coordinator.py): `app/coordinator/agent_coordinator.py`
- [Message workflow](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/workflows/message_workflow.py): `app/workflows/message_workflow.py`
- [Agent foundation](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/base.py): `app/agents/base.py`
- [Intent classifier](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/intent_classifier.py): `app/agents/intent_classifier.py`
- [Account agent](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/account_agent.py): `app/agents/account_agent.py`
- [General agent](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/general_agent.py): `app/agents/general_agent.py`
- [Human escalation](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/human_agent.py): `app/agents/human_agent.py`
- [Product recommender](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/product_recommender.py): `app/agents/product_recommender.py`
- [FCA compliance](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/agents/compliance_checker.py): `app/agents/compliance_checker.py`

### Support data

- [Support records](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/models/customer.py): `app/models/customer.py`
- [Conversation state](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/models/conversation.py): `app/models/conversation.py`
- [Financial products](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/models/product.py): `app/models/product.py`
- [Database sessions](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/database.py): `app/database.py`

### Runtime services

- [Security and PII](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/services/security_service.py): `app/services/security_service.py`
- [RAG retrieval](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/services/rag_service.py): `app/services/rag_service.py`
- [Ingestion worker](https://github.com/davidsandeep1996-spec/fca-multi-agent-support/blob/main/app/worker.py): `app/worker.py`

### External services

- **Groq inference**
- **Lakera Guard**
- **Langfuse tracing**
- **Redis cache**
- **Celery workers**

### Other components

- **Customer**
- **Administrator review**

## Connections

- Customer → Streamlit client: submits query (evidence: `README.md`)
- Streamlit client → FastAPI routes: sends request
- FastAPI routes → Agent coordinator: forwards message (evidence: `app/api/routes/messages.py`)
- Agent coordinator → Message workflow: runs workflow (evidence: `app/coordinator/agent_coordinator.py`)
- Message workflow → Security and PII: checks prompt (evidence: `app/workflows/message_workflow.py`)
- Security and PII → Lakera Guard: checks injection (evidence: `app/services/security_service.py`)
- Message workflow → Intent classifier: classifies intent (evidence: `app/workflows/message_workflow.py`)
- Message workflow → Account agent: dispatches account (evidence: `app/workflows/message_workflow.py`)
- Message workflow → General agent: dispatches general (evidence: `app/workflows/message_workflow.py`)
- Message workflow → Human escalation: dispatches escalation (evidence: `app/workflows/message_workflow.py`)
- Message workflow → Product recommender: dispatches product (evidence: `app/workflows/message_workflow.py`)
- Message workflow → FCA compliance: checks recommendation (evidence: `app/workflows/message_workflow.py`)
- FCA compliance → Administrator review: pauses for review (evidence: `README.md`)
- Message workflow → Groq inference: invokes inference (evidence: `README.md`)
- Message workflow → Langfuse tracing: emits traces (evidence: `README.md`)
- General agent → RAG retrieval: retrieves knowledge (evidence: `app/agents/general_agent.py`)
- RAG retrieval → Database sessions: queries vectors (evidence: `app/services/rag_service.py`)
- Ingestion worker → RAG retrieval: ingests documents (evidence: `app/worker.py`)
- Ingestion worker → Celery workers: runs background (evidence: `README.md`)
- Account agent → Support records: reads account data
- Product recommender → Financial products: queries products
- Agent coordinator → Conversation state: persists conversation (evidence: `app/coordinator/agent_coordinator.py`)
- Agent coordinator → Database sessions: opens session (evidence: `app/coordinator/agent_coordinator.py`)
- Database sessions → Support records: stores records
- Database sessions → Conversation state: stores state
- Database sessions → Financial products: stores products
- FastAPI routes → Celery workers: triggers ingestion (evidence: `README.md`)
- General agent → Redis cache: uses cache (evidence: `app/agents/general_agent.py`)
