Agents API Reference¶
Overview¶
The Agents API provides endpoints for managing and interacting with AIDDDMAP's AI agents, including the core 6+1 agents and custom agents created through UADM.
Authentication Requirements¶
All API requests require authentication using an API key:
API Base URL¶
Agent Management Endpoints¶
Agent List Retrieval¶
Returns a list of all available agents for the authenticated user.
Agent List Response¶
{
"agents": [
{
"id": "df-001",
"name": "DataFinder",
"type": "core",
"status": "active",
"capabilities": ["search", "discovery", "validation"]
},
{
"id": "custom-001",
"name": "CustomAgent",
"type": "uadm",
"status": "active",
"capabilities": ["processing"]
}
]
}
Agent Deployment¶
Deploy an agent to the IDAT canvas or specific workflow.
Agent Deployment Request Body¶
{
"agentId": "df-001",
"workflowId": "workflow-123",
"configuration": {
"mode": "active",
"parameters": {
"searchDepth": 3,
"timeout": 30000
}
}
}
Agent Deployment Response¶
{
"deploymentId": "deploy-456",
"status": "success",
"agent": {
"id": "df-001",
"status": "deployed"
}
}
Agent Status Retrieval¶
Get the current status and metrics of a specific agent.
Agent Status Response¶
{
"id": "df-001",
"status": "active",
"metrics": {
"tasksCompleted": 45,
"uptime": "2d 3h",
"lastActivity": "2024-01-14T12:00:00Z"
}
}
Agent Configuration Update¶
Update the configuration of a deployed agent.
Configuration Update Request Body¶
Configuration Update Response¶
Agent Communication Endpoints¶
Agent Message Sending¶
Send a message or command to a specific agent.
Message Request Body¶
{
"type": "command",
"content": {
"action": "search",
"parameters": {
"query": "health data",
"limit": 10
}
}
}
Message Response¶
{
"messageId": "msg-789",
"status": "received",
"response": {
"type": "acknowledgement",
"content": "Search initiated"
}
}
Agent Chat History Retrieval¶
Retrieve chat history with a specific agent.
Chat History Response¶
{
"messages": [
{
"id": "msg-123",
"timestamp": "2024-01-14T11:00:00Z",
"sender": "user",
"content": "Start data search"
},
{
"id": "msg-124",
"timestamp": "2024-01-14T11:00:05Z",
"sender": "agent",
"content": "Search initiated"
}
]
}
UADM Integration Endpoints¶
Custom Agent Creation¶
Create a new custom agent through UADM.
Custom Agent Request Body¶
{
"name": "CustomProcessor",
"description": "Custom data processing agent",
"capabilities": ["processing", "analysis"],
"configuration": {
"model": "gpt-4",
"parameters": {
"maxTokens": 1000
}
}
}
Custom Agent Response¶
API Error Responses¶
The API uses standard HTTP response codes:
200- Success400- Bad Request401- Unauthorized403- Forbidden404- Not Found500- Internal Server Error
Error response format:
{
"error": {
"code": "INVALID_PARAMETER",
"message": "Invalid agent configuration parameter",
"details": {
"parameter": "searchDepth",
"reason": "Must be between 1 and 10"
}
}
}
API Rate Limiting¶
API requests are limited to:
- 100 requests per minute for standard users
- 1000 requests per minute for enterprise users
Rate limit headers are included in responses:
WebSocket Connection Guide¶
For real-time agent communication:
const ws = new WebSocket("wss://api.aidddmap.com/v1/agents/websocket");
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log("Agent update:", data);
};
SDK Code Examples¶
TypeScript Implementation¶
import { AIDDDMAPClient } from "@aidddmap/sdk";
const client = new AIDDDMAPClient({
apiKey: "YOUR_API_KEY",
});
// Deploy an agent
await client.agents.deploy("df-001", {
workflowId: "workflow-123",
configuration: {
mode: "active",
},
});
// Send message to agent
await client.agents.sendMessage("df-001", {
type: "command",
content: {
action: "search",
parameters: {
query: "health data",
},
},
});
Python Implementation¶
from aidddmap import Client
client = Client(api_key='YOUR_API_KEY')
# Deploy an agent
response = client.agents.deploy(
agent_id='df-001',
workflow_id='workflow-123',
configuration={
'mode': 'active'
}
)
# Send message to agent
response = client.agents.send_message(
agent_id='df-001',
message={
'type': 'command',
'content': {
'action': 'search',
'parameters': {
'query': 'health data'
}
}
}
)