How ai-evals-course/cartwheel-homeworks works
Cartwheel is both a fictional commerce-support agent and a course project for evaluating and improving agents. The main workflow is a shopper, merchant, or support user entering through the CLI or server; the agent applies identity and safety checks, uses support tools and seeded commerce data, then replies or escalates. Separate course workflows analyze traces, replay evaluation cases, monitor scores, and optimize agent behavior. Some links reflect README-documented capabilities; unsampled modules are represented only where their purpose is documented or indexed.
Main entry points: agent.py Support agent · tools.py Support tools · rollout.py Case replay · app.py Session API
Components 22
Support agent
- Chat CLI
agent/cli.py - Session API
server/app.py - Support agent
agent/agent.py - Support tools
agent/tools.py - Access control
agent/auth.py - Safety guards
agent/guards.py - Refund approvals
agent/approvals.py - Human review
agent/review.py
Commerce world
- Policy search
agent/helpcenter.py - Commerce data
agent/db.py - World generator
seed/generate.py
Trace analysis
- Analysis interface
analysis/server.py - Analysis workflow
analysis/helpers/tools.py - Trace and label I/O
analysis/helpers/langfuse_io.py
Evaluation and improvement
- Case replay
replay/rollout.py - Replay harness
replay/harness.py - Evaluation monitoring
monitoring/run_judges.py - Agent optimization
optimize/workflow.py - Harbor export
harbor_adapter/export.py
External integrations
- Trace instrumentation
observability/instrument.py - Langfuse
Other components
- User
Connections 27
- User → Chat CLI: starts chat
README.md - User → Session API: sends requests
README.md - Chat CLI → Support agent: runs agent
README.md - Session API → Support agent: routes messages
server/app.py - Session API → Access control: builds identity
server/app.py - Session API → Trace instrumentation: configures tracing
server/app.py - Support agent → Support tools: registers tools
agent/agent.py - Support agent → Safety guards: uses guards
agent/agent.py - Support agent → Trace instrumentation: instruments runs
agent/agent.py - Support tools → Access control: checks permissions
agent/tools.py - Support tools → Commerce data: reads and writes
agent/tools.py - Support tools → Policy search: searches policies
agent/tools.py - Support tools → Refund approvals: requests approval
- Human review → Refund approvals: reviews requests
agent/review.py - World generator → Commerce data: populates world
seed/generate.py - Support agent → Commerce data: loads configuration
agent/agent.py - Analysis interface → Analysis workflow: exposes workflow
analysis/server.py - Analysis workflow → Trace and label I/O: loads traces
analysis/helpers/tools.py - Trace and label I/O → Langfuse: reads and labels
analysis/helpers/langfuse_io.py - Trace instrumentation → Langfuse: exports spans
README.md - Case replay → Support agent: runs cases
replay/rollout.py - Case replay → World generator: resets world
replay/rollout.py - Replay harness → Case replay: repeats rollouts
replay/harness.py - Evaluation monitoring → Support agent: runs judges
monitoring/run_judges.py - Evaluation monitoring → Analysis workflow: uses judge tools
monitoring/run_judges.py - Agent optimization → Case replay: evaluates changes
optimize/workflow.py - Harbor export → Case replay: exports cases
harbor_adapter/export.py