How fangxm233/cortex-agent works
Cortex is a long-running autonomous project agent: a user submits a mission through a shared interface, work is organized into verifiable tasks and agent runs, and progress is retained as project files. The README also documents multi-agent thread pipelines, scheduling, skills/plugins, and remote-machine access. The sampled source is partial and mostly covers backend engines and web controllers, so subsystem links below follow documented behavior and omit uncertain implementation-level wiring.
Main entry points: orchestrator.ts Message orchestration · service.ts Agent run service · daemon.ts Cortex daemon · dispatcher.ts Task dispatch
Components 20
User interfaces
- Web workbench
agent-server/src/domain/ui-service - Chat integrations
agent-server/src/domain/mcp - Terminal interface
agent-server/src/entry
Work execution
- Message orchestration
agent-server/src/orchestration/orchestrator.ts - Task lifecycle
agent-server/src/domain/tasks - Task dispatch
agent-server/src/domain/tasks/dispatcher.ts - Thread pipelines
agent-server/src/domain/threads - Agent run service
agent-server/src/domain/runs/service.ts - Backend adapters
agent-server/src/agent-adapter
Project state
- Project log
agent-server/src/domain/projects - Project memory
agent-server/src/domain/memory - Task records
agent-server/src/domain/tasks/store.ts
Extensions and access
- Scheduler
agent-server/src/domain/scheduling/scheduler.ts - Skills and plugins
agent-server/src/domain/plugins - Remote machines
agent-server/src/domain/remote
Server platform
- Cortex daemon
agent-server/src/entry/daemon.ts - UI service
agent-server/src/domain/ui-service/ui-service.ts - Live events
agent-server/src/events/event-bus.ts - Configuration
agent-server/src/core/settings.ts
Other components
- Project owner
Connections 20
- Project owner → Web workbench: submits work
- Project owner → Chat integrations: messages
- Project owner → Terminal interface: runs commands
- Web workbench → UI service: queries and mutates
- Chat integrations → Message orchestration: delivers messages
- Terminal interface → Cortex daemon: starts and controls
- Cortex daemon → Message orchestration: serves requests
- UI service → Task lifecycle: manages tasks
- Message orchestration → Task dispatch: dispatches work
- Task dispatch → Agent run service: starts runs
- Thread pipelines → Agent run service: runs pipeline stages
- Agent run service → Backend adapters: executes via
- Task lifecycle → Task records: tracks progress
- Project memory → Project log: maintains context
- Agent run service → Project log: records progress
- Scheduler → Task dispatch: dispatches scheduled work
- Skills and plugins → Backend adapters: extends agent runtime
- Remote machines → Backend adapters: provides remote access
- Message orchestration → Live events: publishes updates
- Cortex daemon → Configuration: loads settings