Skip to content

Agent Network

class versionhq.agent_network.model.AgentNetwork

A Pydantic class to store AgentNetwork objects that handle multiple agent formations for the task execution.

You can specify a desired formation or allow the agents to determine it autonomously (default).

Solo Agent Supervising Squad Random
Formation solo solo solo solo
Usage
  • A single agent with tools, knowledge, and memory.
  • When self-learning mode is on - it will turn into Random formation.
  • Leader agent gives directions, while sharing its knowledge and memory.
  • Subordinates can be solo agents or networks.
  • Share tasks, knowledge, and memory among network members.
  • A single agent handles tasks, asking help from other agents without sharing its memory or knowledge.
Use case An email agent drafts promo message for the given audience. The leader agent strategizes an outbound campaign plan and assigns components such as media mix or message creation to subordinate agents. An email agent and social media agent share the product knowledge and deploy multi-channel outbound campaign. 1. An email agent drafts promo message for the given audience, asking insights on tones from other email agents which oversee other clusters. 2. An agent calls the external agent to deploy the campaign.

Quick Start

By default, lead agents will determine the best network formation autonomously based on the given task and its goal.

Calling .launch() method can start executing tasks and generate a tuple of response as a TaskOutput object and TaskGraph object.

import versionhq as vhq

network = vhq.form_agent_network(
  task=f"create a promo plan to attract a client",
  expected_outcome='media mix, key messages, and CTA targets.'
)

res, tg = network.launch()

assert isinstance(res, vhq.TaskOutput)
assert isinstance(tg, vhq.TaskGraph)

Ref. TaskOutput / TaskGraph class.

Visit Playground.