Skip to content

Redis Agent Kit

Redis Agent Kit provides Redis-backed primitives for agent services: durable task state, background workers, progress updates, optional streaming, RAG pipelines, and protocol adapters.

The project is experimental and under active development.

Installation

pip install "redis-agent-kit[api,cli]"

Install optional features as needed:

pip install "redis-agent-kit[mcp]"
pip install "redis-agent-kit[examples]"
pip install "redis-agent-kit[all]"

Quickstart

Start Redis:

docker run -d -p 6379:6379 redis:8

Create app.py:

from redis_agent_kit import AgentKit, 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,
    queue_name="my_agent",
)

tasks = [kit.worker_task]
app = create_app(kit=kit)

Run:

rak worker --name my_agent --tasks app:tasks
uvicorn app:app --reload

Submit a task:

curl -X POST http://localhost:8000/tasks \
  -H "Content-Type: application/json" \
  -d '{"message": "What is Redis?"}'

What's Next?

  • Tutorial - Build a complete agent from scratch
  • Tasks - Task lifecycle, status updates, error handling
  • Sessions - Conversation management
  • Memory - Working and long-term memory
  • Streaming - Real-time SSE and token streaming
  • Pipelines - Ingest and vectorize content for RAG
  • Protocols - A2A, ACP, and MCP integration
  • Input Handling - Pause tasks for user input
  • Sub-Tasks - Spawn child tasks, fan-out, and fan-in
  • Middleware - Compose reusable behaviors
  • CLI - Command reference
  • API - REST endpoint reference