Example Agents
These agents demonstrate real use cases. Each is a complete, runnable project you can clone and modify.
Beginner
Echo Agent
Basic DIDComm request/response. Send a message, get it back. The “hello world” of Layr8 agents.
Demonstrates: Handler registration, auto-ack, thread correlation, graceful shutdown.
Source: go-sdk/examples/echo-agent/
Chat Agent
Interactive multi-party chat over DIDComm. Send messages to multiple recipients and see responses in real time.
Demonstrates: Fire-and-forget Send, inbound message handling, sender credential inspection via MessageContext.
Source: go-sdk/examples/chat/
Intermediate
HTTP Proxy Agent
Proxy REST API calls over DIDComm. A partner’s agent receives HTTP requests encapsulated as DIDComm messages and forwards them to a backend API. This is the pattern behind the CRM integration demo on layr8.io.
Demonstrates: Structured protocol types, dual-mode agents (requester/resource), policy enforcement. Measured at ~55ms total request time with 17ms DIDComm overhead.
Source: demos/https-rest-agent/
Postgres Agent
Cross-organization database queries with policy enforcement. Connect psql to a partner’s database using your identity — no VPN, no shared credentials. The partner controls access with grants specifying action, resource, expiry, and use limits.
Demonstrates: Grants and policy enforcement, hash-linked audit chains, manual ack for guaranteed processing, transparent proxy pattern (existing PostgreSQL clients work without modification).
Source: demos/postgres-agent/
Advanced
Postgres Stream Agent
QUIC-based TCP tunneling that works with any TCP protocol — not just PostgreSQL. Lower latency than the message-based approach because it streams bytes rather than serializing to JSON.
Demonstrates: QUIC transport, protocol-agnostic TCP proxying, stream-based (vs message-based) architecture. 50-150% overhead vs direct connection, compared to 300-600% for message-based.
Source: demos/postgres-agent-stream/
IoT / LED Agent
Control physical WS2812B LED strips via DIDComm messaging with a Phoenix LiveView web UI. A cloud agent mirrors a physical device — the digital twin pattern.
Demonstrates: Device-level DIDComm integration, digital twin architecture, Phoenix LiveView real-time UI, multi-node coordination.
Source: demos/esp32-wled-plugin-with-webui/
Build Your Own
Ready to write an agent? Start with the Getting Started guide or jump to the Go SDK reference.
The SDK includes a Claude Code skill that knows the full API — install it once and Claude can build agents for you. See Go SDK — Claude Code Skill for setup.