DEV Community

Anton Illarionov
Anton Illarionov

Posted on

Fetch.ai + ODEI: Building Knowledge-Aware Autonomous Agents

Fetch.ai Agentverse + ODEI: Knowledge-Aware Autonomous Agents

How to build autonomous agents that have persistent memory and constitutional safety on the Fetch.ai stack.

What Fetch.ai Provides

Fetch.ai's uAgents SDK lets you build autonomous agents that:

  • Register on the Almanac (Fetch.ai's agent registry)
  • Message other agents via ASI:One messaging
  • Integrate with the Agentverse marketplace

Where ODEI Fits

ODEI provides what the uAgents SDK doesn't: persistent world model + constitutional governance.

The pairing:

  • Fetch.ai: agent communication, messaging, marketplace discovery
  • ODEI: what the agent knows, what it's allowed to do, what it's already done

Integration Pattern

from uagents import Agent, Context
import requests

agent = Agent(name="my_agent", seed="UNIQUE_SEED")

ODEI_TOKEN = "your-odei-token"

@agent.on_message(model=Request)
async def handle_request(ctx: Context, sender: str, msg: Request):
    # 1. Check constitutionally before acting
    check = requests.post(
        "https://api.odei.ai/api/v2/guardrail/check",
        headers={"Authorization": f"Bearer {ODEI_TOKEN}"},
        json={"action": msg.action, "severity": "medium"}
    ).json()

    if check["verdict"] != "APPROVED":
        await ctx.send(sender, Response(error=check["reasoning"]))
        return

    # 2. Query world model for context
    wm = requests.post(
        "https://api.odei.ai/api/v2/world-model/query",
        headers={"Authorization": f"Bearer {ODEI_TOKEN}"},
        json={"queryType": "search", "searchTerm": msg.topic}
    ).json()

    # 3. Process with context
    result = process(msg, context=wm)
    await ctx.send(sender, Response(result=result))
Enter fullscreen mode Exit fullscreen mode

ODEI on Fetch.ai

ODEI is registered on Fetch.ai Agentverse:

  • Address: agent1q2x5c6uf7lmveeamelem0v0jp4089ev3ftm6ng9yz8jker400555uf5qq50
  • Protocols: WorldModel, GuardrailCheck, WorldModelSignal, Chat
  • HTTPS endpoint: https://api.odei.ai/fetch/

ASI:One compatible — discoverable via the Fetch.ai Almanac.

Key Services

When you message ODEI on Fetch.ai:

WorldModel protocol: Returns current graph state, domain summaries, node counts.

GuardrailCheck protocol:

{"action": "your-action", "severity": "medium"}
Enter fullscreen mode Exit fullscreen mode

Returns: APPROVED/REJECTED/ESCALATE

WorldModelSignal protocol:

{"signalType": "agent_score", "subject": "agent_name"}
Enter fullscreen mode Exit fullscreen mode

Returns trust score 0-100.

Why This Matters

Most Fetch.ai agents are stateless — they respond to messages and forget. ODEI gives them:

  1. Memory that persists — world model survives sessions
  2. Validation — constitutional checks before consequential actions
  3. Trust — ERC-8004 on-chain identity verifiable cross-platform

Resources

Top comments (0)