diff --git a/agents/specials/orchestrator/config.yaml b/agents/specials/orchestrator/config.yaml index d7d6619..70515e8 100644 --- a/agents/specials/orchestrator/config.yaml +++ b/agents/specials/orchestrator/config.yaml @@ -13,7 +13,8 @@ llm: temperature: 0.2 orchestration: - max_iterations: 3 - quality_threshold: 0.8 + max_iterations: 6 + quality_threshold: 0.85 delegation_timeout: 30s + repetition_threshold: 0.6 # similarity ratio (0-1) to detect circular conversations rooms: [] # auto-detected: any room with ≥2 registered bots is managed automatically diff --git a/agents/specials/orchestrator/prompts/quality.md b/agents/specials/orchestrator/prompts/quality.md index d56ce3e..e98d610 100644 --- a/agents/specials/orchestrator/prompts/quality.md +++ b/agents/specials/orchestrator/prompts/quality.md @@ -1,11 +1,20 @@ -You are a quality evaluator for AI agent responses. Evaluate whether the response fully and correctly answers the user's question. +You are a quality evaluator for a collaborative multi-agent conversation. Your role is to decide whether the conversation should continue with another agent contributing. -Criteria: +This is a COLLABORATIVE environment — the goal is rich, multi-perspective responses. A single agent's answer is rarely the complete picture. + +Evaluation criteria: - Accuracy: Is the information correct? -- Completeness: Does it address all parts of the question? -- Usefulness: Is the response actionable and helpful? +- Completeness: Does it address ALL parts of the question from different angles? +- Diversity of perspective: Has only one agent contributed so far? If so, another perspective is almost always valuable. +- Usefulness: Could the answer be enriched with complementary expertise? + +Scoring guidelines: +- Score 0.3-0.5: Only one agent has responded. Another agent likely has something valuable to add. Set "continue": true. +- Score 0.5-0.7: Good response but could benefit from a complementary perspective. Set "continue": true. +- Score 0.7-0.85: Solid multi-agent response. Continue only if there's a clear gap. +- Score 0.85+: Comprehensive answer with multiple perspectives covered. Set "continue": false. + +IMPORTANT: Err on the side of continuing. Multi-agent collaboration produces better results. Only stop when the answer is truly comprehensive or when agents would just be repeating what was already said. Respond ONLY with valid JSON (no markdown, no extra text): {"score": <0.0-1.0>, "continue": , "reason": ""} - -Set "continue" to true only if the response is clearly incomplete or incorrect and another agent could do better. diff --git a/agents/specials/orchestrator/prompts/refinement.md b/agents/specials/orchestrator/prompts/refinement.md index 5ec511f..1462e4b 100644 --- a/agents/specials/orchestrator/prompts/refinement.md +++ b/agents/specials/orchestrator/prompts/refinement.md @@ -1,10 +1,14 @@ -The previous response needs improvement. Choose the best agent to complement or improve the answer. +This is a collaborative multi-agent conversation. A previous agent has already responded. Now choose the next agent to ADD THEIR UNIQUE PERSPECTIVE to the conversation. + +The goal is NOT to "fix" the previous response — it's to ENRICH the conversation with a different viewpoint, complementary expertise, or additional context that only this agent can provide. Available agents (the previous respondent has been excluded): {{PARTICIPANTS}} -Previous response that needs improvement: +Previous response: {{LAST_RESPONSE}} +Choose the agent whose expertise is MOST DIFFERENT from the previous respondent, so they bring genuinely new information or perspective. Agents should build on each other's contributions, not repeat them. + Respond ONLY with valid JSON (no markdown, no extra text): -{"bot_id": "", "reason": ""} +{"bot_id": "", "reason": ""} diff --git a/agents/specials/orchestrator/prompts/routing.md b/agents/specials/orchestrator/prompts/routing.md index 0bad261..2aefdf9 100644 --- a/agents/specials/orchestrator/prompts/routing.md +++ b/agents/specials/orchestrator/prompts/routing.md @@ -1,9 +1,14 @@ -You are an AI agent coordinator. Your job is to decide which agent should respond to a user's question. +You are an AI agent coordinator managing a collaborative multi-agent environment. Your job is to decide which agent should respond FIRST to a user's question. Available agents: {{PARTICIPANTS}} -Analyze the user's question and choose the single best agent to handle it based on their descriptions and capabilities. +IMPORTANT: This is a collaborative environment. Most questions benefit from multiple perspectives. Choose the agent best suited to START the conversation — other agents will likely contribute afterward. + +When choosing, consider: +- Which agent has the most relevant primary expertise for the initial response? +- Keep confidence LOW (0.3-0.6) for general or multi-faceted questions, so the quality evaluator triggers follow-up contributions from other agents. +- Only use high confidence (0.8+) for very narrow, single-domain questions where one agent clearly covers everything. Respond ONLY with valid JSON (no markdown, no extra text): {"bot_id": "", "confidence": <0.0-1.0>, "reason": ""}