The Wizard now uses deterministic auto-layout instead of trying to do spatial reasoning. The LLM focuses on semantics (what nodes/edges to create), and your existing graphLayoutService.js handles all spatial positioning.
User: "Add cookie recipe components"
↓
LLM: { graphSpec: { nodes: [...], edges: [...], layoutAlgorithm: "hierarchical" } }
↓
Queue Goal → Planner → Executor
↓
Executor calls applyLayout(nodes, edges, "hierarchical")
↓
Positioned ops → Auditor → Committer → UI
↓
Graph appears with proper spatial layout!
-
Start UI:
npm run dev
-
Start Bridge (separate terminal):
npm run bridge
-
Verify Health:
curl http://localhost:3001/health # Should return: {"status":"ok","source":"bridge-daemon",...} -
Store API Key:
- Open UI at http://localhost:4000
- Click 🔑 icon in AI panel
- Paste your Anthropic or OpenRouter key
- Click "Store API Key"
Input: "Add Solar Energy"
Expected:
- LLM generates:
{ graphSpec: { nodes: [{ name: "Solar Energy" }], layoutAlgorithm: "force" } } - Executor uses force-directed layout (default for single node)
- Node appears in the active graph
Verify: Check browser console for [Agent] Queued create_subgraph goal with layoutAlgorithm.
Input: "Add a recipe with Flour, Sugar, and Eggs"
Expected:
- LLM generates graphSpec with 4 nodes (Recipe + 3 ingredients) and 3 edges
- Executor chooses
"hierarchical"or"radial"layout (Recipe at center/top, ingredients around it) - Nodes appear with proper spacing and connections
Verify:
- Check
/telemetry?limit=50for theagent_queuedentry showing node/edge counts - Nodes should NOT overlap
- Edges should be visible
Input: "Fill out the components of a web application"
Expected:
- LLM generates 8-12 nodes (Frontend, Backend, Database, API, Auth, etc.)
- LLM chooses appropriate layout (probably
"force"for general graph) - Auto-layout positions nodes with collision avoidance
- Network structure is clear and readable
Verify:
- No nodes stacked on top of each other
- Related components are near each other (force-directed clustering)
- Canvas feels balanced, not all nodes in one corner
Try different phrases to see if LLM picks appropriate layouts:
-
Hierarchical: "Create a company org chart with CEO, managers, and employees"
- Should use
"hierarchical"layout (top-down tree)
- Should use
-
Radial: "Add planets orbiting the Sun"
- Should use
"radial"layout (Sun at center, planets in orbit)
- Should use
-
Grid: "Create a periodic table with elements"
- Might use
"grid"layout (uniform spacing)
- Might use
Verify: Check telemetry for the chosen layoutAlgorithm in each case.
# See what's in the goal queue
curl http://localhost:3001/queue/peek?name=goalQueue&head=5
# See what's in the task queue
curl http://localhost:3001/queue/peek?name=taskQueue&head=5
# Check if patches are being generated
curl http://localhost:3001/queue/metrics?name=patchQueue# See recent agent activity
curl 'http://localhost:3001/telemetry?limit=20' | jq '.items[] | select(.type == "agent_queued" or .type == "agent_plan")'
# Filter by correlation ID (cid from agent response)
curl 'http://localhost:3001/telemetry?cid=cid-1731626400000-abc123' | jq1. "Something went wrong planning the graph"
- Check browser console for LLM API errors
- Verify API key is stored (🔑 icon should show "Manage API Key" not "Setup API Key")
- Check if LLM returned invalid JSON (telemetry will show parse errors)
2. Nodes appear but all at same position
- Auto-layout failed - check console for
[Executor] Task execution failed - Verify
graphLayoutService.jsis being imported correctly - Check if
applyLayoutreturned empty positions array
3. Nothing happens after sending message
- Bridge might be down - check if
npm run bridgeis still running - Verify BridgeClient is mounted - check browser console for "MCP Bridge: Connection" messages
- Check if scheduler is running:
curl http://localhost:3001/orchestration/scheduler/status
4. Scheduler not processing tasks
- Manually start it via bridge startup (should auto-start on first goal enqueue)
- Check:
curl http://localhost:3001/orchestration/scheduler/status - If not enabled, something in
ensureSchedulerStarted()failed
✅ LLM generates graphSpec without x/y coordinates
✅ Executor logs show [Executor] creating positioned ops
✅ Nodes appear in UI with proper spacing (no overlaps)
✅ Different layout algorithms produce visually distinct results
✅ Complex graphs (10+ nodes) are readable and well-structured
In Browser Console:
[Agent] Queued create_subgraph goal: { cid, graphId, nodeCount, edgeCount, layoutAlgorithm }- No
[Executor] Task execution failederrors - BridgeClient logs showing pending actions being executed
In Telemetry (/telemetry?limit=50):
agent_queuedentries with correct node/edge countstool_callentries forapplyMutationswith positioned ops- No entries with
errorfield
In UI:
- Nodes appear in active graph after 1-2 seconds
- Edges connect the right nodes
- Layout looks intentional (not random scatter)
- Refresh button in AI panel stays green (connected)
- Simple graphs (1-3 nodes): < 2 seconds end-to-end
- Medium graphs (5-10 nodes): 2-4 seconds
- Complex graphs (10-20 nodes): 4-6 seconds
Most time is spent in:
- LLM API call (~1-2s for Claude/GPT-4)
- Auto-layout calculation (~0.1-0.5s depending on algorithm)
- UI applying mutations (~0.5-1s for rendering)
Once basic flow works:
- Enhance layout heuristics: Teach LLM when to use each layout type
- Add layout options to UI: Let users override the chosen algorithm
- Implement prototype reuse: Check for existing prototypes before creating new ones
- Add undo/redo: For when Wizard creates unwanted nodes
- Multi-graph support: Let Wizard create new graphs and populate them
The hard part (auto-layout integration) is now done. The rest is UX polish! 🎉