Get up and running with the Distributed Multi-Agent Communication Platform in minutes.
- Python 3.9 or higher
- Redis (optional, but recommended)
- Gemini API key
# Navigate to project directory
cd distributed_agent_platform
# Install dependencies
pip install -r requirements.txt# Copy example environment file
cp env.example .env
# Edit .env and add your Gemini API key
# GEMINI_API_KEY=your-key-hereIf you have Redis installed:
# macOS (Homebrew)
brew services start redis
# Linux
sudo systemctl start redis
# Windows
# Download and run Redis from https://redis.io/downloadIf Redis is not available, the system will fall back to in-memory queues.
python main.pyThe platform will start on http://localhost:8000
Open your browser to http://localhost:8000 to access the web dashboard.
The platform automatically creates four default agents on startup:
- Researcher Agent (
researcher_1): Specialized in information gathering - Analyst Agent (
analyst_1): Performs data analysis - Coordinator Agent (
coordinator_1): Orchestrates workflows - Knowledge Agent (
knowledge_1): Manages knowledge base
Using the dashboard:
- Enter "researcher_1" in "From Agent ID"
- Enter "knowledge_1" in "To Agent ID"
- Select "Query" as message type
- Enter your query: "What is machine learning?"
- Click "Send Message"
curl http://localhost:8000/agentscurl -X POST http://localhost:8000/messages/send \
-H "Content-Type: application/json" \
-d '{
"from_agent": "researcher_1",
"to_agent": "analyst_1",
"content": "Please analyze this data: Sales increased 20%",
"message_type": "task"
}'curl http://localhost:8000/metricsConnect an agent via WebSocket:
import asyncio
import websockets
import json
async def connect_agent():
uri = "ws://localhost:8000/ws/researcher_1"
async with websockets.connect(uri) as websocket:
# Send a message
message = {
"id": "msg_1",
"from_agent": "researcher_1",
"to_agent": "analyst_1",
"type": "text",
"content": "Hello from WebSocket!"
}
await websocket.send(json.dumps(message))
# Receive response
response = await websocket.recv()
print(json.loads(response))
asyncio.run(connect_agent())from backend.agents.researcher_agent import ResearcherAgent
from backend.core.agent_manager import AgentManager
from backend.services.vector_service import VectorService
# Initialize services
vector_service = VectorService()
await vector_service.initialize()
# Create agent
researcher = ResearcherAgent(
agent_id="my_researcher",
name="My Researcher",
vector_service=vector_service
)
# Register with manager
agent_manager = AgentManager()
await agent_manager.register_agent(
researcher.agent_id,
researcher.name,
researcher.agent_type,
researcher.get_capabilities()
)from backend.models.message import Message, MessageType
# Create message
message = Message(
id="msg_1",
from_agent="researcher_1",
to_agent="analyst_1",
type=MessageType.TASK,
content="Analyze this data: ..."
)
# Send via agent manager
response = await agent_manager.send_message(
from_agent="researcher_1",
to_agent="analyst_1",
content="Analyze this data: ...",
message_type=MessageType.TASK
)# Add knowledge
doc_id = await vector_service.add_knowledge(
content="Python is a programming language.",
metadata={"category": "programming"}
)
# Search knowledge
results = await vector_service.search(
query="What is Python?",
n_results=5
)Run the test suite:
pytest tests/Run with coverage:
pytest --cov=backend --cov-report=html tests/If you see Redis connection errors, the system will automatically fall back to in-memory queues. For production, ensure Redis is running.
Make sure your GEMINI_API_KEY is set in the .env file and is valid.
If port 8000 is in use, change it in .env:
SERVER_PORT=8001
If ChromaDB initialization fails, check that the data/vectorstore directory is writable.
- Read the Architecture Documentation
- Explore the API Documentation
- Check out example integrations in the
examples/directory - Customize agents for your use case