Learn how to create two agents and setup the communication using the eggai SDK.
Key features:
- Agent Collaboration: Two agents working together in an event-driven environment.
- Asynchronous Execution: Agents are designed to process tasks concurrently, ensuring efficiency.
- Scalable Infrastructure: Powered by Kafka for reliable messaging and streaming.
Here is a simplified architecture overview:
The code for the example can be found here. Let's dive in.
Clone the EggAI repository:
git clone git@github.com:eggai-tech/EggAI.gitMove into the examples/getting_started folder:
cd examples/getting_startedCreate and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # For Windows: venv\Scripts\activateInstall the required dependencies:
pip install -r requirements.txtpython main.pyExpected output:
[ORDER AGENT]: Received request to create order. order_requested {'product': 'Laptop', 'quantity': 1}
[ORDER AGENT]: Received order created event. order_created {'product': 'Laptop', 'quantity': 1}
[EMAIL AGENT]: Received order created event. order_created {'product': 'Laptop', 'quantity': 1}
What happens:
- Agent 1 sends a message to Agent 2.
- Agent 2 processes the message and sends a response.
- The framework handles message passing, retries, and logging.
Congratulations! You've successfully run your first EggAI Multi-Agent application.
Ready to explore further? Check out:
- Advanced Examples: Discover more complex use cases in the examples folder.
- Contribution Guidelines: Get involved and help improve EggAI!
- GitHub Issues: Submit a bug or feature request.
- Documentation: Refer to the official docs for deeper insights.
