# harrish4693/resolveai architecture

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

- Interactive diagram: https://gitdiagram.com/harrish4693/resolveai
- Repository: https://github.com/harrish4693/resolveai

## Overview

ResolveAI is a multilingual customer-support system. Customers submit text or audio through the demo UI; the API transcribes audio when needed and sends text to the agent. The agent detects language, cleans and classifies the query, retrieves policy or ticket context through tools, and returns a response while recording support tickets and conversations. Separate ingestion builds the retrieval index from policy documents and sample tickets. The graph preserves documented voice, retrieval, escalation, ticket-history, and health/reindex capabilities; unsampled implementation details are omitted where their call paths cannot be verified.

Main entry points: [`app/agent/react_agent.py`](https://github.com/harrish4693/resolveai/blob/main/app/agent/react_agent.py) (ReAct workflow), [`app/main.py`](https://github.com/harrish4693/resolveai/blob/main/app/main.py) (Support API), [`app/rag/ingest.py`](https://github.com/harrish4693/resolveai/blob/main/app/rag/ingest.py) (Index ingestion), [`app/db/crud.py`](https://github.com/harrish4693/resolveai/blob/main/app/db/crud.py) (Ticket operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and interface"]
  node_demo_ui["Demo UI<br/>[streamlit_app.py]"]
  node_api["Support API<br/>[main.py]"]
  node_speech["Speech transcription<br/>[stt.py]"]
end

subgraph group_agent["Query handling"]
  node_agent_runtime["ReAct workflow<br/>[react_agent.py]"]
  node_language["Language detection<br/>[lang_detect.py]"]
  node_text_cleanup["Text preprocessing<br/>[preprocess.py]"]
  node_classification["Intent and sentiment"]
  node_escalation["Priority escalation<br/>[escalation.py]"]
  node_agent_tools["Agent tools<br/>[tools.py]"]
end

subgraph group_knowledge["Knowledge retrieval"]
  node_ingestion["Index ingestion<br/>[ingest.py]"]
  node_policy_docs["Policy knowledge base"]
  node_sample_tickets["Sample tickets<br/>[sample_tickets.csv]"]
  node_retrieval["Vector retrieval<br/>[embed_store.py]"]
  node_vector_index[("FAISS index")]
end

subgraph group_records["Ticket records"]
  node_ticket_crud["Ticket operations<br/>[crud.py]"]
  node_ticket_models["Ticket data model<br/>[models.py]"]
  node_ticket_store[("Ticket database")]
end

subgraph group_platform["Model and configuration"]
  node_llm_generation["LLM generation<br/>[generate.py]"]
  node_llm_provider["LLM provider"]
  node_configuration["Application settings<br/>[config.py]"]
end

node_customer(("Customer"))

node_customer -->|"submits query"| node_demo_ui
node_demo_ui -->|"calls API"| node_api
node_api -->|"transcribes audio"| node_speech
node_api -->|"runs workflow"| node_agent_runtime
node_api -->|"serves ticket queries"| node_ticket_crud
node_api -->|"rebuilds index"| node_retrieval
node_api -->|"exposes ingestion"| node_ingestion
node_agent_runtime -->|"detects language"| node_language
node_agent_runtime -->|"cleans query"| node_text_cleanup
node_agent_runtime -->|"analyzes query"| node_classification
node_agent_runtime -->|"gets LLM"| node_llm_generation
node_agent_runtime -->|"assesses priority"| node_escalation
node_agent_runtime -->|"registers tools"| node_agent_tools
node_agent_runtime -->|"records tickets"| node_ticket_crud
node_agent_tools -->|"searches context"| node_retrieval
node_agent_tools -->|"looks up tickets"| node_ticket_crud
node_ingestion -->|"loads documents"| node_policy_docs
node_ingestion -->|"loads examples"| node_sample_tickets
node_ingestion -->|"builds index"| node_vector_index
node_retrieval -.->|"searches index"| node_vector_index
node_llm_generation -.->|"invokes model"| node_llm_provider
node_configuration -->|"configures model"| node_llm_generation
node_configuration -->|"configures database"| node_ticket_models
node_ticket_crud -->|"queries models"| node_ticket_models
node_ticket_models -->|"persists records"| node_ticket_store

click node_demo_ui "https://github.com/harrish4693/resolveai/blob/main/ui/streamlit_app.py"
click node_api "https://github.com/harrish4693/resolveai/blob/main/app/main.py"
click node_speech "https://github.com/harrish4693/resolveai/blob/main/app/voice/stt.py"
click node_agent_runtime "https://github.com/harrish4693/resolveai/blob/main/app/agent/react_agent.py"
click node_language "https://github.com/harrish4693/resolveai/blob/main/app/nlp/lang_detect.py"
click node_text_cleanup "https://github.com/harrish4693/resolveai/blob/main/app/nlp/preprocess.py"
click node_classification "https://github.com/harrish4693/resolveai/blob/main/app/nlp/intent_sentiment.py"
click node_escalation "https://github.com/harrish4693/resolveai/blob/main/app/priority/escalation.py"
click node_agent_tools "https://github.com/harrish4693/resolveai/blob/main/app/agent/tools.py"
click node_ingestion "https://github.com/harrish4693/resolveai/blob/main/app/rag/ingest.py"
click node_policy_docs "https://github.com/harrish4693/resolveai/tree/main/data/knowledge_base"
click node_sample_tickets "https://github.com/harrish4693/resolveai/blob/main/data/sample_tickets.csv"
click node_retrieval "https://github.com/harrish4693/resolveai/blob/main/app/rag/embed_store.py"
click node_llm_generation "https://github.com/harrish4693/resolveai/blob/main/app/llm/generate.py"
click node_configuration "https://github.com/harrish4693/resolveai/blob/main/app/config.py"
click node_ticket_crud "https://github.com/harrish4693/resolveai/blob/main/app/db/crud.py"
click node_ticket_models "https://github.com/harrish4693/resolveai/blob/main/app/db/models.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_demo_ui,node_api,node_speech toneBlue
class node_agent_runtime,node_language,node_text_cleanup,node_classification,node_escalation,node_agent_tools toneAmber
class node_ingestion,node_policy_docs,node_sample_tickets,node_retrieval,node_vector_index toneMint
class node_ticket_crud,node_ticket_models,node_ticket_store toneRose
class node_llm_generation,node_llm_provider,node_configuration,node_customer toneIndigo
```

## Components

### Entry and interface

- [Demo UI](https://github.com/harrish4693/resolveai/blob/main/ui/streamlit_app.py): `ui/streamlit_app.py`
- [Support API](https://github.com/harrish4693/resolveai/blob/main/app/main.py): `app/main.py`
- [Speech transcription](https://github.com/harrish4693/resolveai/blob/main/app/voice/stt.py): `app/voice/stt.py`

### Query handling

- [ReAct workflow](https://github.com/harrish4693/resolveai/blob/main/app/agent/react_agent.py): `app/agent/react_agent.py`
- [Language detection](https://github.com/harrish4693/resolveai/blob/main/app/nlp/lang_detect.py): `app/nlp/lang_detect.py`
- [Text preprocessing](https://github.com/harrish4693/resolveai/blob/main/app/nlp/preprocess.py): `app/nlp/preprocess.py`
- [Intent and sentiment](https://github.com/harrish4693/resolveai/blob/main/app/nlp/intent_sentiment.py): `app/nlp/intent_sentiment.py`
- [Priority escalation](https://github.com/harrish4693/resolveai/blob/main/app/priority/escalation.py): `app/priority/escalation.py`
- [Agent tools](https://github.com/harrish4693/resolveai/blob/main/app/agent/tools.py): `app/agent/tools.py`

### Knowledge retrieval

- [Index ingestion](https://github.com/harrish4693/resolveai/blob/main/app/rag/ingest.py): `app/rag/ingest.py`
- [Policy knowledge base](https://github.com/harrish4693/resolveai/tree/main/data/knowledge_base): `data/knowledge_base`
- [Sample tickets](https://github.com/harrish4693/resolveai/blob/main/data/sample_tickets.csv): `data/sample_tickets.csv`
- [Vector retrieval](https://github.com/harrish4693/resolveai/blob/main/app/rag/embed_store.py): `app/rag/embed_store.py`
- **FAISS index**

### Ticket records

- [Ticket operations](https://github.com/harrish4693/resolveai/blob/main/app/db/crud.py): `app/db/crud.py`
- [Ticket data model](https://github.com/harrish4693/resolveai/blob/main/app/db/models.py): `app/db/models.py`
- **Ticket database**

### Model and configuration

- [LLM generation](https://github.com/harrish4693/resolveai/blob/main/app/llm/generate.py): `app/llm/generate.py`
- **LLM provider**
- [Application settings](https://github.com/harrish4693/resolveai/blob/main/app/config.py): `app/config.py`

### Other components

- **Customer**

## Connections

- Customer → Demo UI: submits query (evidence: `README.md`)
- Demo UI → Support API: calls API (evidence: `ui/streamlit_app.py`)
- Support API → Speech transcription: transcribes audio (evidence: `app/main.py`)
- Support API → ReAct workflow: runs workflow (evidence: `app/main.py`)
- Support API → Ticket operations: serves ticket queries (evidence: `app/main.py`)
- Support API → Vector retrieval: rebuilds index (evidence: `app/main.py`)
- Support API → Index ingestion: exposes ingestion (evidence: `app/main.py`)
- ReAct workflow → Language detection: detects language (evidence: `app/agent/react_agent.py`)
- ReAct workflow → Text preprocessing: cleans query (evidence: `app/agent/react_agent.py`)
- ReAct workflow → Intent and sentiment: analyzes query (evidence: `app/agent/react_agent.py`)
- ReAct workflow → LLM generation: gets LLM (evidence: `app/agent/react_agent.py`)
- ReAct workflow → Priority escalation: assesses priority (evidence: `app/agent/react_agent.py`)
- ReAct workflow → Agent tools: registers tools (evidence: `app/agent/react_agent.py`)
- ReAct workflow → Ticket operations: records tickets (evidence: `app/agent/react_agent.py`)
- Agent tools → Vector retrieval: searches context (evidence: `app/agent/tools.py`)
- Agent tools → Ticket operations: looks up tickets (evidence: `app/agent/tools.py`)
- Index ingestion → Policy knowledge base: loads documents (evidence: `app/rag/ingest.py`)
- Index ingestion → Sample tickets: loads examples (evidence: `app/rag/ingest.py`)
- Index ingestion → FAISS index: builds index (evidence: `app/rag/ingest.py`)
- Vector retrieval → FAISS index: searches index
- LLM generation → LLM provider: invokes model
- Application settings → LLM generation: configures model (evidence: `app/llm/generate.py`)
- Application settings → Ticket data model: configures database (evidence: `app/db/models.py`)
- Ticket operations → Ticket data model: queries models (evidence: `app/db/crud.py`)
- Ticket data model → Ticket database: persists records (evidence: `app/db/models.py`)
