# chaitanyareddykarri/ryvix architecture

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

- Interactive diagram: https://gitdiagram.com/chaitanyareddykarri/ryvix
- Repository: https://github.com/chaitanyareddykarri/ryvix

## Overview

Ryvix is a tenant-scoped software and infrastructure operations platform. Its main coding workflow runs from a user task through isolated workspace changes and checks, preview/diff review, and approved PR and release steps. Separate capabilities provide persisted, retrieval-augmented chat; reviewed learning; server telemetry and approved operations; and Gmail/WhatsApp channels. The README documents these product flows, while sampled source confirms selected chat, repository-context, workspace, and device-protocol behavior. Several listed subsystems were not sampled, so their links rely on README statements rather than inspected call sites.

Main entry points: [`web/app/api/chat/route.ts`](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/chat/route.ts) (Chat API), [`web/app/api/tasks/route.ts`](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/tasks/route.ts) (Task API), [`services/src/workspace/repository-worker.ts`](https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/repository-worker.ts) (Workspace worker), [`web/app`](https://github.com/chaitanyareddykarri/ryvix/tree/main/web/app) (Ryvix UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and tenant API"]
  node_webapp["Ryvix UI"]
  node_taskapi["Task API<br/>[route.ts]"]
  node_chatapi["Chat API<br/>[route.ts]"]
  node_serversapi["Servers API<br/>[route.ts]"]
end

subgraph group_coding["Coding workflow"]
  node_taskstore[("Task repository<br/>[task.repository.ts]")]
  node_jobstore[("Repository job store")]
  node_worker["Workspace worker"]
  node_repoctx["Repository context"]
  node_workspace["Isolated workspace"]
  node_preview["Preview and diff<br/>[route.ts]"]
  node_pr["PR and release<br/>[pr.service.ts]"]
end

subgraph group_intelligence["Chat and learning"]
  node_chatcontext["Chat context<br/>[context-builder.ts]"]
  node_repochat["Repository chat context"]
  node_knowledge[("Repository knowledge")]
  node_conversation[("Conversation store")]
  node_learning[("Reviewed learning")]
end

subgraph group_operations["Server operations"]
  node_agent["Device agent<br/>[main.go]"]
  node_telemetry["Telemetry ingestion<br/>[device-protocol.ts]"]
  node_security["Security analysis"]
  node_approvedops[("Approved operations")]
end

subgraph group_channels["Channels and notifications"]
  node_gmail["Gmail channel<br/>[gmail.connector.ts]"]
  node_whatsapp["WhatsApp assistant"]
  node_notifications["Email notifications"]
end

node_user(("User"))

node_user -->|"uses"| node_webapp
node_webapp -->|"submits tasks"| node_taskapi
node_taskapi -->|"creates jobs"| node_jobstore
node_jobstore -->|"claims jobs"| node_worker
node_worker -->|"builds context"| node_repoctx
node_worker -->|"runs workspace"| node_workspace
node_workspace -->|"provides preview"| node_preview
node_user -->|"reviews diff"| node_preview
node_user -->|"approves release"| node_pr
node_user -->|"asks"| node_chatapi
node_chatapi -->|"sanitizes context"| node_chatcontext
node_chatapi -->|"persists conversation"| node_conversation
node_chatapi -->|"loads repository context"| node_repochat
node_repochat -->|"searches knowledge"| node_knowledge
node_chatapi -->|"retrieves lessons"| node_learning
node_agent -->|"reports telemetry"| node_telemetry
node_serversapi -->|"enrolls device"| node_agent
node_telemetry -.->|"analyzes events"| node_security
node_user -->|"approves operations"| node_approvedops
node_gmail -->|"proposes tasks"| node_taskapi
node_user -->|"chats opt-in"| node_whatsapp
node_whatsapp -->|"requests coding tasks"| node_taskapi
node_pr -->|"sends approved results"| node_notifications

click node_webapp "https://github.com/chaitanyareddykarri/ryvix/tree/main/web/app"
click node_taskapi "https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/tasks/route.ts"
click node_chatapi "https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/chat/route.ts"
click node_serversapi "https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/servers/route.ts"
click node_taskstore "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/repositories/task.repository.ts"
click node_jobstore "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/repository-job-store.ts"
click node_worker "https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/repository-worker.ts"
click node_repoctx "https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/repository-context.ts"
click node_workspace "https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/docker-workspace.manager.ts"
click node_preview "https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/workspace/%5BsessionId%5D/preview/route.ts"
click node_pr "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/pr.service.ts"
click node_chatcontext "https://github.com/chaitanyareddykarri/ryvix/blob/main/ai/src/context/context-builder.ts"
click node_repochat "https://github.com/chaitanyareddykarri/ryvix/blob/main/web/utils/repository-chat-context.ts"
click node_knowledge "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/repository-knowledge.ts"
click node_conversation "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/conversation-store.ts"
click node_learning "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/experience-store.ts"
click node_agent "https://github.com/chaitanyareddykarri/ryvix/blob/main/agent/cmd/ryvix-agent/main.go"
click node_telemetry "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/device-protocol.ts"
click node_security "https://github.com/chaitanyareddykarri/ryvix/blob/main/ai/src/local-security-engine.ts"
click node_approvedops "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/server-command-store.ts"
click node_gmail "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/connectors/gmail.connector.ts"
click node_whatsapp "https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/whatsapp-assistant.ts"
click node_notifications "https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/communication/email-notifications.ts"

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_webapp,node_taskapi,node_chatapi,node_serversapi,node_user toneBlue
class node_taskstore,node_jobstore,node_worker,node_repoctx,node_workspace,node_preview,node_pr toneAmber
class node_chatcontext,node_repochat,node_knowledge,node_conversation,node_learning toneMint
class node_agent,node_telemetry,node_security,node_approvedops toneRose
class node_gmail,node_whatsapp,node_notifications toneIndigo
```

## Components

### Web and tenant API

- [Ryvix UI](https://github.com/chaitanyareddykarri/ryvix/tree/main/web/app): `web/app`
- [Task API](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/tasks/route.ts): `web/app/api/tasks/route.ts`
- [Chat API](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/chat/route.ts): `web/app/api/chat/route.ts`
- [Servers API](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/servers/route.ts): `web/app/api/servers/route.ts`

### Coding workflow

- [Task repository](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/repositories/task.repository.ts): `backend/src/repositories/task.repository.ts`
- [Repository job store](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/repository-job-store.ts): `backend/src/services/repository-job-store.ts`
- [Workspace worker](https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/repository-worker.ts): `services/src/workspace/repository-worker.ts`
- [Repository context](https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/repository-context.ts): `services/src/workspace/repository-context.ts`
- [Isolated workspace](https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/workspace/docker-workspace.manager.ts): `services/src/workspace/docker-workspace.manager.ts`
- [Preview and diff](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/app/api/workspace/%5BsessionId%5D/preview/route.ts): `web/app/api/workspace/[sessionId]/preview/route.ts`
- [PR and release](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/pr.service.ts): `backend/src/services/pr.service.ts`

### Chat and learning

- [Chat context](https://github.com/chaitanyareddykarri/ryvix/blob/main/ai/src/context/context-builder.ts): `ai/src/context/context-builder.ts`
- [Repository chat context](https://github.com/chaitanyareddykarri/ryvix/blob/main/web/utils/repository-chat-context.ts): `web/utils/repository-chat-context.ts`
- [Repository knowledge](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/repository-knowledge.ts): `backend/src/services/repository-knowledge.ts`
- [Conversation store](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/conversation-store.ts): `backend/src/services/conversation-store.ts`
- [Reviewed learning](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/experience-store.ts): `backend/src/services/experience-store.ts`

### Server operations

- [Device agent](https://github.com/chaitanyareddykarri/ryvix/blob/main/agent/cmd/ryvix-agent/main.go): `agent/cmd/ryvix-agent/main.go`
- [Telemetry ingestion](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/device-protocol.ts): `backend/src/services/device-protocol.ts`
- [Security analysis](https://github.com/chaitanyareddykarri/ryvix/blob/main/ai/src/local-security-engine.ts): `ai/src/local-security-engine.ts`
- [Approved operations](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/server-command-store.ts): `backend/src/services/server-command-store.ts`

### Channels and notifications

- [Gmail channel](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/connectors/gmail.connector.ts): `backend/src/connectors/gmail.connector.ts`
- [WhatsApp assistant](https://github.com/chaitanyareddykarri/ryvix/blob/main/backend/src/services/whatsapp-assistant.ts): `backend/src/services/whatsapp-assistant.ts`
- [Email notifications](https://github.com/chaitanyareddykarri/ryvix/blob/main/services/src/communication/email-notifications.ts): `services/src/communication/email-notifications.ts`

### Other components

- **User**

## Connections

- User → Ryvix UI: uses (evidence: `README.md`)
- Ryvix UI → Task API: submits tasks (evidence: `README.md`)
- Task API → Repository job store: creates jobs (evidence: `web/app/api/tasks/route.ts`)
- Repository job store → Workspace worker: claims jobs (evidence: `README.md`)
- Workspace worker → Repository context: builds context (evidence: `README.md`)
- Workspace worker → Isolated workspace: runs workspace (evidence: `README.md`)
- Isolated workspace → Preview and diff: provides preview (evidence: `README.md`)
- User → Preview and diff: reviews diff (evidence: `README.md`)
- User → PR and release: approves release (evidence: `README.md`)
- User → Chat API: asks (evidence: `README.md`)
- Chat API → Chat context: sanitizes context (evidence: `web/app/api/chat/route.ts`)
- Chat API → Conversation store: persists conversation (evidence: `web/app/api/chat/route.ts`)
- Chat API → Repository chat context: loads repository context (evidence: `web/app/api/chat/route.ts`)
- Repository chat context → Repository knowledge: searches knowledge (evidence: `web/utils/repository-chat-context.ts`)
- Chat API → Reviewed learning: retrieves lessons (evidence: `web/app/api/chat/route.ts`)
- Device agent → Telemetry ingestion: reports telemetry (evidence: `README.md`)
- Servers API → Device agent: enrolls device (evidence: `README.md`)
- Telemetry ingestion → Security analysis: analyzes events
- User → Approved operations: approves operations (evidence: `README.md`)
- Gmail channel → Task API: proposes tasks (evidence: `README.md`)
- User → WhatsApp assistant: chats opt-in (evidence: `README.md`)
- WhatsApp assistant → Task API: requests coding tasks (evidence: `README.md`)
- PR and release → Email notifications: sends approved results (evidence: `README.md`)
