# sweta3304/resolvyn architecture

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

- Interactive diagram: https://gitdiagram.com/sweta3304/resolvyn
- Repository: https://github.com/sweta3304/resolvyn

## Overview

Resolvyn is a multichannel AI customer-support product: it understands a request, recalls relevant policy and prior cases, chooses a resolution, takes and verifies actions, and replies only with supported facts. Its team console exposes ticket progress and human controls; staff can teach fixes that become reusable memory. The README documents the product workflow and capabilities; sampled backend code confirms key memory, decision, ticket-state, context, and model layers, but not every route or reply-guard implementation.

Main entry points: [`backend/app/agents/base_agent.py`](https://github.com/sweta3304/resolvyn/blob/main/backend/app/agents/base_agent.py) (Department Agents), [`backend/app/decision_engine/decision_engine.py`](https://github.com/sweta3304/resolvyn/blob/main/backend/app/decision_engine/decision_engine.py) (Resolution Decision), [`backend/app/api`](https://github.com/sweta3304/resolvyn/tree/main/backend/app/api) (Channel APIs), [`backend/app/memory/memory_engine.py`](https://github.com/sweta3304/resolvyn/blob/main/backend/app/memory/memory_engine.py) (Memory Retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Customer and Team Experience"]
  node_console["Support Console<br/>[page.tsx]"]
  node_channels["Channel APIs"]
  node_voice["Voice Interface"]
  node_email["Email Service<br/>[email_service.py]"]
  node_analytics["Analytics Views<br/>[page.tsx]"]
end

subgraph group_understanding["Understand and Decide"]
  node_perception["Language Perception"]
  node_jev["Jev Judgment<br/>[jev.py]"]
  node_decision["Resolution Decision<br/>[decision_engine.py]"]
end

subgraph group_resolution["Resolve and Verify"]
  node_agents["Department Agents<br/>[base_agent.py]"]
  node_tools["Support Tools<br/>[tool_service.py]"]
  node_approval["Human Actions<br/>[human_service.py]"]
  node_ticket["Ticket State<br/>[ticket_engine.py]"]
  node_truth_guard["Truth Guard<br/>[conversation.py]"]
  node_context["Live Case Context<br/>[context_engine.py]"]
end

subgraph group_knowledge["Memory and Learning"]
  node_memory["Memory Retrieval<br/>[memory_engine.py]"]
  node_knowledge_ingest["Knowledge Ingestion<br/>[ingest.py]"]
  node_learning["Learning Service"]
end

subgraph group_platform["Runtime Platform"]
  node_realtime["Realtime Updates<br/>[realtime.py]"]
  node_database[("Application Database<br/>[database.py]")]
  node_model_api["Model Routing<br/>[router.py]"]
  node_model_engine["Local Model Tiers<br/>[model_manager.py]"]
end

node_customer(("Customer"))

node_customer -->|"contacts"| node_channels
node_channels -->|"submits request"| node_perception
node_perception -->|"extracts intent"| node_jev
node_jev -->|"writes query"| node_memory
node_memory -->|"supplies matches"| node_decision
node_decision -->|"chooses action"| node_agents
node_decision -->|"requests human gate"| node_approval
node_agents -->|"runs actions"| node_tools
node_tools -->|"returns confirmation"| node_agents
node_approval -->|"approves action"| node_agents
node_agents -->|"provides verified facts"| node_truth_guard
node_truth_guard -->|"sends verified reply"| node_customer
node_channels -->|"handles calls"| node_voice
node_customer -->|"emails support"| node_email
node_email -->|"sends summary"| node_customer
node_ticket -->|"persists state"| node_database
node_ticket -->|"broadcasts changes"| node_realtime
node_ticket -->|"refreshes case notes"| node_context
node_context -->|"pushes summaries"| node_realtime
node_knowledge_ingest -.->|"indexes knowledge"| node_memory
node_approval -->|"teaches fix"| node_learning
node_learning -->|"adds reusable memory"| node_memory
node_console -.->|"operates support"| node_channels
node_console -.->|"views metrics"| node_analytics
node_model_api -->|"uses local tiers"| node_model_engine
node_decision -->|"checks grounding"| node_model_api
node_customer -.->|"team observes progress"| node_console

click node_console "https://github.com/sweta3304/resolvyn/blob/main/frontend/app/ops/overview/page.tsx"
click node_channels "https://github.com/sweta3304/resolvyn/tree/main/backend/app/api"
click node_voice "https://github.com/sweta3304/resolvyn/tree/main/backend/app/voice"
click node_email "https://github.com/sweta3304/resolvyn/blob/main/backend/app/services/email_service.py"
click node_perception "https://github.com/sweta3304/resolvyn/blob/main/backend/app/perception/perception_service.py"
click node_jev "https://github.com/sweta3304/resolvyn/blob/main/backend/app/judgment/jev.py"
click node_memory "https://github.com/sweta3304/resolvyn/blob/main/backend/app/memory/memory_engine.py"
click node_knowledge_ingest "https://github.com/sweta3304/resolvyn/blob/main/backend/app/memory/ingest.py"
click node_decision "https://github.com/sweta3304/resolvyn/blob/main/backend/app/decision_engine/decision_engine.py"
click node_agents "https://github.com/sweta3304/resolvyn/blob/main/backend/app/agents/base_agent.py"
click node_tools "https://github.com/sweta3304/resolvyn/blob/main/backend/app/tools/tool_service.py"
click node_approval "https://github.com/sweta3304/resolvyn/blob/main/backend/app/human_intelligence/human_service.py"
click node_ticket "https://github.com/sweta3304/resolvyn/blob/main/backend/app/services/ticket_engine.py"
click node_truth_guard "https://github.com/sweta3304/resolvyn/blob/main/backend/app/services/conversation.py"
click node_context "https://github.com/sweta3304/resolvyn/blob/main/backend/app/context_engine/context_engine.py"
click node_learning "https://github.com/sweta3304/resolvyn/blob/main/backend/app/learning/learning_service.py"
click node_realtime "https://github.com/sweta3304/resolvyn/blob/main/backend/app/realtime.py"
click node_database "https://github.com/sweta3304/resolvyn/blob/main/backend/app/database.py"
click node_model_api "https://github.com/sweta3304/resolvyn/blob/main/backend/app/llm/router.py"
click node_model_engine "https://github.com/sweta3304/resolvyn/blob/main/engine/backend/tiers/model_manager.py"
click node_analytics "https://github.com/sweta3304/resolvyn/blob/main/frontend/app/analytics/page.tsx"

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_console,node_channels,node_voice,node_email,node_analytics toneBlue
class node_perception,node_jev,node_decision toneAmber
class node_agents,node_tools,node_approval,node_ticket,node_truth_guard,node_context toneMint
class node_memory,node_knowledge_ingest,node_learning toneRose
class node_realtime,node_database,node_model_api,node_model_engine,node_customer toneIndigo
```

## Components

### Customer and Team Experience

- [Support Console](https://github.com/sweta3304/resolvyn/blob/main/frontend/app/ops/overview/page.tsx): `frontend/app/ops/overview/page.tsx`
- [Channel APIs](https://github.com/sweta3304/resolvyn/tree/main/backend/app/api): `backend/app/api`
- [Voice Interface](https://github.com/sweta3304/resolvyn/tree/main/backend/app/voice): `backend/app/voice`
- [Email Service](https://github.com/sweta3304/resolvyn/blob/main/backend/app/services/email_service.py): `backend/app/services/email_service.py`
- [Analytics Views](https://github.com/sweta3304/resolvyn/blob/main/frontend/app/analytics/page.tsx): `frontend/app/analytics/page.tsx`

### Understand and Decide

- [Language Perception](https://github.com/sweta3304/resolvyn/blob/main/backend/app/perception/perception_service.py): `backend/app/perception/perception_service.py`
- [Jev Judgment](https://github.com/sweta3304/resolvyn/blob/main/backend/app/judgment/jev.py): `backend/app/judgment/jev.py`
- [Resolution Decision](https://github.com/sweta3304/resolvyn/blob/main/backend/app/decision_engine/decision_engine.py): `backend/app/decision_engine/decision_engine.py`

### Resolve and Verify

- [Department Agents](https://github.com/sweta3304/resolvyn/blob/main/backend/app/agents/base_agent.py): `backend/app/agents/base_agent.py`
- [Support Tools](https://github.com/sweta3304/resolvyn/blob/main/backend/app/tools/tool_service.py): `backend/app/tools/tool_service.py`
- [Human Actions](https://github.com/sweta3304/resolvyn/blob/main/backend/app/human_intelligence/human_service.py): `backend/app/human_intelligence/human_service.py`
- [Ticket State](https://github.com/sweta3304/resolvyn/blob/main/backend/app/services/ticket_engine.py): `backend/app/services/ticket_engine.py`
- [Truth Guard](https://github.com/sweta3304/resolvyn/blob/main/backend/app/services/conversation.py): `backend/app/services/conversation.py`
- [Live Case Context](https://github.com/sweta3304/resolvyn/blob/main/backend/app/context_engine/context_engine.py): `backend/app/context_engine/context_engine.py`

### Memory and Learning

- [Memory Retrieval](https://github.com/sweta3304/resolvyn/blob/main/backend/app/memory/memory_engine.py): `backend/app/memory/memory_engine.py`
- [Knowledge Ingestion](https://github.com/sweta3304/resolvyn/blob/main/backend/app/memory/ingest.py): `backend/app/memory/ingest.py`
- [Learning Service](https://github.com/sweta3304/resolvyn/blob/main/backend/app/learning/learning_service.py): `backend/app/learning/learning_service.py`

### Runtime Platform

- [Realtime Updates](https://github.com/sweta3304/resolvyn/blob/main/backend/app/realtime.py): `backend/app/realtime.py`
- [Application Database](https://github.com/sweta3304/resolvyn/blob/main/backend/app/database.py): `backend/app/database.py`
- [Model Routing](https://github.com/sweta3304/resolvyn/blob/main/backend/app/llm/router.py): `backend/app/llm/router.py`
- [Local Model Tiers](https://github.com/sweta3304/resolvyn/blob/main/engine/backend/tiers/model_manager.py): `engine/backend/tiers/model_manager.py`

### Other components

- **Customer**

## Connections

- Customer → Channel APIs: contacts
- Channel APIs → Language Perception: submits request
- Language Perception → Jev Judgment: extracts intent
- Jev Judgment → Memory Retrieval: writes query (evidence: `backend/app/memory/memory_engine.py`)
- Memory Retrieval → Resolution Decision: supplies matches (evidence: `backend/app/memory/memory_engine.py`)
- Resolution Decision → Department Agents: chooses action (evidence: `backend/app/decision_engine/decision_engine.py`)
- Resolution Decision → Human Actions: requests human gate
- Department Agents → Support Tools: runs actions (evidence: `backend/app/agents/base_agent.py`)
- Support Tools → Department Agents: returns confirmation (evidence: `backend/app/agents/base_agent.py`)
- Human Actions → Department Agents: approves action
- Department Agents → Truth Guard: provides verified facts
- Truth Guard → Customer: sends verified reply
- Channel APIs → Voice Interface: handles calls
- Customer → Email Service: emails support
- Email Service → Customer: sends summary
- Ticket State → Application Database: persists state (evidence: `backend/app/services/ticket_engine.py`)
- Ticket State → Realtime Updates: broadcasts changes (evidence: `backend/app/services/ticket_engine.py`)
- Ticket State → Live Case Context: refreshes case notes (evidence: `backend/app/context_engine/context_engine.py`)
- Live Case Context → Realtime Updates: pushes summaries (evidence: `backend/app/context_engine/context_engine.py`)
- Knowledge Ingestion → Memory Retrieval: indexes knowledge
- Human Actions → Learning Service: teaches fix (evidence: `backend/app/human_intelligence/human_service.py`)
- Learning Service → Memory Retrieval: adds reusable memory
- Support Console → Channel APIs: operates support
- Support Console → Analytics Views: views metrics
- Model Routing → Local Model Tiers: uses local tiers
- Resolution Decision → Model Routing: checks grounding (evidence: `backend/app/decision_engine/decision_engine.py`)
- Customer → Support Console: team observes progress
