# caprichooms/capricore architecture

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

- Interactive diagram: https://gitdiagram.com/caprichooms/capricore
- Repository: https://github.com/caprichooms/capricore

## Overview

CapriCore is a Windows AI desktop companion. The main user workflow is to submit a message in the desktop UI, have the chat service handle the conversation using a configured inference provider and optional tools, then display the reply and optionally speak it. Separate capabilities include memory and knowledge, voice, music and call audio, and desktop presence. The README documents these product branches; sampled source supports selected internal dependencies, but the renderer-to-service wiring and several subsystems were not inspected.

Main entry points: [`apps/desktop/chat-service.mjs`](https://github.com/caprichooms/capricore/blob/main/apps/desktop/chat-service.mjs) (Chat Service), [`apps/desktop/renderer/app.js`](https://github.com/caprichooms/capricore/blob/main/apps/desktop/renderer/app.js) (Desktop UI), [`apps/desktop/voice-service.mjs`](https://github.com/caprichooms/capricore/blob/main/apps/desktop/voice-service.mjs) (Voice Service), [`apps/desktop/music-listening-service.mjs`](https://github.com/caprichooms/capricore/blob/main/apps/desktop/music-listening-service.mjs) (Music Detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation"]
  node_chat["Chat Service<br/>[chat-service.mjs]"]
  node_request_router["Request Router<br/>[request-router.mjs]"]
  node_gateway["OpenClaw Gateway"]
end

subgraph group_models["Inference"]
  node_inference_api["API Inference<br/>[inference-api.mjs]"]
  node_runtime_services["Runtime Services<br/>[services.mjs]"]
  node_ollama["Ollama"]
end

subgraph group_interaction["Voice and Audio"]
  node_voice_service["Voice Service<br/>[voice-service.mjs]"]
  node_voice_runtime["Voice Runtime<br/>[server.py]"]
  node_subtitles["Subtitle Controller"]
  node_music_service["Music Detection"]
  node_music_worker["Music Worker<br/>[worker.py]"]
end

subgraph group_tools["Tools and Memory"]
  node_transcript[("Transcript Store<br/>[storage.mjs]")]
  node_desktop_actions["Desktop Actions<br/>[service.mjs]"]
  node_filesystem["File Access<br/>[service.mjs]"]
  node_companion_tools["Companion Tools<br/>[index.mjs]"]
end

subgraph group_desktop["Desktop Experience"]
  node_desktop_ui["Desktop UI<br/>[app.js]"]
  node_avatar_catalog["Avatar Catalog<br/>[avatar-catalog.mjs]"]
end

node_user(("User"))

node_user -->|"sends message"| node_desktop_ui
node_desktop_ui -.->|"submits turn"| node_chat
node_chat -->|"uses gateway"| node_gateway
node_chat -->|"routes requests"| node_request_router
node_chat -->|"supports API mode"| node_inference_api
node_chat -.->|"persists conversation"| node_transcript
node_runtime_services -->|"starts service"| node_ollama
node_desktop_ui -.->|"enables voice"| node_voice_service
node_voice_service -.->|"requests speech"| node_voice_runtime
node_desktop_ui -.->|"shows speech captions"| node_subtitles
node_music_service -->|"uses detector"| node_music_worker
node_desktop_ui -.->|"enables music reaction"| node_music_service
node_chat -->|"offers desktop tools"| node_desktop_actions
node_chat -->|"offers scoped file access"| node_filesystem
node_chat -.->|"offers approved tools"| node_companion_tools
node_desktop_ui -.->|"displays avatar"| node_avatar_catalog

click node_desktop_ui "https://github.com/caprichooms/capricore/blob/main/apps/desktop/renderer/app.js"
click node_chat "https://github.com/caprichooms/capricore/blob/main/apps/desktop/chat-service.mjs"
click node_request_router "https://github.com/caprichooms/capricore/blob/main/apps/desktop/request-router.mjs"
click node_transcript "https://github.com/caprichooms/capricore/blob/main/apps/desktop/storage.mjs"
click node_inference_api "https://github.com/caprichooms/capricore/blob/main/apps/desktop/inference-api.mjs"
click node_runtime_services "https://github.com/caprichooms/capricore/blob/main/packages/runtime/src/providers/services.mjs"
click node_voice_service "https://github.com/caprichooms/capricore/blob/main/apps/desktop/voice-service.mjs"
click node_voice_runtime "https://github.com/caprichooms/capricore/blob/main/integrations/voice_runtime/server.py"
click node_subtitles "https://github.com/caprichooms/capricore/blob/main/apps/desktop/renderer/subtitle-controller.mjs"
click node_music_service "https://github.com/caprichooms/capricore/blob/main/apps/desktop/music-listening-service.mjs"
click node_music_worker "https://github.com/caprichooms/capricore/blob/main/integrations/music_runtime/worker.py"
click node_desktop_actions "https://github.com/caprichooms/capricore/blob/main/integrations/desktop-actions/service.mjs"
click node_filesystem "https://github.com/caprichooms/capricore/blob/main/integrations/filesystem/service.mjs"
click node_companion_tools "https://github.com/caprichooms/capricore/blob/main/integrations/companion-tools/index.mjs"
click node_avatar_catalog "https://github.com/caprichooms/capricore/blob/main/apps/desktop/avatar-catalog.mjs"

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_chat,node_request_router,node_gateway,node_user toneBlue
class node_inference_api,node_runtime_services,node_ollama toneAmber
class node_voice_service,node_voice_runtime,node_subtitles,node_music_service,node_music_worker toneMint
class node_transcript,node_desktop_actions,node_filesystem,node_companion_tools toneRose
class node_desktop_ui,node_avatar_catalog toneIndigo
```

## Components

### Conversation

- [Chat Service](https://github.com/caprichooms/capricore/blob/main/apps/desktop/chat-service.mjs): `apps/desktop/chat-service.mjs`
- [Request Router](https://github.com/caprichooms/capricore/blob/main/apps/desktop/request-router.mjs): `apps/desktop/request-router.mjs`
- **OpenClaw Gateway**

### Inference

- [API Inference](https://github.com/caprichooms/capricore/blob/main/apps/desktop/inference-api.mjs): `apps/desktop/inference-api.mjs`
- [Runtime Services](https://github.com/caprichooms/capricore/blob/main/packages/runtime/src/providers/services.mjs): `packages/runtime/src/providers/services.mjs`
- **Ollama**

### Voice and Audio

- [Voice Service](https://github.com/caprichooms/capricore/blob/main/apps/desktop/voice-service.mjs): `apps/desktop/voice-service.mjs`
- [Voice Runtime](https://github.com/caprichooms/capricore/blob/main/integrations/voice_runtime/server.py): `integrations/voice_runtime/server.py`
- [Subtitle Controller](https://github.com/caprichooms/capricore/blob/main/apps/desktop/renderer/subtitle-controller.mjs): `apps/desktop/renderer/subtitle-controller.mjs`
- [Music Detection](https://github.com/caprichooms/capricore/blob/main/apps/desktop/music-listening-service.mjs): `apps/desktop/music-listening-service.mjs`
- [Music Worker](https://github.com/caprichooms/capricore/blob/main/integrations/music_runtime/worker.py): `integrations/music_runtime/worker.py`

### Tools and Memory

- [Transcript Store](https://github.com/caprichooms/capricore/blob/main/apps/desktop/storage.mjs): `apps/desktop/storage.mjs`
- [Desktop Actions](https://github.com/caprichooms/capricore/blob/main/integrations/desktop-actions/service.mjs): `integrations/desktop-actions/service.mjs`
- [File Access](https://github.com/caprichooms/capricore/blob/main/integrations/filesystem/service.mjs): `integrations/filesystem/service.mjs`
- [Companion Tools](https://github.com/caprichooms/capricore/blob/main/integrations/companion-tools/index.mjs): `integrations/companion-tools/index.mjs`

### Desktop Experience

- [Desktop UI](https://github.com/caprichooms/capricore/blob/main/apps/desktop/renderer/app.js): `apps/desktop/renderer/app.js`
- [Avatar Catalog](https://github.com/caprichooms/capricore/blob/main/apps/desktop/avatar-catalog.mjs): `apps/desktop/avatar-catalog.mjs`

### Other components

- **User**

## Connections

- User → Desktop UI: sends message (evidence: `README.md`)
- Desktop UI → Chat Service: submits turn
- Chat Service → OpenClaw Gateway: uses gateway (evidence: `README.md`)
- Chat Service → Request Router: routes requests (evidence: `apps/desktop/chat-service.mjs`)
- Chat Service → API Inference: supports API mode (evidence: `README.md`)
- Chat Service → Transcript Store: persists conversation
- Runtime Services → Ollama: starts service (evidence: `packages/runtime/src/providers/services.mjs`)
- Desktop UI → Voice Service: enables voice
- Voice Service → Voice Runtime: requests speech
- Desktop UI → Subtitle Controller: shows speech captions
- Music Detection → Music Worker: uses detector (evidence: `apps/desktop/music-listening-service.mjs`)
- Desktop UI → Music Detection: enables music reaction
- Chat Service → Desktop Actions: offers desktop tools (evidence: `README.md`)
- Chat Service → File Access: offers scoped file access (evidence: `README.md`)
- Chat Service → Companion Tools: offers approved tools
- Desktop UI → Avatar Catalog: displays avatar
