This repository provides a step-by-step guide to setting up and running multiple AI agents using aiXplain's framework. It includes installation, setup, and execution details to help you deploy and manage agents efficiently.
This project demonstrates how to set up and manage multiple AI agents using aiXplain. The agents can interact, process tasks, and execute AI-based workloads.
Ensure you have Python installed (version 3.8 or higher). Then, install the required dependencies:
pip install aixplain-sdkTo authenticate with aiXplain, set up your API key as an environment variable:
export AIXPLAIN_API_KEY='your_api_key_here'Note: Never expose your API key publicly.
Create and execute a Python script to initialize and run multiple agents:
import aixplain as axp
# Initialize multiple agents
agent1 = axp.Agent("agent_id_1")
agent2 = axp.Agent("agent_id_2")
# Perform tasks
data = "Sample input data"
output1 = agent1.process(data)
output2 = agent2.process(data)
print("Agent 1 Output:", output1)
print("Agent 2 Output:", output2)Run the script:
python run_agents.pyTo deploy the agents on a cloud platform, use Docker or a cloud function:
- Create a Dockerfile:
FROM python:3.8
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
CMD ["python", "run_agents.py"]- Build and run the container:
docker build -t multi-agent .
docker run -e AIXPLAIN_API_KEY=$AIXPLAIN_API_KEY multi-agent- Ensure your API key is correctly set.
- Check Python dependencies.
- Use
docker logsto debug container issues.
This project is a foundation for scaling multi-agent AI solutions using aiXplain. Feel free to contribute!