Skip to content

Dev Mode

Dev mode runs all OSTwin components locally — the FastAPI backend, the Next.js dashboard, and the engine — so you can monitor agent execution in real-time, inspect war-rooms, and search memory.

Architecture

┌─────────────────────────────────────────────────────┐
│ Browser → http://localhost:3000 │
│ Next.js Dashboard │
│ ├── Plan overview + status │
│ ├── War-room inspector (channels, progress) │
│ └── Memory search (semantic full-text) │
└─────────────┬───────────────────────────────────────┘
│ REST API calls
┌─────────────▼───────────────────────────────────────┐
│ FastAPI Backend → http://localhost:8000 │
│ ├── /api/plans plan CRUD + status │
│ ├── /api/war-rooms room state + channels │
│ ├── /api/memory publish / query / search │
│ └── /api/dashboard aggregate stats │
└─────────────┬───────────────────────────────────────┘
│ reads filesystem
┌─────────────▼───────────────────────────────────────┐
│ .agents/ │
│ ├── war-rooms/room-001/ channel.jsonl, status │
│ ├── memory/ledger.jsonl shared memory │
│ └── roles/, skills/ agent definitions │
└─────────────────────────────────────────────────────┘

Setup

  1. Install all dependencies

    If you haven’t run the full install yet:

    Terminal window
    pwsh Install.ps1
  2. Set environment variables

    Terminal window
    export ANTHROPIC_API_KEY="sk-ant-..."
    export OSTWIN_ENV="development"
  3. Verify the setup

    Terminal window
    pwsh -Command "& { . ./Engine.ps1 -Verify }"

Running the Stack

Open three terminal windows and start each component:

Terminal window
cd api
source ../.venv/bin/activate
uvicorn main:app --reload --port 8000

The FastAPI backend serves the REST API. The --reload flag enables hot-reloading during development.

Custom Ports

Override default ports with environment variables:

Terminal window
# API on port 9000
uvicorn main:app --reload --port 9000
# Dashboard pointing to custom API
NEXT_PUBLIC_API_URL=http://localhost:9000 pnpm dev

Execution Modes

OSTwin supports three execution modes depending on your needs:

ModeCommandWhen to use
Headlesspwsh Engine.ps1 -PlanPath ./plan.mdCI/CD, unattended runs. No dashboard needed.
DevAll three terminalsActive development. Full monitoring and debugging.
Single-roompwsh Engine.ps1 -PlanPath ./plan.md -Room room-001Re-run a specific epic without re-running the full plan.

Memory System

The memory system allows agents to publish and query knowledge across war-rooms. Use these commands to inspect it:

Terminal window
# List all memory entries
cat .agents/memory/ledger.jsonl | python3 -m json.tool
# Search memory for a term
pwsh -Command "& { . ./Engine.ps1 -MemorySearch 'authentication' }"

Memory entries have five kinds: artifact, decision, interface, convention, warning. Agents publish memory when they produce something other rooms need to know about.

MCP Inspector

To debug MCP tool calls, enable verbose logging:

Terminal window
export MCP_LOG_LEVEL="debug"
pwsh Engine.ps1 -PlanPath ./plan.md -Verbose

This logs every tool invocation, its parameters, and return values. Useful for debugging skill execution or tool permission issues.

Dashboard Features

FeatureDescription
Plan overviewSee all epics, their status, and the dependency DAG
War-room inspectorRead channel messages, check progress, view lifecycle state
Memory browserFull-text search across the shared memory ledger
Agent timelineSee which agents ran, when, and what they produced
Artifact viewerBrowse files created by agents in each war-room

Troubleshooting

ProblemCauseFix
Dashboard shows no dataAPI not runningStart the FastAPI server in Terminal 1
Connection refused on port 8000Port conflictUse a custom port: --port 9000
Engine hangs on first epicMissing API keyCheck echo $ANTHROPIC_API_KEY is set
ModuleNotFoundError in APIWrong venvRun source .venv/bin/activate before starting
War-room stuck in developingAgent errorCheck channel.jsonl for error messages
Memory search returns nothingEmpty ledgerMemory is populated during plan execution

Next Steps

Learn how to write detailed, production-quality plans in Your First Plan.