Redis Agent Kit
Redis Agent Kit is an experimental Python library for building Redis-backed agent services. It provides durable task state, background workers, progress updates, streaming, memory hooks, RAG ingestion, and protocol adapters without requiring a specific LLM framework.
The project is early and under active development. APIs may change while the library settles.
What It Provides
- Task lifecycle: create, queue, cancel, restart, inspect, and delete agent work.
- Background execution: submit tasks from an API process and run them in independently scaled workers.
- Agent context: pass a
TaskContextwith the user message, session, emitter, memory facade, attachments, and kit managers. - Progress updates: persist task milestones and optionally stream updates or tokens over Server-Sent Events.
- RAG pipelines: prepare, chunk, embed, store, and search documents in Redis.
- GitHub repo source: ingest a repo's files and keep them fresh, re-syncing only what changed via blob-SHA diffing (one-shot, background task, or polling daemon).
- Protocol support: expose agents through REST, A2A, ACP, and MCP.
Installation
pip install "redis-agent-kit[api,cli]"
Optional extras:
pip install "redis-agent-kit[mcp]" # MCP server
pip install "redis-agent-kit[memory]" # working/long-term memory (Python 3.12 only)
pip install "redis-agent-kit[examples]" # example app dependencies
pip install "redis-agent-kit[all]" # all optional RAK features
Redis Agent Kit requires Python 3.11+ and Redis. Vector search requires Redis Stack or Redis 8.
Memory is off by default — enable it in code with
Settings(memory=MemorySettings(enabled=True))(see the Memory guide). It's backed byagent-memory-server, which requires Python 3.12 and thememoryextra; on other Python versions the extra is skipped, so only enable memory on 3.12.
Quickstart
Start Redis:
docker run -d --name redis -p 6379:6379 redis:8
Create app.py:
from redis_agent_kit import AgentKit, EmitterMiddleware, TaskContext
from redis_agent_kit.api import create_app
async def my_agent(ctx: TaskContext) -> dict:
await ctx.emitter.emit("Working...")
return {"answer": f"Processed: {ctx.message}"}
kit = AgentKit(
"redis://localhost:6379",
agent_callable=my_agent,
middleware=[EmitterMiddleware(start_message="Starting...")],
queue_name="my_agent",
)
# Docket workers load an iterable task collection from module:path.
tasks = [kit.worker_task]
app = create_app(kit=kit)
Run the worker and API server in separate terminals:
rak worker --name my_agent --tasks app:tasks
uvicorn app:app --reload
Submit and inspect a task:
curl -X POST http://localhost:8000/tasks \
-H "Content-Type: application/json" \
-d '{"message": "What is Redis?"}'
{"task_id": "01J...", "session_id": "01J...", "status": "queued", "message": "Task created and queued for processing"}
curl http://localhost:8000/tasks/01J...
Task Handlers
New handlers should accept TaskContext:
async def handler(ctx: TaskContext) -> dict:
await ctx.emitter.emit("Searching...")
history = await ctx.memory.get_messages(limit=10)
return {"response": f"{len(history)} previous messages"}
Legacy handlers with (task_id, session_id, message, context) are still accepted, but new code should prefer TaskContext.
Streaming
Use StreamConfig when clients need live task updates:
from redis_agent_kit import AgentKit, StreamConfig
from redis_agent_kit.api import create_app
stream_config = StreamConfig(enabled=True)
kit = AgentKit(
"redis://localhost:6379",
agent_callable=my_agent,
stream_config=stream_config,
)
app = create_app(kit=kit, stream_config=stream_config)
Clients can connect to the per-task SSE endpoint:
const es = new EventSource(`/tasks/${taskId}/stream`);
es.addEventListener("update", (e) => console.log(JSON.parse(e.data).message));
es.addEventListener("token", (e) => process.stdout.write(JSON.parse(e.data).message));
es.addEventListener("done", (e) => {
console.log(JSON.parse(e.data).result);
es.close();
});
Inside a handler, use await ctx.emitter.emit(...) for persisted updates and await ctx.emitter.emit_token(...) for ephemeral token events.
Pipelines
Pipelines are included in the base package:
rak pipelines run ./docs --pattern "*.md" --chunk-size 800
rak pipelines status
The REST API also exposes pipeline endpoints under /pipelines. See the Pipelines guide for current request bodies and staged ingestion details.
Protocols
Use the REST app factory for standard HTTP plus optional A2A and ACP:
from redis_agent_kit import AgentCard, AgentManifest, Skill
from redis_agent_kit.api import create_app
agent_card = AgentCard(
name="My Agent",
description="Answers questions",
url="http://localhost:8000",
skills=[Skill(id="chat", name="Chat", description="General chat")],
)
agent_manifest = AgentManifest(
name="my-agent",
description="Answers questions",
)
app = create_app(
kit=kit,
enable_a2a=True,
enable_acp=True,
agent_card=agent_card,
agent_manifest=agent_manifest,
)
Discovery endpoints:
- A2A:
GET /.well-known/agent.json - ACP:
GET /agents - REST/OpenAPI:
GET /docs
Documentation
- Tutorial
- Tasks
- Sessions
- Memory
- Streaming
- Middleware
- Protocols
- Input Handling
- Sub-Tasks
- Pipelines
- CLI
- API
License
Copyright (c) 2026 Redis Ltd. All rights reserved. The license for this project has not been finalized — see LICENSE. No usage rights are granted until a license is published.
Metadata
Release files for redis-agent-kit 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| redis_agent_kit-0.5.0.tar.gz | 693.7 kB | Without provenance | Details for redis_agent_kit-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redis_agent_kit-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for redis_agent_kit-0.5.0-py3-none-any.whl |
Total release size: 912.7 kB
Release files / redis_agent_kit-0.5.0.tar.gz
| Download URL | redis_agent_kit-0.5.0.tar.gz |
|---|---|
| Size | 693.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
172d5ed768a45681e60e493b58c2edc9ba32a645dd6517748ac5641e8603c7fc
|
|
BLAKE2b-256 checksum How to use checksums |
67aefddec89cb77ee05d50746bca264a9e9fff0e90ae6db6db736db01abef193
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Release files / redis_agent_kit-0.5.0-py3-none-any.whl
| Download URL | redis_agent_kit-0.5.0-py3-none-any.whl |
|---|---|
| Size | 219.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2ffc543af578c2d48d406e60ead56071d1ebc8d5719ec18df5042eb9c6d7a33
|
|
BLAKE2b-256 checksum How to use checksums |
aa56dccd065ba33a3975895125901dc4701576a4752712bad9827d7fe27242cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.13
|
Security for redis-agent-kit 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.