DEV Community

Anton Illarionov
Anton Illarionov

Posted on

CrewAI + ODEI: Governed Multi-Agent Teams

CrewAI + ODEI: Governed Multi-Agent Teams

CrewAI is great for orchestrating multi-agent workflows. ODEI adds constitutional governance: validation before every consequential action.

The Integration

from crewai.tools import BaseTool
import requests

class ConstitutionalGuardrail(BaseTool):
    name: str = "constitutional_guardrail"
    description: str = "Validate action before executing. Call before consequential operations."

    def _run(self, action: str) -> str:
        r = requests.post(
            "https://api.odei.ai/api/v2/guardrail/check",
            json={"action": action, "severity": "medium"}
        ).json()
        return f"Verdict: {r["verdict"]}. {r.get("reasoning","")[:200]}"

guardrail = ConstitutionalGuardrail()

# Give to agents that need safety validation
safe_agent = Agent(
    role="Financial Agent",
    goal="Execute financial transactions safely",
    tools=[guardrail, ...other_tools]
)
Enter fullscreen mode Exit fullscreen mode

Multi-Agent World Model

All agents in a crew can read the shared world model:

from crewai.tools import BaseTool

class WorldModelQuery(BaseTool):
    name: str = "world_model_query"
    description: str = "Query shared knowledge graph for team context."

    def _run(self, query: str) -> str:
        r = requests.post(
            "https://api.odei.ai/api/v2/world-model/query",
            json={"queryType": "search", "searchTerm": query}
        ).json()
        return str(r)
Enter fullscreen mode Exit fullscreen mode

Why This Matters

Multi-agent systems amplify both capabilities AND risks. Agent A might approve something Agent B executes harmfully. Constitutional validation at each step prevents cascade failures.

Production

ODEI processes on Virtuals ACP with 92% success rate since January 2026.

Top comments (0)