In the Loop is built as a monorepo with four core packages and a unified web client:
@runtimed/schema- Event-sourced schema definitions with full type safety across the ecosystem@runtimed/agent-core- Runtime agent framework with artifact storage and observability@runtimed/ai-core- Multi-provider AI integration (OpenAI, Ollama, Groq) with tool calling@runtimed/pyodide-runtime- In-browser Python runtime with scientific computing stack
In the Loop supports three execution paradigms:
- External Runtime Agents - Python execution via
@runt/pyodide-runtime-agent(JSR package) - In-Browser HTML Runtime - Direct DOM execution for HTML/CSS/JavaScript
- In-Browser Python Runtime - Pyodide-powered Python with numpy, pandas, matplotlib
All runtimes share the same LiveStore event-sourced backend for consistent state management.
- LiveStore - Event-sourcing library for local-first apps with real-time sync
- Effect - Functional programming library for TypeScript
- React - UI framework with CodeMirror editors
- Cloudflare Workers - Production deployment with D1 (SQLite) and R2 (object storage)
VITE_RUNT_LOG_LEVEL: Control runtime agent verbosityDEBUG: All logs including debug infoINFO: Informational and above (default dev)WARN: Warnings and errors onlyERROR: Errors only (default production)
Example:
# Enable verbose logging for troubleshooting
VITE_RUNT_LOG_LEVEL=DEBUG pnpm dev
# Quiet mode for clean output
VITE_RUNT_LOG_LEVEL=ERROR pnpm devSee .env.example and .dev.vars.example for complete configuration options.
In the Loop runs on Cloudflare Workers with a unified architecture:
- Single Worker serves both frontend assets and backend API
- D1 Database stores LiveStore events for persistence
- R2 Bucket handles artifact storage for large outputs
- Durable Objects manage WebSocket connections for real-time sync
This architecture provides robust collaboration and artifact storage while simplifying deployment.
# Development
pnpm dev # Integrated server (frontend + backend)
pnpm dev:iframe # Iframe outputs server
pnpm dev:runtime # External runtime agent (should probably get command from UI)
# Quality Checks
pnpm check # Type check + lint + format check
pnpm test # Run test suite
pnpm test:integration # Integration tests only
# Building
pnpm build # Build for development
pnpm build:production # Optimized production build| Problem | Solution |
|---|---|
| Schema errors | Restart all services after package changes |
| Runtime not connecting | Check API key creation and copy exact command from UI |
| Dev server crashes | Run pnpm dev again - .env changes don't auto-restart |
| Build failures | Run pnpm type-check to identify TypeScript issues |
| Lost notebooks | Run rm -rf .wrangler |
The monorepo structure allows local development of runtime packages:
# Work on schema changes
cd packages/schema
pnpm type-check
# Test agent-core modifications
cd packages/agent-core
pnpm lint
# All packages use workspace:* dependencies for local developmentSchema changes automatically propagate to all consuming packages through workspace linking.