How mitudrudutta/rehearsal works
Rehearsal is a platform for compiling an application into a resettable practice world, rehearsing agents against simulated customers and intentional failures, and judging outcomes from the application’s own database. The principal workflow runs from application import through world build, evaluation episodes, database-backed checks, readiness results, and improvement/held-out comparison. The README documents these product stages; source-index references support several internal links, while unsampled implementation details are represented at their existing directory paths.
Main entry points: evaluate.py Evaluation worker · episode.py Agent episode · app.py API and auth · pipeline.py World compiler
Components 22
Access and console
- Web console
web/src/screens/Applications.tsx - CLI and SDK
rehearsal/sdk/client.py
Control plane
- API and auth
rehearsal/api/app.py - Plans and billing
rehearsal/billing.py - Control database
rehearsal/db/models.py - Job queue
rehearsal/db/queue.py - Worker dispatch
rehearsal/worker/main.py
World compilation
- World compiler
rehearsal/compiler/pipeline.py - Discovery and validation
rehearsal/compiler - Sandbox runtime
rehearsal/runner/runtime.py - Fictional data seeding
rehearsal/runner/seed.py - Practice application
Rehearsal runtime
- Evaluation worker
rehearsal/worker/evaluate.py - Agent episode
rehearsal/agents/episode.py - Simulated customer
rehearsal/agents/participant.py - Model providers
rehearsal/agents/llm.py
Verification and improvement
- Database oracle
rehearsal/evaluator/oracle.py - Read-only probes
rehearsal/evaluator/probes.py - Agent improvement
rehearsal/worker/improve.py - Run traces
rehearsal/telemetry/__init__.py
Other components
- Application owner
- Model provider services
Connections 29
- Application owner → Web console: manages apps
README.md - Application owner → CLI and SDK: starts jobs
README.md - Web console → API and auth: uses API
- CLI and SDK → API and auth: calls API
- API and auth → Plans and billing: checks limits
rehearsal/api/app.py - API and auth → Control database: stores records
rehearsal/api/app.py - API and auth → Job queue: enqueues jobs
rehearsal/api/app.py - Job queue → Control database: persists jobs
rehearsal/db/queue.py - Worker dispatch → Job queue: claims jobs
rehearsal/worker/main.py - Worker dispatch → Evaluation worker: dispatches evaluation
- Worker dispatch → World compiler: dispatches builds
- World compiler → Discovery and validation: uses phases
rehearsal/compiler/pipeline.py - World compiler → Sandbox runtime: materializes world
rehearsal/compiler/pipeline.py - World compiler → Fictional data seeding: seeds data
rehearsal/compiler/pipeline.py - Sandbox runtime → Practice application: runs services
README.md - Fictional data seeding → Practice application: writes fictional data
README.md - Evaluation worker → Agent episode: runs episodes
rehearsal/worker/evaluate.py - Evaluation worker → Sandbox runtime: resets world
rehearsal/worker/evaluate.py - Agent episode → Simulated customer: simulates customer
rehearsal/agents/episode.py - Agent episode → Model providers: requests model calls
rehearsal/agents/episode.py - Model providers → Model provider services: calls model
README.md - Agent episode → Database oracle: checks outcomes
rehearsal/agents/episode.py - Database oracle → Read-only probes: reads state
rehearsal/evaluator/oracle.py - Read-only probes → Practice application: queries database
README.md - Agent improvement → Control database: reads failed jobs
- Agent improvement → Model providers: proposes version
- Evaluation worker → Agent improvement: feeds failures
README.md - Evaluation worker → Run traces: records traces
rehearsal/worker/evaluate.py - Agent episode → Run traces: traces steps
rehearsal/agents/episode.py