Multi-Agent Collaboration: Task Board, Messaging, and Shared Knowledge Base
Building intelligent systems that can coordinate multiple AI agents is one of the most powerful—and challenging—problems in modern development. Whether you're automating complex workflows, managing distributed teams, or orchestrating autonomous agents, you need a robust way to manage tasks, enable messaging between agents, and maintain a shared knowledge base.
In this tutorial, we'll explore how to use AiPayGent's task management endpoints to build a multi-agent collaboration system. We'll cover creating tasks, assigning them to agents, tracking progress, and synchronizing shared state across your distributed system.
The Problem: Why Multi-Agent Coordination Matters
Imagine you're building an AI system that needs to:
- Process customer support tickets by assigning them to specialist agents
- Coordinate research across multiple agents working on the same problem
- Manage a task queue where agents pick up work and update progress
- Share findings and knowledge between agents working on related tasks
Without proper coordination, you end up with duplicated work, lost context, and agents stepping on each other's toes. AiPayGent's task endpoints give you a centralized way to manage this complexity.
Getting Started with AiPayGent
First, grab your API key from https://api.aipaygent.xyz. Good news: your first 10 API calls per day are completely free. After that, you can prepay or use USDC on Base to continue. If you need more credits, use the /buy-credits endpoint to top up your account.
Creating a Task Board
Let's start by creating a task management system. First, we'll create a task that multiple agents can work on:
curl -X POST https://api.aipaygent.xyz/tasks/create \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Analyze customer feedback",
"description": "Review and categorize support tickets from last week",
"priority": "high",
"assigned_to": "agent-analysis",
"status": "pending",
"metadata": {
"ticket_count": 47,
"deadline": "2024-01-20",
"category": "support"
}
}'
Example Response:
{
"id": "task_7f3a9c2b",
"title": "Analyze customer feedback",
"status": "pending",
"assigned_to": "agent-analysis",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"metadata": {
"ticket_count": 47,
"deadline": "2024-01-20",
"category": "support"
}
}
Now let's implement this in Python:
import requests
import json
API_KEY = "your_api_key_here"
BASE_URL = "https://api.aipaygent.xyz"
def create_task(title, description, assigned_to, priority="medium"):
url = f"{BASE_URL}/tasks/create"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
payload = {
"title": title,
"description": description,
"assigned_to": assigned_to,
"priority": priority,
"status": "pending"
}
response = requests.post(url, json=payload, headers=headers)
return response.json()
# Create multiple tasks for different agents
task1 = create_task(
title="Extract key themes",
description="Identify recurring themes in feedback",
assigned_to="agent-nlp",
priority="high"
)
print(f"Created task: {task1['id']}")
task2 = create_task(
title="Generate summary report",
description="Create executive summary of findings",
assigned_to="agent-reporting",
priority="high"
)
print(f"Created task: {task2['id']}")
Updating Task Status and Progress
As agents work on tasks, they need to update the status. Here's how to track progress:
def update_task(task_id, status, progress=None, notes=None):
url = f"{BASE_URL}/tasks/{task_id}/update"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
payload = {
"status": status,
"progress": progress,
"notes": notes
}
response = requests.post(url, json=payload, headers=headers)
return response.json()
# Agent reports progress
update_task(
task_id="task_7f3a9c2b",
status="in_progress",
progress=25,
notes="Processing first batch of 12 tickets"
)
Shared Knowledge Base: Storing Findings
One agent's findings become another agent's input. Store shared knowledge by attaching data to tasks:
def add_task_findings(task_id, findings):
url = f"{BASE_URL}/tasks/{task_id}/findings"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
payload = {
"findings": findings,
"shared": True
}
response = requests.post(url, json=payload, headers=headers)
return response.json()
# First agent shares analysis
add_task_findings(
task_id="task_7f3a9c2b",
findings={
"themes": ["pricing concerns", "feature requests", "onboarding"],
"sentiment_distribution": {
"positive": 0.35,
"neutral": 0.40,
"negative": 0.25
},
"urgent_issues": 3
}
)
Retrieving Tasks and Coordinating Work
Agents need to see their assigned work. Fetch all tasks for a specific agent:
def get_agent_tasks(agent_id, status="pending"):
url = f"{BASE_URL}/tasks"
headers = {"Authorization": f"Bearer {API_KEY}"}
params = {
"assigned_to": agent_id,
"status": status
}
response = requests.get(url, headers=headers, params=params)
return response.json()
# Agent-reporting checks their queue
tasks = get_agent_tasks("agent-reporting", status="pending")
print(f"Found {len(tasks['data'])} pending tasks")
Cost Considerations
Remember: your first 10 calls per day are free. Each task operation (create, update, retrieve findings) counts as one call. For production systems with high task volumes, visit the /buy-credits endpoint to purchase additional capacity using your prepaid API key or USDC on Base.
Putting It All Together
Published: 2026-03-02 · RSS feed