- Single-shot: AI generated graph → STOP (no continuation)
- Or: Fixed 2-5 iterations regardless of complexity
- Fixed node counts: 8-15 nodes hardcoded
- No autonomy: System decides when to stop
- Self-directed phases: AI decides how many phases needed
- Autonomous evaluation: After each phase, AI reviews and decides
- No iteration limits: Only safety limits (50 phases, 200 nodes for extreme edge cases)
- Full context: AI sees ALL nodes (not truncated to 10)
- Explicit completion: AI signals "complete" when comprehensive
User: "Create Greek mythology graph"
Phase 1:
AI: Generates 12 Olympians
System: Commits to store
System: "Phase complete. Evaluating next phase..."
Phase Evaluation:
AI receives: Full graph state (all 12 nodes listed)
AI evaluates: "Main Olympians complete. Need to add Titans for generational context."
AI decision: "continue"
AI generates: 8 Titans
Phase 2:
System: Commits 8 Titans
System: "Phase complete. Evaluating next phase..."
Phase Evaluation:
AI receives: Full graph state (all 20 nodes: Olympians + Titans)
AI evaluates: "Graph now comprehensive with major deities. Hierarchies established."
AI decision: "complete"
Result: 20-node graph created in 2 autonomous phases
// Continue (needs more work)
{
"decision": "continue",
"reasoning": "Main Olympians complete (12 nodes). Now adding 8 Titans to show generational hierarchy.",
"response": "Adding Titans to expand the pantheon...",
"graphSpec": {
"nodes": [...8 Titan nodes...],
"edges": [...relationships...]
}
}
// Complete (graph is comprehensive)
{
"decision": "complete",
"reasoning": "Graph now has 30 Greek deities covering Olympians, Titans, and Heroes with family relationships.",
"response": "✅ Greek mythology graph complete with 30 deities!"
}Lines 338-351: Updated initial planner to explain self-directed execution
- Removed "5-iteration budget" language
- Added examples of autonomous phasing
- Emphasized starting with substantial first phase
Lines 431-439: Updated initial phase requirements
- Changed from fixed node counts to flexible foundation
- Emphasized core concepts over exhaustiveness
Lines 924-953: Removed iteration limits, added safety checks
- Removed
MAX_ITERATIONS = 2 - Removed
REASONABLE_NODE_COUNT = 15 - Added extreme safety limits: 50 phases, 200 nodes
- Changed from
warntodebugfor phase logging
Lines 1156-1212: Complete rewrite of continuation prompt
- Changed from "ITERATION X/Y" to "PHASE EVALUATION"
- Provide ALL nodes (not truncated to 10)
- Clear "continue" vs "complete" options
- Evaluation guidelines based on topic complexity
- Emphasis on being decisive and comprehensive
Lines 329-388: Re-enabled agent-controlled continuation loop
- Restored continuation call to
/api/ai/agent/continue - Send full graph state with ALL nodes
- Pass originalMessage and conversationHistory
- AI decides next action autonomously
- Phase limit: 50 phases max (extreme edge case)
- Node limit: 200 nodes max (sanity check)
- Timeout: Existing request timeouts still apply
- Error handling: Graceful fallback if AI fails to respond
- "Solar system" → 9 nodes → COMPLETE
- "Days of week" → 7 nodes → COMPLETE
- "Greek mythology" → Phase 1: 12 Olympians → Phase 2: 8 Titans → COMPLETE (20 nodes)
- "US Presidents" → Phase 1: Founding era → Phase 2: Modern era → COMPLETE
- "World War II" → Phase 1: Major powers → Phase 2: Leaders → Phase 3: Key battles → Phase 4: Outcomes → COMPLETE (40-60 nodes)
Ready to test with real requests. Expected improvements:
- ✅ Faster for simple topics (1 phase vs 5 iterations)
- ✅ More comprehensive for complex topics (AI decides when sufficient)
- ✅ No arbitrary stopping (AI evaluates, not hardcoded limits)
- ✅ Better quality (AI sees full context, makes informed decisions)
The bridge daemon has been restarted with the new autonomous agent loop active.