Skip to main content

Team Agents

Team Agents are a sophisticated type of agent on the aiXplain platform, designed for handling complex, multi-step tasks that require coordination between multiple components. By leveraging a system of specialized agents, tools, and workflows, Team Agents excel in scenarios that demand advanced task planning, quality control, and adaptability.

Team Agent Architecture

  • Mentalist: Handles task decomposition, planning, and dynamic re-planning as needed.

  • Inspector: Ensures outputs meet user-defined criteria, focusing on quality and consistency.

  • Bodyguard: (Coming Soon) Implements security measures, enforcing data access and privacy policies.

  • Orchestrator: Central LLM that coordinates tasks and invokes appropriate tools or agents.

Example

This example demonstrates a team agent that combines the functionalities of individual agents for text analysis, multimedia processing, and other tasks. It uses a specified large language model (LLM) to coordinate the agents.

from aixplain.factories import TeamAgentFactory

team = TeamAgentFactory.create(
name="Team of Agents for Text Audio and Image Processing",
agents=[
text_analysis_agent,
multimedia_agent,
],
llm_id="6646261c6eb563165658bbb1"
)

Guide to Building the Example Team Agent

Initialize the Team Agent

Define the team agent with a name, list of individual agents, and the LLM to manage interactions.

from aixplain.factories import TeamAgentFactory

team = TeamAgentFactory.create(
name="Team of Agents for Text Audio and Image Processing",
agents=[
text_analysis_agent,
multimedia_agent,
],
llm_id="6646261c6eb563165658bbb1"
)

Run the Team Agent

Execute the team agent with specific inputs and evaluate its combined response.

response = team.run("Process this audio and analyze the text content.")
print(response)

Update the Team Agent

Make modifications to the team agent configuration or replace agents as needed.

new_agent = AgentFactory.create(
name="Search Agent",
description="Conduct search based on given topic."
)
new_agent

team.agents.append(new_agent)
team.update()

Debug the Team Agent

Test and refine the team agent:

  • Check individual agents' performance and outputs.
  • Evaluate interactions between agents for seamless task execution.
  • Fine-tune the LLM or individual agents for optimized results.

Deploy the Team Agent

Save the team agent configuration to the platform and deploy it for production.

team.deploy()

Team Agent Parameters

Defines the configuration options for creating a team agent, including its name, included agents, LLM, and advanced features.

ParameterTypeDefaultDescription
nameText[required]The unique name of the team agent.
agentsList[Text | Agent][required]A list of agent names or objects to include in the team agent.
llm_idText"669a63646eb56306647e1091"ID of the large language model (LLM) powering the team agent.
descriptionText""A brief description of the team agent's purpose.
api_keyTextconfig.TEAM_API_KEYAPI key for authenticating requests to manage the team agent.
vendorDict | Text | Any | int"aiXplain"The owner or provider of the team agent.
versionText | NoneNoneThe version number of the team agent for tracking updates.
use_mentalist_and_inspectorboolTrueEnables advanced features for supervision and planning when a supervisor is used.

Team Agent Methods

Provides key functions to create, list, and retrieve team agents on the platform.

MethodDescription
createCreates a new Team Agent with specified parameters, agents, and configurations.
listLists all Team Agents available on the platform for the given API key.
getRetrieves the details of a Team Agent using its unique ID.
runExecutes the Team Agent on specified input data or query, providing results.
run_asyncExecutes the Team Agent asynchronously, returning a polling URL for the response.
deleteDeletes the Team Agent configuration from the platform.
to_dictConverts the Team Agent's configuration and metadata to a dictionary format.
validateValidates the Team Agent by checking its agents, name, and associated LLM.
updateUpdates the Team Agent with new configurations and metadata.
deployDeploys the Team Agent, changing its status from DRAFT to ONBOARDED.

Create a team agent by following this multi-purpose text agent tutorial.