Platform
AI Swarms
Swarms let you compose multiple AI deployments into a coordinated multi-agent system. A swarm defines a topology of agent roles — each backed by a real BRICQS deployment — and routes tasks across them according to a configurable orchestration policy.
Creating a swarm
Define a swarm with a YAML manifest or via the console. Each agent references an existing BRICQS deployment by ID:
yamlname: code-review-swarm
project_id: proj_abc123
agents:
- role: planner
deployment_id: dep_llama3_70b
system_prompt: "You are a senior architect. Break the task into subtasks."
- role: coder
deployment_id: dep_codestral
system_prompt: "You are a software engineer. Implement the given subtask."
- role: critic
deployment_id: dep_mixtral_8x7b
system_prompt: "Review the code for correctness, security, and style."
policy:
mode: sequential # sequential | parallel | tournament
max_rounds: 3
aggregation: last_agent # last_agent | vote | concatenatebricqs swarms create --file swarm.yamlInvoking a swarm
A swarm exposes a single endpoint. Send a task and receive the aggregated result:
pythonimport requests
resp = requests.post(
"https://api.bricqsai.com/v1/swarms/<swarm-id>/run",
headers={"Authorization": "Bearer <api-key>"},
json={
"task": "Refactor the authentication middleware to use JWT instead of sessions.",
"context": {"repo": "my-app", "file": "middleware/auth.py"},
},
)
result = resp.json()
print(result["output"]) # final aggregated output
print(result["trace"]) # per-agent step traceOrchestration modes
sequentialAgents run in order. Each agent receives the output of the previous one as additional context.parallelAll agents run simultaneously with the same input. Outputs are aggregated at the end.tournamentAgents run independently; a judge agent (configurable) scores each output and selects the best.Swarm traces
Every swarm run produces a step-by-step trace showing each agent's input, output, latency, and token usage. Access traces from the console or API:
bash# Get a run trace
curl https://api.bricqsai.com/v1/swarms/<swarm-id>/runs/<run-id>/trace \
-H "Authorization: Bearer <api-key>"Note: Swarms are billed per agent call — each deployment in the swarm is billed at its own GPU-hour rate. A 3-agent sequential swarm with 3 rounds makes up to 9 deployment calls per invocation.