π¦Main Guide
This guide will help you get started with AIMXT by walking you through the creation of a simple multi-agent system. We'll build an example where agents collaborate to schedule a meeting based on participants' availability.
Step 1: Install AIMXT
First, you'll need to install the AIMXT framework. You can do this via pip:
pip install AIMXTStep 2: Define Your Agents
In this example, we'll create three agents:
AvailabilityAgent: Checks the availability of participants.
SchedulerAgent: Proposes possible meeting times based on availability.
NotifierAgent: Notifies participants about the scheduled meeting.
Here's how you can define these agents:
from AIMXT import Agent, AgentJobStepRequest, AgentJobResponse, JobRequest, JobSteps, Step, RunnerAgent
class AvailabilityAgent(Agent):
async def execute_request(self, request: AgentJobStepRequest) -> AgentJobResponse:
# Simulate checking participant availability
return AgentJobResponse(
worker=self.details().name,
job_data={"available_times": ["10:00 AM", "2:00 PM", "4:00 PM"]}
)
class SchedulerAgent(Agent):
async def execute_request(self, request: AgentJobStepRequest) -> AgentJobResponse:
available_times = request.job_data["available_times"]
# Simulate selecting the best time (e.g., the first available slot)
best_time = available_times[0]
return AgentJobResponse(
worker=self.details().name,
job_data={"scheduled_time": best_time}
)
class NotifierAgent(Agent):
async def execute_request(self, request: AgentJobStepRequest) -> AgentJobResponse:
scheduled_time = request.job_data["scheduled_time"]
# Simulate notifying participants
return AgentJobResponse(
worker=self.details().name,
job_data={"notification": f"Meeting scheduled at {scheduled_time}"}
)Step 3: Create a Runner Agent
The RunnerAgent will orchestrate the execution of the job. We need to create instances of our agents and then define the sequence in which they will be executed.
Step 4: Define the Job
Next, we'll define the job that these agents will execute. The job consists of multiple steps, each handled by a different agent.
Step 5: Execute the Job
Finally, we'll execute the job and print the result:
Complete Code Example
Hereβs the complete code for the example:
What This Example Does
AvailabilityAgent checks the availability of participants and returns possible meeting times.
SchedulerAgent selects the best available time for the meeting.
NotifierAgent sends a notification with the scheduled meeting time.
This simple example demonstrates how to set up a multi-agent system with AIMXT, where each agent has a specific role and contributes to completing the overall task.
Last updated