Agent Mesh

Redis's Agent Mesh is a pair of Python libraries for agents that hand work to each other and stream their progress: an A2A task store and a resumable event…

Agent Mesh

Redis's Agent Mesh is a pair of Python libraries for agents that hand work to each other and stream their progress: an A2A task store and a resumable event stream for FastAPI. Both keep everything in streams and JSON documents, so they run on KiviDB unchanged. Point REDIS_URL at your database and nothing else changes.

Agent Mesh is part of Kivi Synapse, KiviDB's set of building blocks for AI agents, alongside the semantic cache, agent memory, data integration and the context gateway.

What it needs

What Agent Mesh needsOn KiviDB
Idempotent stream writes (XADD ... IDMP), from Redis 8.6.2KiviDB 1.1.3 and later
JSON commands (JSON.GET, JSON.SET, ...)Built in
A reported redis_version of 8.6.2 or laterReports 8.10.0

New databases run KiviDB 1.2.0, so there is nothing to enable.

What we tested

Tested with KiviDB 1.2.0, redis-iris 1.0.1 and a2a-sdk 1.2.3. We ran Redis's own two quickstart demos against KiviDB, unmodified apart from a shorter pause between steps:

  • A2A task store (a2a-demo.py). An agent produces 20 updates. The client reads five, disconnects, waits, then reconnects from its saved cursor. It received all 20, the task ended COMPLETED, and reading the task back returned the same state.
  • FastAPI event stream (fastapi-sse-demo.py). The same disconnect and resume: all 20 steps arrived in order, then the completed event.
  • Duplicate writes. Repeating an XADD with the same producer and idempotency id returns the first entry's id and adds nothing. This is what lets the task store retry a write safely.

Try it

python -m venv .venv
source .venv/bin/activate
python -m pip install 'redis-iris[a2a]' uvicorn
export REDIS_URL='rediss://default:<password>@<your-database>.cloud.kividb.io:6380/0?ssl_ca_certs=/path/to/kividb-ca.pem'
python a2a-demo.py

Download a2a-demo.py and a2a-demo.html from Redis's Agent Mesh quickstart and keep them in the same folder. Then open http://127.0.0.1:8000. For the FastAPI demo, install 'redis-iris[fastapi-sse]' instead and run fastapi-sse-demo.py.

The endpoint, password and CA certificate are under Connectivity on the database's Overview tab.

Good to know

  • Use the primary endpoint. The task store writes to and reads from the primary. Give it a client connected to the database's main endpoint, not a replica.
  • Keys expire. The task store sets a lifetime on every key it writes: seven days while a task is active, one day after it ends. Size the database for the tasks you keep in flight, not for every task you have ever run.
  • Not tested yet: a failover in the middle of a task, and sharded databases. Agent Mesh is in beta upstream too.