This document lives in the repo as CLAUDE.md. Claude Code reads it automatically. For ChatGPT or other tools, paste it as your first message before asking for code help. Last updated March 2026.
Repo location: arkos/CLAUDE.md
ARKOS is a Python async agent framework. FastAPI backend, PostgreSQL + mem0 memory, MCP tool compatibility, YAML-based state graphs with Pydantic-enforced transitions.
| Module | What it owns |
|---|---|
agent_module/ |
Agent loop, step(), step_stream(), choose_transition() |
state_module/ |
State base class, state registry, state graph YAML, all state implementations |
tool_module/ |
MCP client, tool registry, per-user auth (token_store) |
base_module/ |
FastAPI app, endpoints, auth router |
logging_module/ |
Structured JSON lines logger (LogEvent, emit_log) |
Stack: Python 3.11+, FastAPI, PostgreSQL, Pydantic v2, asyncio, ruff, pytest.
These are load-bearing rules. Violating them silently breaks the agent loop.
1. Every state.run() must return StateOutput, never a raw AIMessage.
completion_signal must be one of: complete, incomplete, error, needs_input.
2. Every new state must be registered.
Decorate with @register_state. Add to state_graph.yaml with max_iterations and failure_state.
state_module/states/state_{name}.pyState, set type = "{name}", decorate with @register_staterun() returns StateOutput — never AIMessagecheck_transition_ready() reads completion_signal only