# qingjiuzys/anycode architecture

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

- Interactive diagram: https://gitdiagram.com/qingjiuzys/anycode
- Repository: https://github.com/qingjiuzys/anycode

## Overview

anyCode is a local-first AI coding workbench: the user selects a project and model, starts an agent session, reviews or approves work, and receives changes and session results locally. The main runtime spans the dashboard, its local service, runtime setup, and the agent’s task/tool execution; optional workflow orchestration and memory support longer-running work. The README also documents BYOK and local speech/OCR capabilities, usage reporting, and scheduling. Several connections reflect documented product boundaries and repository structure; sampled excerpts do not establish every internal call, so uncertain wiring is omitted.

Main entry points: [`crates/agent/src/runtime/agentic_loop.rs`](https://github.com/qingjiuzys/anycode/blob/main/crates/agent/src/runtime/agentic_loop.rs) (Agent execution), [`crates/bootstrap/src/runtime.rs`](https://github.com/qingjiuzys/anycode/blob/main/crates/bootstrap/src/runtime.rs) (Runtime bootstrap), [`crates/dashboard-ui/src/routes/routes.tsx`](https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard-ui/src/routes/routes.tsx) (Dashboard UI), [`crates/dashboard/src/server.rs`](https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard/src/server.rs) (Dashboard API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Workbench interface"]
  node_ui["Dashboard UI<br/>[routes.tsx]"]
  node_api["Dashboard API<br/>[server.rs]"]
  node_desktop["Desktop host<br/>[main.rs]"]
  node_reports["Usage and reports<br/>[routes.tsx]"]
end

subgraph group_runtime["Agent runtime"]
  node_config["Configuration<br/>[lib.rs]"]
  node_bootstrap["Runtime bootstrap<br/>[runtime.rs]"]
  node_agent["Agent execution<br/>[agentic_loop.rs]"]
  node_graph["Workflow DAG<br/>[graph_engine.rs]"]
  node_core["Domain contracts<br/>[lib.rs]"]
end

subgraph group_capabilities["Work capabilities"]
  node_tools["Tool execution<br/>[lib.rs]"]
  node_llm["Model integration<br/>[lib.rs]"]
  node_browser["Browser automation<br/>[lib.rs]"]
  node_memory[("Memory pipeline<br/>[pipeline.rs]")]
  node_skills["Skills workbench<br/>[skills_registry.rs]"]
  node_channels["Schedules and channels<br/>[lib.rs]"]
end

subgraph group_localdata["Local services"]
  node_localdb[("Session state<br/>[server.rs]")]
  node_media["Local media<br/>[lib.rs]"]
end

subgraph group_cloud["Account services"]
  node_account["Account service<br/>[lib.rs]"]
end

node_user(("Workbench user"))
node_modelprovider(("Model providers"))

node_user -->|"starts work"| node_ui
node_ui -->|"requests sessions"| node_api
node_desktop -->|"hosts locally"| node_api
node_api -->|"reads and writes"| node_localdb
node_api -->|"sets up runtime"| node_bootstrap
node_bootstrap -->|"loads settings"| node_config
node_bootstrap -->|"assembles runtime"| node_agent
node_agent -->|"requests completions"| node_llm
node_llm -->|"sends model requests"| node_modelprovider
node_agent -->|"dispatches tools"| node_tools
node_agent -.->|"ingests and recalls"| node_memory
node_agent -->|"uses domain types"| node_core
node_graph -->|"executes tasks"| node_agent
node_bootstrap -.->|"configures browser"| node_browser
node_bootstrap -->|"registers skills"| node_skills
node_channels -.->|"runs scheduled tasks"| node_agent
node_ui -->|"views usage"| node_reports
node_ui -.->|"account requests"| node_account
node_bootstrap -.->|"enables local media"| node_media

click node_ui "https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard-ui/src/routes/routes.tsx"
click node_api "https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard/src/server.rs"
click node_desktop "https://github.com/qingjiuzys/anycode/blob/main/apps/anycode-desktop/src/main.rs"
click node_config "https://github.com/qingjiuzys/anycode/blob/main/crates/config/src/lib.rs"
click node_bootstrap "https://github.com/qingjiuzys/anycode/blob/main/crates/bootstrap/src/runtime.rs"
click node_agent "https://github.com/qingjiuzys/anycode/blob/main/crates/agent/src/runtime/agentic_loop.rs"
click node_graph "https://github.com/qingjiuzys/anycode/blob/main/crates/agent/src/graph_engine.rs"
click node_core "https://github.com/qingjiuzys/anycode/blob/main/crates/core/src/lib.rs"
click node_tools "https://github.com/qingjiuzys/anycode/blob/main/crates/tools/src/lib.rs"
click node_llm "https://github.com/qingjiuzys/anycode/blob/main/crates/llm/src/lib.rs"
click node_browser "https://github.com/qingjiuzys/anycode/blob/main/crates/browser/src/lib.rs"
click node_memory "https://github.com/qingjiuzys/anycode/blob/main/crates/memory/src/pipeline.rs"
click node_skills "https://github.com/qingjiuzys/anycode/blob/main/crates/bootstrap/src/skills_registry.rs"
click node_channels "https://github.com/qingjiuzys/anycode/blob/main/crates/channel-bridge/src/lib.rs"
click node_localdb "https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard/src/server.rs"
click node_media "https://github.com/qingjiuzys/anycode/blob/main/crates/apple-media/src/lib.rs"
click node_account "https://github.com/qingjiuzys/anycode/blob/main/crates/account-service/src/lib.rs"
click node_reports "https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard-ui/src/routes/routes.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_ui,node_api,node_desktop,node_reports,node_user toneBlue
class node_config,node_bootstrap,node_agent,node_graph,node_core toneAmber
class node_tools,node_llm,node_browser,node_memory,node_skills,node_channels toneMint
class node_localdb,node_media toneRose
class node_account,node_modelprovider toneIndigo
```

## Components

### Workbench interface

- [Dashboard UI](https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard-ui/src/routes/routes.tsx): `crates/dashboard-ui/src/routes/routes.tsx`
- [Dashboard API](https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard/src/server.rs): `crates/dashboard/src/server.rs`
- [Desktop host](https://github.com/qingjiuzys/anycode/blob/main/apps/anycode-desktop/src/main.rs): `apps/anycode-desktop/src/main.rs`
- [Usage and reports](https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard-ui/src/routes/routes.tsx): `crates/dashboard-ui/src/routes/routes.tsx`

### Agent runtime

- [Configuration](https://github.com/qingjiuzys/anycode/blob/main/crates/config/src/lib.rs): `crates/config/src/lib.rs`
- [Runtime bootstrap](https://github.com/qingjiuzys/anycode/blob/main/crates/bootstrap/src/runtime.rs): `crates/bootstrap/src/runtime.rs`
- [Agent execution](https://github.com/qingjiuzys/anycode/blob/main/crates/agent/src/runtime/agentic_loop.rs): `crates/agent/src/runtime/agentic_loop.rs`
- [Workflow DAG](https://github.com/qingjiuzys/anycode/blob/main/crates/agent/src/graph_engine.rs): `crates/agent/src/graph_engine.rs`
- [Domain contracts](https://github.com/qingjiuzys/anycode/blob/main/crates/core/src/lib.rs): `crates/core/src/lib.rs`

### Work capabilities

- [Tool execution](https://github.com/qingjiuzys/anycode/blob/main/crates/tools/src/lib.rs): `crates/tools/src/lib.rs`
- [Model integration](https://github.com/qingjiuzys/anycode/blob/main/crates/llm/src/lib.rs): `crates/llm/src/lib.rs`
- [Browser automation](https://github.com/qingjiuzys/anycode/blob/main/crates/browser/src/lib.rs): `crates/browser/src/lib.rs`
- [Memory pipeline](https://github.com/qingjiuzys/anycode/blob/main/crates/memory/src/pipeline.rs): `crates/memory/src/pipeline.rs`
- [Skills workbench](https://github.com/qingjiuzys/anycode/blob/main/crates/bootstrap/src/skills_registry.rs): `crates/bootstrap/src/skills_registry.rs`
- [Schedules and channels](https://github.com/qingjiuzys/anycode/blob/main/crates/channel-bridge/src/lib.rs): `crates/channel-bridge/src/lib.rs`

### Local services

- [Session state](https://github.com/qingjiuzys/anycode/blob/main/crates/dashboard/src/server.rs): `crates/dashboard/src/server.rs`
- [Local media](https://github.com/qingjiuzys/anycode/blob/main/crates/apple-media/src/lib.rs): `crates/apple-media/src/lib.rs`

### Account services

- [Account service](https://github.com/qingjiuzys/anycode/blob/main/crates/account-service/src/lib.rs): `crates/account-service/src/lib.rs`

### Other components

- **Workbench user**
- **Model providers**

## Connections

- Workbench user → Dashboard UI: starts work
- Dashboard UI → Dashboard API: requests sessions
- Desktop host → Dashboard API: hosts locally
- Dashboard API → Session state: reads and writes
- Dashboard API → Runtime bootstrap: sets up runtime
- Runtime bootstrap → Configuration: loads settings
- Runtime bootstrap → Agent execution: assembles runtime
- Agent execution → Model integration: requests completions
- Model integration → Model providers: sends model requests
- Agent execution → Tool execution: dispatches tools
- Agent execution → Memory pipeline: ingests and recalls
- Agent execution → Domain contracts: uses domain types
- Workflow DAG → Agent execution: executes tasks
- Runtime bootstrap → Browser automation: configures browser
- Runtime bootstrap → Skills workbench: registers skills
- Schedules and channels → Agent execution: runs scheduled tasks
- Dashboard UI → Usage and reports: views usage
- Dashboard UI → Account service: account requests
- Runtime bootstrap → Local media: enables local media
