How jackliu1376/ai-agent-plan works
Cairn turns a natural-language task into an evidence-backed, dependency-validated plan; it plans but does not execute the actions. The main workflow is task submission, model-led tool research, optional clarification, plan validation, and Markdown/JSON presentation. The web product adds streamed progress, resumable sessions, and plan revisions. Tool-specific capabilities are represented as distinct branches because the README documents them, but their internal implementations were not sampled. Relationships are limited to source-index references, shown calls, or README documentation.
Main entry points: base.py Tool registry · loop.py Planning loop · app.py HTTP and SSE API · App.tsx Planning interface
Components 28
Planning agent
- CLI entry
task-planner/agent/cli.py - Planning loop
task-planner/agent/loop.py - LLM client
task-planner/agent/llm_client.py - Runtime settings
task-planner/agent/config.py - Run events
task-planner/agent/events.py - Tool runner
task-planner/agent/tool_runner.py - Plan schema
task-planner/agent/schema.py - Run trace
task-planner/agent/run_log.py
Research tools
- Tool registry
task-planner/mcp_server/tools/base.py - Attraction lookup
task-planner/mcp_server/tools/attractions.py - Live attraction checks
task-planner/mcp_server/tools/attraction_live.py - Weather lookup
task-planner/mcp_server/tools/weather.py - Route estimates
task-planner/mcp_server/tools/route.py - Transit lookup
task-planner/mcp_server/tools/transit.py - Budget parsing
task-planner/mcp_server/tools/budget.py - Currency conversion
task-planner/mcp_server/tools/currency.py - Web retrieval
task-planner/mcp_server/tools/web.py - Clarification tool
task-planner/mcp_server/tools/clarify.py - Save plan
task-planner/mcp_server/tools/storage.py - MCP interface
task-planner/mcp_server/server.py
Web service
- HTTP and SSE API
task-planner/web/app.py
Web interface
- Planning interface
task-planner/frontend/src/App.tsx - Session state hook
task-planner/frontend/src/hooks/usePlanningSession.ts - HTTP client
task-planner/frontend/src/api/client.ts - Plan and evidence views
task-planner/frontend/src/components/PlanView.tsx
Session state
- Session manager
task-planner/web/session.py - Session database
task-planner/web/session_db.py
Other components
- Task author
Connections 29
- Task author → CLI entry: submits task
README.md - CLI entry → Planning loop: starts planning
- Task author → Planning interface: enters task
README.md - Planning interface → Session state hook: uses session state
task-planner/frontend/src/App.tsx - Session state hook → HTTP client: requests sessions
task-planner/frontend/src/hooks/usePlanningSession.ts - HTTP client → HTTP and SSE API: calls HTTP API
- HTTP and SSE API → Planning loop: runs planning
task-planner/web/app.py - HTTP and SSE API → Session manager: manages sessions
task-planner/web/app.py - Session manager → Session database: loads and saves
task-planner/web/session.py - Session manager → Planning loop: hosts clarification
task-planner/web/session.py - Planning loop → LLM client: requests decisions
task-planner/agent/loop.py - Planning loop → Tool runner: executes calls
task-planner/agent/loop.py - Planning loop → Run events: emits progress
task-planner/agent/loop.py - Planning loop → Plan schema: validates plan
task-planner/agent/loop.py - Planning loop → Run trace: records trace
task-planner/agent/run_log.py - LLM client → Runtime settings: loads settings
task-planner/agent/llm_client.py - Tool runner → Tool registry: dispatches tools
task-planner/agent/tool_runner.py - MCP interface → Tool registry: serves tool schemas
task-planner/mcp_server/server.py - Tool registry → Attraction lookup: registers
task-planner/mcp_server/tools/base.py - Tool registry → Live attraction checks: registers
task-planner/mcp_server/tools/base.py - Tool registry → Weather lookup: registers
task-planner/mcp_server/tools/base.py - Tool registry → Route estimates: registers
task-planner/mcp_server/tools/base.py - Tool registry → Transit lookup: registers
task-planner/mcp_server/tools/base.py - Tool registry → Budget parsing: registers
task-planner/mcp_server/tools/base.py - Tool registry → Currency conversion: registers
task-planner/mcp_server/tools/base.py - Tool registry → Web retrieval: registers
task-planner/mcp_server/tools/base.py - Tool registry → Clarification tool: registers
task-planner/mcp_server/tools/base.py - Tool registry → Save plan: registers
task-planner/mcp_server/tools/base.py - Planning interface → Plan and evidence views: renders plan
task-planner/frontend/src/App.tsx