Skip to content

Multi-agent workflows

Complex business processes rarely fit a single agent. Alquimia Platform supports agent-to-agent (A2A) delegation so specialized agents can collaborate while the platform maintains a single, auditable execution context.

A procurement request arrives by email. A routing agent reads the message, extracts the request type, and delegates to the appropriate specialist:

  • Vendor agent checks approved vendor lists and contract terms.
  • Pricing agent validates budget and historical spend.
  • Approval agent routes the request to the right manager when spend exceeds a threshold.

Each specialist returns a structured result, and the routing agent assembles the final response.

Specialist agents are registered in the same agentspace as the coordinator and discovered by capability or tag. The coordinator does not hard-code URLs or assistant IDs; it asks the registry for agents matching a selector.

Terminal window
# Register specialists with shared tags
alquimia registry agents add vendor-agent.json --namespace procurement
alquimia registry agents add pricing-agent.json --namespace procurement
alquimia registry agents add approval-agent.json --namespace procurement

The coordinator references the pool by tag:

{
"assistant_id": "procurement-coordinator",
"role": "operator",
"response": {
"provider_id": "alquimia",
"profile": {
"system_prompt": "You coordinate procurement requests. Delegate to specialists and synthesize their results.",
"evaluation_strategy": {
"evaluation_strategy_id": "native",
"max_steps": 30,
"decorators": [
{
"decorator_id": "plan-mode",
"force_completion": true
}
]
},
"tools": [
{
"provider_id": "a2a",
"tools_id": "specialist-pool",
"human_approval": "NONE",
"selector": {"tags": ["procurement-specialist"]}
}
]
},
"config": {
"provider_id": "openai",
"params": {
"model": "gpt-4o",
"temperature": 0.1,
"api_key": {"$secretRef": "RESPONSE_PROVIDER_API_KEY"}
}
}
}
}

A specialist might look like this:

{
"assistant_id": "vendor-agent",
"nickname": "Vendor Specialist",
"tags": ["procurement-specialist"],
"role": "reader",
"response": {
"provider_id": "alquimia",
"profile": {
"system_prompt": "You check vendor approval status and contract terms.",
"knowledge_base": [
{
"topic_id": "approved-vendors",
"search_mode": "on_demand",
"search_kwargs": {"k": 3}
}
],
"evaluation_strategy": {"evaluation_strategy_id": "one-shoot"}
},
"config": {"provider_id": "openai", "params": {"model": "gpt-4o-mini", "api_key": {"$secretRef": "RESPONSE_PROVIDER_API_KEY"}}}
}
}

Each agent runs with its own role, secrets, and tool permissions. Delegation does not bypass policy:

  • The coordinator is an operator and can invoke high-risk actions.
  • The vendor agent is a reader and can only search the approved-vendors topic.
  • The approval agent is an operator but its tools require human approval for destructive operations.

This keeps the blast radius of each specialist small and makes the trust boundary explicit in the registry.

A whole team of agents, plus their tools, topics, and policies, can be promoted together as a single OCI artifact. This guarantees that staging and production run exactly the same agent definitions and cannot drift out of sync.

Terminal window
curl -X PUT "http://runtime:8080/registry/publish?agentspace_id=procurement&tag=v2.1.0" \
-H "Authorization: Bearer $API_TOKEN"
curl -X PUT "http://runtime:8080/registry/pull?agentspace_id=procurement&tag=v2.1.0" \
-H "Authorization: Bearer $API_TOKEN"

When a new specialist is added, it is registered in the agentspace, the coordinator selector stays unchanged, and the new artifact is pulled into production.

Input shields on the coordinator protect against prompt injection before any specialist is called. Content shields on specialist tool registrations protect against leaking sensitive data through A2A results.

{
"shields": {
"delegation-safety": {
"provider_id": "shield-config",
"connector": {"provider_id": "alquimia/prompt-injection-detection"},
"action": "block",
"threshold": 0.5,
"fail_closed": true
}
}
}

Specialization

Build small, focused agents for billing, compliance, support, or sales and compose them into larger workflows.

Structured handoffs

Delegation calls can return JSON or text that the parent agent uses to decide the next step.

Reusable agents

Agents are registered in a central registry and can be discovered by other agents by capability or tag.

Identity boundaries

Each agent runs with its own role, secrets, and tool permissions, so a delegated call does not inherit excessive privileges.

End-to-end trace

A single task ID spans parent and child agents, so you can follow a request across the entire workflow.

Registry governance

Agent specs are versioned and promoted through the registry, preventing unreviewed agents from entering production workflows.

SystemRole
RegistryPublish, version, and discover agent definitions
Identity providerIssue scoped credentials for each agent role
Workflow engineOrchestrate long-running human tasks outside the agent loop
Message busCarry delegation events between master and worker instances
  • Shorter time to add new process variants by reusing existing agents.
  • Clear ownership of decisions and actions across agent boundaries.
  • Easier compliance review because the full delegation chain is logged.