# chromiaagents/decenchro-public architecture

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

- Interactive diagram: https://gitdiagram.com/chromiaagents/decenchro-public
- Repository: https://github.com/chromiaagents/decenchro-public

## Overview

Decenchro is a hosted and locally runnable AI-agent platform: users configure and deploy agents, then monitor their activity and costs. Its documented runtime combines Telegram, OpenRouter, an Atbash guard, and tamper-evident Chromia memory; hosted agents also receive BNB Smart Chain ERC-8004 identities and daily audit attestations. The console includes lifecycle controls, memory, replay, governance, and billing, with a public registry-backed marketplace. The sampled routes show deployment, management, metrics, and attestation ownership; runtime wiring and several console branches are based on README descriptions and repository paths.

Main entry points: [`lib/dashboard/deployments.ts`](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/deployments.ts) (Deployment records), [`docker/agent`](https://github.com/chromiaagents/decenchro-public/tree/main/docker/agent) (Hosted agent image), [`app/api/agents/attest/route.ts`](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agents/attest/route.ts) (Daily attest sweep), [`lib/dashboard/deploy.ts`](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/deploy.ts) (Provisioning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console and access"]
  node_web["Web console"]
  node_auth["Authentication<br/>[route.ts]"]
  node_authsvc["Auth service<br/>[server.ts]"]
  node_deployui["Deploy interface<br/>[deploy-launch.tsx]"]
  node_consolefeatures["Memory, replay, governance, billing"]
end

subgraph group_operations["Agent operations"]
  node_deployapi["Deploy endpoint<br/>[route.ts]"]
  node_deploysvc["Provisioning<br/>[deploy.ts]"]
  node_deploydb[("Deployment records<br/>[deployments.ts]")]
  node_database[("Application database<br/>[client.ts]")]
  node_manageapi["Lifecycle controls<br/>[route.ts]"]
  node_metricsapi["Metrics endpoint<br/>[route.ts]"]
  node_metrics["Agent metrics<br/>[agent-metrics.ts]"]
  node_auditapi["Audit feed<br/>[route.ts]"]
end

subgraph group_runtime["Agent runtime"]
  node_atbashlib["Atbash integration<br/>[atbash.ts]"]
  node_agent["Hosted agent image"]
  node_memoryclient["Chromia memory client<br/>[memory.ts]"]
end

subgraph group_chain["Identity and registry"]
  node_attestapi["Daily attest sweep<br/>[route.ts]"]
  node_bsc["BSC identity and attestations<br/>[bsc.ts]"]
  node_atteststore[("Attestation records")]
  node_marketplace["Agent marketplace"]
  node_registry["Marketplace registry<br/>[registry.ts]"]
end

subgraph group_defi["DeFi capability"]
  node_deficli["BSC DeFi CLI<br/>[bsc-defi.mjs]"]
  node_defimodules["Swap, lending, yield"]
end

node_user(("Operator"))
node_render["Render hosting"]
node_atbash{{"Atbash guard"}}
node_telegram["Telegram"]
node_openrouter["OpenRouter models"]
node_chromia[("Chromia chain")]
node_bnb[("BNB Smart Chain")]
node_defichain["DeFi protocols"]

node_user -->|"uses"| node_web
node_web -->|"signs in"| node_auth
node_auth -->|"exchanges session"| node_authsvc
node_user -->|"configures"| node_deployui
node_deployui -->|"requests deploy"| node_deployapi
node_deployapi -->|"provisions"| node_deploysvc
node_deploysvc -->|"creates service"| node_render
node_deploysvc -->|"records deployment"| node_deploydb
node_deploydb -->|"reads and writes"| node_database
node_user -->|"manages agent"| node_manageapi
node_manageapi -->|"reads and updates"| node_deploydb
node_manageapi -->|"controls service"| node_render
node_user -->|"views metrics"| node_metricsapi
node_metricsapi -->|"lists deployments"| node_deploydb
node_metricsapi -->|"fetches and enforces"| node_metrics
node_metrics -->|"fetches metrics"| node_render
node_user -->|"views audit"| node_auditapi
node_auditapi -->|"scopes agents"| node_deploydb
node_auditapi -->|"fetches tool calls"| node_atbashlib
node_atbashlib -->|"reads audit feed"| node_atbash
node_agent -->|"receives messages"| node_telegram
node_agent -->|"requests model"| node_openrouter
node_agent -->|"checks risky actions"| node_atbash
node_agent -->|"writes memory"| node_memoryclient
node_memoryclient -->|"stores records"| node_chromia
node_attestapi -->|"loads agents"| node_deploydb
node_attestapi -->|"fetches tool calls"| node_atbashlib
node_attestapi -->|"stores attestation"| node_atteststore
node_attestapi -->|"registers and attests"| node_bsc
node_atteststore -->|"reads and writes"| node_database
node_bsc -->|"submits transactions"| node_bnb
node_user -->|"browses agents"| node_marketplace
node_marketplace -->|"loads listings"| node_registry
node_registry -->|"reads identities"| node_bnb
node_user -->|"monitors and configures"| node_consolefeatures
node_consolefeatures -->|"reads agent state"| node_deploydb
node_agent -.->|"invokes tools"| node_deficli
node_deficli -->|"dispatches commands"| node_defimodules
node_defimodules -->|"calls protocols"| node_defichain

click node_web "https://github.com/chromiaagents/decenchro-public/tree/main/app/dashboard"
click node_auth "https://github.com/chromiaagents/decenchro-public/blob/main/app/api/auth/%5B...path%5D/route.ts"
click node_authsvc "https://github.com/chromiaagents/decenchro-public/blob/main/lib/auth/server.ts"
click node_deployui "https://github.com/chromiaagents/decenchro-public/blob/main/components/deploy-launch.tsx"
click node_deployapi "https://github.com/chromiaagents/decenchro-public/blob/main/app/api/deploy/route.ts"
click node_deploysvc "https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/deploy.ts"
click node_deploydb "https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/deployments.ts"
click node_database "https://github.com/chromiaagents/decenchro-public/blob/main/lib/db/client.ts"
click node_manageapi "https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agents/manage/route.ts"
click node_metricsapi "https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agent-metrics/route.ts"
click node_metrics "https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/agent-metrics.ts"
click node_auditapi "https://github.com/chromiaagents/decenchro-public/blob/main/app/api/audits/route.ts"
click node_atbashlib "https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/atbash.ts"
click node_agent "https://github.com/chromiaagents/decenchro-public/tree/main/docker/agent"
click node_memoryclient "https://github.com/chromiaagents/decenchro-public/blob/main/chain/client/src/memory.ts"
click node_attestapi "https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agents/attest/route.ts"
click node_bsc "https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/bsc.ts"
click node_atteststore "https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/erc8004-attestations.ts"
click node_marketplace "https://github.com/chromiaagents/decenchro-public/tree/main/app/agents"
click node_registry "https://github.com/chromiaagents/decenchro-public/blob/main/lib/marketplace/registry.ts"
click node_consolefeatures "https://github.com/chromiaagents/decenchro-public/tree/main/components/dashboard"
click node_deficli "https://github.com/chromiaagents/decenchro-public/blob/main/agent/bsc-defi/bin/bsc-defi.mjs"
click node_defimodules "https://github.com/chromiaagents/decenchro-public/tree/main/agent/bsc-defi/src"

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_web,node_auth,node_authsvc,node_deployui,node_consolefeatures toneBlue
class node_deployapi,node_deploysvc,node_deploydb,node_database,node_manageapi,node_metricsapi,node_metrics,node_auditapi,node_chromia,node_bnb toneAmber
class node_atbashlib,node_agent,node_memoryclient,node_openrouter toneMint
class node_attestapi,node_bsc,node_atteststore,node_marketplace,node_registry toneRose
class node_deficli,node_defimodules,node_user,node_render,node_atbash,node_telegram,node_defichain toneIndigo
```

## Components

### Console and access

- [Web console](https://github.com/chromiaagents/decenchro-public/tree/main/app/dashboard): `app/dashboard`
- [Authentication](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/auth/%5B...path%5D/route.ts): `app/api/auth/[...path]/route.ts`
- [Auth service](https://github.com/chromiaagents/decenchro-public/blob/main/lib/auth/server.ts): `lib/auth/server.ts`
- [Deploy interface](https://github.com/chromiaagents/decenchro-public/blob/main/components/deploy-launch.tsx): `components/deploy-launch.tsx`
- [Memory, replay, governance, billing](https://github.com/chromiaagents/decenchro-public/tree/main/components/dashboard): `components/dashboard`

### Agent operations

- [Deploy endpoint](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/deploy/route.ts): `app/api/deploy/route.ts`
- [Provisioning](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/deploy.ts): `lib/dashboard/deploy.ts`
- [Deployment records](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/deployments.ts): `lib/dashboard/deployments.ts`
- [Application database](https://github.com/chromiaagents/decenchro-public/blob/main/lib/db/client.ts): `lib/db/client.ts`
- [Lifecycle controls](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agents/manage/route.ts): `app/api/agents/manage/route.ts`
- [Metrics endpoint](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agent-metrics/route.ts): `app/api/agent-metrics/route.ts`
- [Agent metrics](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/agent-metrics.ts): `lib/dashboard/agent-metrics.ts`
- [Audit feed](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/audits/route.ts): `app/api/audits/route.ts`

### Agent runtime

- [Atbash integration](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/atbash.ts): `lib/dashboard/atbash.ts`
- [Hosted agent image](https://github.com/chromiaagents/decenchro-public/tree/main/docker/agent): `docker/agent`
- [Chromia memory client](https://github.com/chromiaagents/decenchro-public/blob/main/chain/client/src/memory.ts): `chain/client/src/memory.ts`

### Identity and registry

- [Daily attest sweep](https://github.com/chromiaagents/decenchro-public/blob/main/app/api/agents/attest/route.ts): `app/api/agents/attest/route.ts`
- [BSC identity and attestations](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/bsc.ts): `lib/dashboard/bsc.ts`
- [Attestation records](https://github.com/chromiaagents/decenchro-public/blob/main/lib/dashboard/erc8004-attestations.ts): `lib/dashboard/erc8004-attestations.ts`
- [Agent marketplace](https://github.com/chromiaagents/decenchro-public/tree/main/app/agents): `app/agents`
- [Marketplace registry](https://github.com/chromiaagents/decenchro-public/blob/main/lib/marketplace/registry.ts): `lib/marketplace/registry.ts`

### DeFi capability

- [BSC DeFi CLI](https://github.com/chromiaagents/decenchro-public/blob/main/agent/bsc-defi/bin/bsc-defi.mjs): `agent/bsc-defi/bin/bsc-defi.mjs`
- [Swap, lending, yield](https://github.com/chromiaagents/decenchro-public/tree/main/agent/bsc-defi/src): `agent/bsc-defi/src`

### Other components

- **Operator**
- **Render hosting**
- **Atbash guard**
- **Telegram**
- **OpenRouter models**
- **Chromia chain**
- **BNB Smart Chain**
- **DeFi protocols**

## Connections

- Operator → Web console: uses
- Web console → Authentication: signs in
- Authentication → Auth service: exchanges session
- Operator → Deploy interface: configures
- Deploy interface → Deploy endpoint: requests deploy
- Deploy endpoint → Provisioning: provisions
- Provisioning → Render hosting: creates service
- Provisioning → Deployment records: records deployment
- Deployment records → Application database: reads and writes
- Operator → Lifecycle controls: manages agent
- Lifecycle controls → Deployment records: reads and updates
- Lifecycle controls → Render hosting: controls service
- Operator → Metrics endpoint: views metrics
- Metrics endpoint → Deployment records: lists deployments
- Metrics endpoint → Agent metrics: fetches and enforces
- Agent metrics → Render hosting: fetches metrics
- Operator → Audit feed: views audit
- Audit feed → Deployment records: scopes agents
- Audit feed → Atbash integration: fetches tool calls
- Atbash integration → Atbash guard: reads audit feed
- Hosted agent image → Telegram: receives messages
- Hosted agent image → OpenRouter models: requests model
- Hosted agent image → Atbash guard: checks risky actions
- Hosted agent image → Chromia memory client: writes memory
- Chromia memory client → Chromia chain: stores records
- Daily attest sweep → Deployment records: loads agents
- Daily attest sweep → Atbash integration: fetches tool calls
- Daily attest sweep → Attestation records: stores attestation
- Daily attest sweep → BSC identity and attestations: registers and attests
- Attestation records → Application database: reads and writes
- BSC identity and attestations → BNB Smart Chain: submits transactions
- Operator → Agent marketplace: browses agents
- Agent marketplace → Marketplace registry: loads listings
- Marketplace registry → BNB Smart Chain: reads identities
- Operator → Memory, replay, governance, billing: monitors and configures
- Memory, replay, governance, billing → Deployment records: reads agent state
- Hosted agent image → BSC DeFi CLI: invokes tools
- BSC DeFi CLI → Swap, lending, yield: dispatches commands
- Swap, lending, yield → DeFi protocols: calls protocols
