PhyAgentOS Agent Architecture

Track A is a message-driven Agent control plane. It combines file state, conversation history, Runtime state, model calls, and structured tools.

中文

1 · Ingress and Egress

Channels / CLI / Cron / Heartbeat → MessageBus or process_direct → AgentLoop → OutboundMessage

Channel I/O is isolated from Agent reasoning. A session key serializes work for one conversation.

2 · Core Agent Loop

ContextBuilder

Loads AGENTS, SOUL, USER, TOOLS, SKILLS, EMBODIED, ENVIRONMENT, TASK, RUNTIME, TARGETS, SESSIONS, memory, and conversation history.

Model Loop

Calls the selected Provider with messages and tool schemas. Tool results re-enter the same context until the model returns final content or reaches maxToolIterations.

ToolRegistry

Filesystem, shell, web, message, subagent, cron, scene graph, image, MCP, and optional verify_session tools.

3 · Agent-Owned Services

SessionManager

Persists per-channel JSONL history.

Memory

Consolidates long histories into memory/MEMORY.md and memory/HISTORY.md.

SubagentManager

Runs bounded background Agent work.

SessionVerifier

Applies semantic success/failure/replan verdicts from Runtime evidence.

4 · Track A / Track B Boundary

TARGETS.md + SKILLRUNTIME.md → planning contract
SESSIONS.md → queue and state
LOG.md + ENVIRONMENT.md + LESSONS.md + artifacts/runtime/* → evidence and feedback

Agent planning never calls a raw Target. It appends a pending Session; the Watchdog owns claim, Preflight, execution, and Runtime writeback.

5 · One Turn

Receive → Load context → Reason → Execute tools → Persist → Deliver