Skip to content

Agent Contracts Reference ​

Quick Reference

  • Interaction Pattern: Async JSON-RPC
  • Auth: Local Environment / API Keys
  • Primary Format: Structured JSON

Overview ​

This documentation defines the input and output contracts for the specialized agents within the orchestrator. Adhering to these contracts ensures deterministic execution and reliable parsing.

Available Agent Roles ​

AgentPurposePrimary Interface
AnalystWorkflow Decompositionexecute(request) ➜ DAG JSON
SolutionTechnical Implementationexecute(context) ➜ CODE JSON
CriticPeer Reviewexecute(proposal) ➜ AUDIT JSON
SecurityVulnerability Scanexecute(proposal) ➜ RISK JSON

Analyst Agent Contract ​

Generates a Directed Acyclic Graph (DAG) for implementation.

Request Body ​

json
{
  "request": "Implement a logging system."
}

Response Body ​

200 OK (Validated Plan)

json
{
  "tasks": [
    {
      "id": 1,
      "agent": "CodingAgent",
      "description": "Initialize logger configuration.",
      "params": { "query": "..." },
      "depends_on": []
    }
  ],
  "risks": ["Performance overhead"]
}

Examples ​

Python (Direct Call)
python
from agents.analysis_agent import AnalysisAgent

agent = AnalysisAgent(memory_manager, logger)
plan = await agent.execute({"request": "Task..."}, trace_id="tr_123")

Model Router API ​

Handles model failover and retries.

MethodDescriptionFallback
execute_with_routingRuns a completion with auto-retry.Gemini ➜ Mistral

Error Codes ​

CodeNameDescription
429Rate LimitPrimary model quota exhausted.
500Context FailedAll models in fallback chain failed.

See Also ​

Built with DocKit Premium