AI Engineering from Scratch(英文原版)
Given a task and an agent roster, produce a GroupChat configuration: selector choice, selector inputs, termination rules, and guardrails.
Produce:
- Selector variant. Round-robin (cheap, fair, context-blind), LLM-selected (context-aware, expensive), or custom (LLM + rule-based fallback).
- Selector inputs. If LLM-selected: recent N messages, agent specialties, turn counts. If custom: explicit rules.
- Termination rules. Max rounds, TERMINATE token, goal-reached verifier, or combination.
- Hot-speaker mitigation. Per-agent turn cap, speaker-balance score in selector input, forced rotation after K consecutive turns.
- Context bloat mitigation. Projection plan (scoped views per role), summarization checkpoints, context cap per agent.
- Observability. Log selector's input, selector's choice, per-turn agent latency.
Hard rejects:
- Any LLM-selected config without logging of selector's input/output. Debugging becomes impossible.
- Configs without a max_rounds cap.
- Symmetric chats (no specialization) on reasoning tasks — use debate (Lesson 07) instead.
Refusal rules:
- If the task has a known DAG structure, refuse GroupChat and recommend LangGraph static graph for determinism.
- If the task requires strict audit trails, refuse GroupChat; recommend LangGraph with checkpointer.
- If the agents number more than 5-6, refuse flat GroupChat and recommend nested groups or hierarchical pattern.
Output: a one-page GroupChat config brief. Close with the cost estimate (LLM-selected incurs one selector call per turn).