👥Multi Agents

multiple independent actors powered by language models connected in a specific way.

Each agent can have its own prompt, LLM, tools, and other custom code to best collaborate with the other agents.

That means there are two main considerations when thinking about different multi-agent workflows:

  1. What are the multiple independent agents?

  2. How are those agents connected?

This thinking lends itself incredibly well to a graph representation, such as that provided by langgraph. In this approach, each agent is a node in the graph, and their connections are represented as an edge. The control flow is managed by edges, and they communicate by adding to the graph's state.

Note: a very related concept here is the concept of state machines, which we explicitly called out as a category of cognitive architectures. When viewed in this way, the independent agent nodes become the states, and how those agents are connected is the transition matrices. Since a state machine can be viewed as a labeled, directed grapharrow-up-right, we will think of these things in the same way.

Benefits of multi-agent designs

"If one agent can't work well, then why is multi-agent useful?"

  • Grouping tools/responsibilities can give better results. An agent is more likely to succeed on a focused task than if it has to select from dozens of tools.

  • Separate prompts can give better results. Each prompt can have its own instructions and few-shot examples. Each agent could even be powered by a separate fine-tuned LLM!

  • Helpful conceptual model to develop. You can evaluate and improve each agent individually without breaking the larger application.

Multi-agent designs allow you to divide complicated problems into tractable units of work that can be targeted by specialized agents and LLM programs.

1) Principal Agent Node

The Principal Agent node acts as the main controller that coordinates and manages multiple specialist agents.

Key Features:

• Central Coordination: Controls the flow between multiple agents. • Tool Integration: Can use tools through connected chat models. • Memory Support: Maintains context using agent memory. • Input Moderation: Filters inputs before processing.

Setup Requirements:

  1. Add the Principal Agent node to the canvas.

  2. Connect Tool Calling Chat Model.

  3. Connect Agent Memory if required.

  4. Connect Input Moderation if needed.

  5. Enter Supervisor Name.

  6. Configure Additional Parameters if required.

Use Cases:

• Multi-agent workflows. • Complex task orchestration using multiple agents.

2) Specialist Agent Node

The Specialist Agent node performs specific tasks assigned by the Principal Agent using tools and prompts.

Key Features:

• Task-Specific Execution: Handles specialized tasks. • Tool Usage: Can use connected tools for task completion. • Prompt-Based Behavior: Works based on defined worker prompt. • Iterative Processing: Supports multiple iterations for better results.

Setup Requirements:

  1. Add the Specialist Agent node to the canvas.

  2. Connect required Tools.

  3. Connect Supervisor (Principal Agent).

  4. Connect Tool Calling Chat Model.

  5. Enter Worker Name.

  6. Define Worker Prompt.

  7. Configure Format Prompt Values if required.

  8. Set Max Iterations.

Use Cases:

• Research assistants. • Task-specific automation agents. • Multi-agent collaboration systems.

Last updated