How linmowudie/civitasai works
Civitas-AI is a desktop-oriented autonomous multi-agent system, with a separate account and synchronization server. The main workflow is a user task entering through the client/API, being managed by the loop and decision/runtime layers, using models and tools, and returning observable results. Major supporting capabilities include durable recovery, human approval, governance and arbitration, token budgets, memory, and audit/trace events. The README documents the product flow and capabilities; source excerpts and the index confirm selected wiring, so uncertain implementation links are omitted.
Main entry points: loopEngine.ts Loop Engine · App.tsx Desktop Client · app.ts Account API · ipcBridge.ts IPC Bridge
Components 23
User Interfaces
- Desktop Client
Client/src/App.tsx - IPC Bridge
Src/Interface/IpcBridge/ipcBridge.ts - REST API
Src/Interface/RestApi/chatApi.ts - Web Routes
Src/Interface/WebServer/routes.ts - Runtime Bootstrap
Src/main.ts
Agent Execution
- Loop Engine
Src/Core/Loop/loopEngine.ts - Loop Configuration
Src/Core/Loop/loopConfig.ts - Task Decisions
Src/Core/Decision/orchestrator/orchestrator.ts - Agent Runtime
Src/Core/AgentRuntime/agentRuntime.ts - Model Caller
Src/Core/Model/modelCaller.ts - Tool Safety Gate
Src/Services/LoopControl/middleware/toolSafetyGate.ts - Tool Registry
Src/Tools/Registry/toolDispatcher.ts
Governance Services
- Arbitration
Src/Services/Arbitration/tribunal.ts - Supervision
Src/Services/Supervision/loopSupervision.ts - Token Economy
Src/Services/TokenEconomy/tokenLedger.ts - Shared Memory
Src/Services/SharedMemory/longTermMemory.ts
Runtime Infrastructure
- Durable Execution
Src/Infra/DurableExecution/index.ts - Runtime Database
Src/Infra/Db/database.ts - Event Bus
Src/Services/EventBus/eventBus.ts
Account Services
- Account API
Server/src/app.ts - Authentication
Server/src/services/authService.ts - Account Database
Server/src/db/pool.ts
Other components
- User
Connections 23
- User → Desktop Client: submits task
README.md - Desktop Client → IPC Bridge: uses desktop bridge
- Desktop Client → REST API: sends API requests
- IPC Bridge → Runtime Bootstrap: starts bridge
Src/main.ts - Runtime Bootstrap → Loop Engine: starts runtime
- Web Routes → REST API: registers routes
Src/Interface/WebServer/routes.ts - Loop Engine → Loop Configuration: reads configuration
Src/Core/Loop/loopEngine.ts - Loop Engine → Task Decisions: coordinates task decisions
- Task Decisions → Agent Runtime: dispatches agents
- Agent Runtime → Loop Engine: runs agent loop
README.md - Loop Engine → Model Caller: calls model
README.md - Loop Engine → Tool Safety Gate: gates tool actions
README.md - Loop Engine → Tool Registry: executes tools
README.md - Loop Engine → Durable Execution: checkpoints execution
README.md - Durable Execution → Runtime Database: persists state
- Loop Engine → Supervision: runs supervision
README.md - Loop Engine → Token Economy: enforces budgets
README.md - Loop Engine → Shared Memory: uses memory
README.md - Arbitration → Event Bus: publishes events
- Supervision → Event Bus: emits observations
- Account API → Authentication: constructs service
Server/src/app.ts - Authentication → Account Database: uses database
Server/src/services/authService.ts - Account API → Account Database: checks readiness
Server/src/app.ts