Shared memory and channels for multi-agent AI
ContextRelay stores large payloads at the edge and returns a short URL pointer, so agents on different LLMs can hand off context without pasting it through prompts. Pub/sub channels coordinate them in ~20 ms.
Self-host the worker (one wrangler deploy), or use the managed cloud for billing, quota, and a dashboard. Same code, same SDK.
Two ways to run it
Same SDK, same protocol, same source. Pick the deployment that fits.
Self-host (open source)
Clone the repo, deploy the Worker to your own Cloudflare account. You own the data, the keys, the operational surface — and pay only for Cloudflare usage (the free tier covers 100K requests/day).
- ✓MIT license, no vendor lock-in
- ✓Runs on your Cloudflare account
- ✓No API keys, no quota
- ✓You handle ops
Managed cloud
We run the Worker for you on the global edge. You get an API key, a dashboard, metered usage, quotas, and zero ops. Same SDK as the open-source path — just point it at the managed URL.
- ✓Free tier: 1K pushes / 10K pulls per month
- ✓Dashboard for keys and usage
- ✓Quota enforcement and billing
- ✓We handle ops
How it works
Three lines replace a token tax. Works across any agent, any LLM provider, any runtime.
Everything your pipeline needs
Real use cases
Copy-paste examples for the most common multi-agent patterns.
Claude plans. Mistral builds. Channels coordinate them.
Both agents share one API key and subscribe to the same channels. Claude pushes the architecture to task-assigned — Mistral's subscriber fires in ~20 ms, implements the codebase, and publishes back to task-done. No URL to paste between processes.
task-assigned · waits for Claude# mistral_engineer.py — run this first in a terminal
import os
from mistralai import Mistral
from contextrelay import ContextRelay
relay = ContextRelay(api_key=os.environ["CONTEXTRELAY_API_KEY"])
mistral = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
print("Mistral engineer ready — subscribed to 'task-assigned'")
def on_task(url: str):
print(f" [task-assigned] architecture received")
architecture = relay.pull(url)
print(f" [task-assigned] {len(architecture):,} chars — implementing...")
code = mistral.chat.complete(
model="mistral-large-latest",
messages=[{
"role": "user",
"content": (
"You are a senior engineer. Implement this architecture as "
"complete, runnable code. Every file. No placeholders.\n\n"
+ architecture
),
}],
).choices[0].message.content
relay.push(code, channel="task-done", metadata={"role": "implementation"})
print(" [task-done] implementation published — architect notified")
relay.subscribe("task-assigned", on_task) # blocks, waits for Claudetask-assigned · Mistral fires automaticallyYou are a senior software architect in an autonomous pipeline. Your engineer (Mistral) is already subscribed to channel "task-assigned". The moment you push your architecture there, Mistral implements it — no human step. Task: Design a production-ready FastAPI task management API. Cover: User + Task models, all CRUD endpoints, JWT auth, SQLAlchemy + SQLite, Pydantic schemas, file structure. Steps: 1. Write the complete architecture document 2. Use push_context — set channel="task-assigned" Mistral's subscriber fires automatically on push 3. Subscribe / poll "task-done" to receive the implementation back Start now. The pipeline is fully autonomous.
task-done, a QA agent on task-review, a deploy agent on task-approved. Same pattern.Who it's for
ContextRelay solves a narrow problem well. If your work fits one of these patterns, it'll save you real money and ops.
Why ContextRelay
Honest comparison: ContextRelay does ephemeral, encrypted handoffs with channels. It is not a vector store, not a long-term memory layer, and not a general-purpose message broker. It sits next to those tools, not on top of them.
| ContextRelay | Mem0 | Letta / MemGPT | Redis pub/sub | LangChain Memory | |
|---|---|---|---|---|---|
| Best for | Cross-provider handoffs & coordination | Semantic recall over user history | Stateful long-running agents | Real-time messaging in your stack | Single-chain conversation context |
| Storage | Ephemeral KV (24 h) | Vector index (persistent) | Tiered memory | In-memory + persistence | In-process |
| Cross-LLM | Yes — provider-agnostic | Yes | Mostly framework-bound | Yes | LangChain-bound |
| Pub/sub channels | Yes (~20 ms fan-out) | No | No | Yes | No |
| End-to-end encryption | Yes (fragment-key) | No | No | TLS only | No |
| Self-host | One wrangler deploy | Custom infra | Custom infra | Standard ops | N/A (library) |
| Hosted option | Free / $29 / $99 | Mem0 cloud | Letta Cloud | Many vendors | N/A |
Simple pricing
Free to start. No credit card required. Or self-host for free, forever.
Pick your path
Self-host on your Cloudflare account, or let us run it for you. Same SDK either way.