Skip to main content
The simplest of the Group Chat patterns, the Organic pattern utilizes entirely LLM-based transitions using the underlying Group Chat Manager using the AutoPattern pattern. The Group Chat Manager uses the messages together with a set of the group chat’s agent’s description fields to determine the next agent. No hand-offs are specified as determining the next agent is solely done by the Group Chat Manager. The shared context variables can still be used and updated via the agent’s tools, though they don’t play a role in determining the workflow. This pattern excels in situations where conversation flow is unpredictable or where defining explicit rules would be overly complex. The organic approach creates a fluid user experience as different specialists naturally join the conversation when their expertise becomes relevant.

Key Characteristics

Organic Pattern The Organic Pattern creates a natural flow of agent interactions without explicit routing rules, allowing the system to adapt dynamically to conversation needs.
  • Natural Flow: Transitions between agents happen organically based on the conversation context and content rather than predetermined paths.
  • Description-Based Routing: The Group Chat Manager selects the next agent based on agent descriptions and how well they match the current conversation needs.
  • Minimal Configuration: No explicit handoff rules need to be defined, making this the simplest pattern to implement while maintaining sophisticated routing capabilities.

Information Flow

Organic Flow Pattern In the Organic Pattern, information flows through the system based on content analysis and agent relevance, creating a fluid conversation experience that mimics natural human team collaboration.
  • Content Analysis: The Group Chat Manager analyzes each message to understand the context and requirements of the current conversation stage.
  • Agent Selection: Based on this analysis, the system identifies and selects the most relevant specialist whose description best matches the current needs.

Implementation

Our implementation using AG2’s Group Chat demonstrates the Organic Pattern with a team of specialized agents whose expertise areas are clearly defined in their descriptions, allowing the Group Chat Manager to make intelligent routing decisions.
  • Descriptive Agent Profiles: Each agent includes a detailed description field that clearly outlines their domain expertise and when they should be activated. Note, the system_message field will be used if an agent’s description field is not specified - however, it is better to define description separately for use by the Group Chat Manager, see the differences between description and system_message in the example below.
  • Group Chat Manager Configuration: The implementation uses the GroupManagerTarget target for the chat’s After Work to delegate all routing decisions to the Group Chat Manager and we provide the Group Chat Manager with an LLM through the group_manager_args parameter on the AutoPattern.
  • No Explicit Handoffs: Unlike other patterns, no handoffs are required as the Group Chat Manager handles all transitions automatically.
  • Shared Context: While not used for routing decisions, shared context variables can still be used for maintaining state across different agents. In this example it’s not used.

Agent Flow

Code

In this code example we use OpenAI’s GPT-4o mini.

Output