# baddamakshaya01-star/customer-support architecture

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

- Interactive diagram: https://gitdiagram.com/baddamakshaya01-star/customer-support
- Repository: https://github.com/baddamakshaya01-star/customer-support

## Overview

RecallDesk is an AI customer-support console backed by a FastAPI service. An agent uses customer context, tickets, and recalled memories to answer each customer message, then evaluates whether to escalate and extracts new memories and frustration data. The console also supports customer, ticket, escalation, and analytics views. Persistent customer and ticket records use SQLite; conversational memory optionally uses Hindsight, and response generation uses a configured language-model provider. The README documents the REST-backed frontend workflow; unsampled endpoint and UI details are represented only at subsystem level.

Main entry points: [`backend/main.py`](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/main.py) (REST API), [`backend/services/agent_service.py`](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/agent_service.py) (Support Agent), [`backend/services/memory_service.py`](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/memory_service.py) (Memory Service), [`frontend/app.js`](https://github.com/baddamakshaya01-star/customer-support/blob/main/frontend/app.js) (Console UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Support Console"]
  node_frontend["Console UI<br/>[app.js]"]
  node_console_views["Console Views<br/>[app.js]"]
end

subgraph group_api["API and Domain"]
  node_api_service["REST API<br/>[main.py]"]
  node_schemas["API Schemas<br/>[models.py]"]
end

subgraph group_agent["Agent Workflow"]
  node_agent["Support Agent<br/>[agent_service.py]"]
  node_prompt["Context Prompts<br/>[prompts.py]"]
  node_escalation["Escalation Rules"]
  node_llm_service["LLM Service<br/>[llm_service.py]"]
end

subgraph group_persistence["Persistence and Providers"]
  node_memory["Memory Service<br/>[memory_service.py]"]
  node_sql_store[("SQLite Records<br/>[database.py]")]
  node_hindsight[("Hindsight Memory")]
end

node_user(("Support User"))
node_llm_provider{{"LLM Provider"}}

node_user -->|"uses"| node_frontend
node_frontend -->|"sends REST requests"| node_api_service
node_api_service -->|"validates payloads"| node_schemas
node_api_service -->|"requests response"| node_agent
node_api_service -->|"loads and saves context"| node_memory
node_api_service -->|"initializes and queries"| node_sql_store
node_agent -->|"fetches and updates memory"| node_memory
node_agent -->|"builds context prompt"| node_prompt
node_agent -->|"generates and extracts"| node_llm_service
node_agent -->|"checks handoff"| node_escalation
node_llm_service -->|"calls completions"| node_llm_provider
node_memory -->|"reads and updates records"| node_sql_store
node_memory -.->|"retains and recalls"| node_hindsight
node_frontend -->|"renders console"| node_console_views
node_console_views -->|"loads console data"| node_api_service

click node_frontend "https://github.com/baddamakshaya01-star/customer-support/blob/main/frontend/app.js"
click node_api_service "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/main.py"
click node_schemas "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/models.py"
click node_agent "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/agent_service.py"
click node_prompt "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/prompts.py"
click node_escalation "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/escalation_service.py"
click node_memory "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/memory_service.py"
click node_sql_store "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/database.py"
click node_llm_service "https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/llm_service.py"
click node_console_views "https://github.com/baddamakshaya01-star/customer-support/blob/main/frontend/app.js"

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_frontend,node_console_views,node_user toneBlue
class node_api_service,node_schemas toneAmber
class node_agent,node_prompt,node_escalation,node_llm_service toneMint
class node_memory,node_sql_store,node_hindsight toneRose
class node_llm_provider toneIndigo
```

## Components

### Support Console

- [Console UI](https://github.com/baddamakshaya01-star/customer-support/blob/main/frontend/app.js): `frontend/app.js`
- [Console Views](https://github.com/baddamakshaya01-star/customer-support/blob/main/frontend/app.js): `frontend/app.js`

### API and Domain

- [REST API](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/main.py): `backend/main.py`
- [API Schemas](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/models.py): `backend/models.py`

### Agent Workflow

- [Support Agent](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/agent_service.py): `backend/services/agent_service.py`
- [Context Prompts](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/prompts.py): `backend/services/prompts.py`
- [Escalation Rules](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/escalation_service.py): `backend/services/escalation_service.py`
- [LLM Service](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/llm_service.py): `backend/services/llm_service.py`

### Persistence and Providers

- [Memory Service](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/services/memory_service.py): `backend/services/memory_service.py`
- [SQLite Records](https://github.com/baddamakshaya01-star/customer-support/blob/main/backend/database.py): `backend/database.py`
- **Hindsight Memory**

### Other components

- **Support User**
- **LLM Provider**

## Connections

- Support User → Console UI: uses (evidence: `README.md`)
- Console UI → REST API: sends REST requests (evidence: `README.md`)
- REST API → API Schemas: validates payloads (evidence: `backend/main.py`)
- REST API → Support Agent: requests response (evidence: `backend/main.py`)
- REST API → Memory Service: loads and saves context (evidence: `backend/main.py`)
- REST API → SQLite Records: initializes and queries (evidence: `backend/main.py`)
- Support Agent → Memory Service: fetches and updates memory (evidence: `backend/services/agent_service.py`)
- Support Agent → Context Prompts: builds context prompt (evidence: `backend/services/agent_service.py`)
- Support Agent → LLM Service: generates and extracts (evidence: `backend/services/agent_service.py`)
- Support Agent → Escalation Rules: checks handoff (evidence: `backend/services/agent_service.py`)
- LLM Service → LLM Provider: calls completions (evidence: `backend/services/llm_service.py`)
- Memory Service → SQLite Records: reads and updates records (evidence: `backend/services/memory_service.py`)
- Memory Service → Hindsight Memory: retains and recalls (evidence: `backend/services/memory_service.py`)
- Console UI → Console Views: renders console (evidence: `frontend/app.js`)
- Console Views → REST API: loads console data (evidence: `frontend/app.js`)
