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.
Parameter | Type | Default | Description |
---|---|---|---|
name | Text | [required] | The unique name of the team agent. |
agents | List[Text | Agent] | [required] | A list of agent names or objects to include in the team agent. |
llm_id | Text | "669a63646eb56306647e1091" | ID of the large language model (LLM) powering the team agent. |
description | Text | "" | A brief description of the team agent's purpose. |
api_key | Text | config.TEAM_API_KEY | API key for authenticating requests to manage the team agent. |
vendor | Dict | Text | Any | int | "aiXplain" | The owner or provider of the team agent. |
version | Text | None | None | The version number of the team agent for tracking updates. |
use_mentalist_and_inspector | bool | True | Enables 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.
Method | Description |
---|---|
create | Creates a new Team Agent with specified parameters, agents, and configurations. |
list | Lists all Team Agents available on the platform for the given API key. |
get | Retrieves the details of a Team Agent using its unique ID. |
run | Executes the Team Agent on specified input data or query, providing results. |
run_async | Executes the Team Agent asynchronously, returning a polling URL for the response. |
delete | Deletes the Team Agent configuration from the platform. |
to_dict | Converts the Team Agent's configuration and metadata to a dictionary format. |
validate | Validates the Team Agent by checking its agents, name, and associated LLM. |
update | Updates the Team Agent with new configurations and metadata. |
deploy | Deploys the Team Agent, changing its status from DRAFT to ONBOARDED . |
Create a team agent by following this multi-purpose text agent tutorial.