# Redis Agent Playbooks

```json metadata
{
  "schema_version": 2,
  "title": "Redis Agent Playbooks",
  "description": "Create playbooks of reusable skills and answers that agents can discover and load for a task.",
  "categories": ["docs","develop","ai"],
  "tableOfContents": {"sections":[{"id":"what-are-redis-agent-playbooks","title":"What are Redis Agent Playbooks?"},{"id":"why-use-redis-agent-playbooks","title":"Why use Redis Agent Playbooks?"},{"id":"concepts","title":"Concepts"},{"id":"quick-example","title":"Quick example"},{"id":"manage-playbook-entries","title":"Manage playbook entries"},{"id":"serve-playbook-entries-at-runtime","title":"Serve playbook entries at runtime"}]}

,
  "codeExamples": [{"codetabsId":"iris_playbook_quickstart-stepplaybook-connect","difficulty":"beginner","id":"playbook-connect","languages":[{"clientId":"iris-python","clientName":"Python (Iris)","id":"Python (Iris)","langId":"python","panelId":"panel_Python (Iris)_iris_playbook_quickstart-stepplaybook-connect"},{"clientId":"iris-cli","clientName":"CLI (Iris)","id":"CLI (Iris)","langId":"bash","panelId":"panel_CLI (Iris)_iris_playbook_quickstart-stepplaybook-connect"},{"clientId":"iris-curl","clientName":"cURL (Iris)","id":"cURL (Iris)","langId":"bash","panelId":"panel_cURL (Iris)_iris_playbook_quickstart-stepplaybook-connect"}]},{"codetabsId":"iris_playbook_quickstart-stepplaybook-quickstart-discover","difficulty":"beginner","id":"playbook-quickstart-discover","languages":[{"clientId":"iris-python","clientName":"Python (Iris)","id":"Python (Iris)","langId":"python","panelId":"panel_Python (Iris)_iris_playbook_quickstart-stepplaybook-quickstart-discover"},{"clientId":"iris-cli","clientName":"CLI (Iris)","id":"CLI (Iris)","langId":"bash","panelId":"panel_CLI (Iris)_iris_playbook_quickstart-stepplaybook-quickstart-discover"},{"clientId":"iris-curl","clientName":"cURL (Iris)","id":"cURL (Iris)","langId":"bash","panelId":"panel_cURL (Iris)_iris_playbook_quickstart-stepplaybook-quickstart-discover"}]}]
}
```

## Code examples

These examples connect to Iris services using SDKs or HTTP requests with curl. Follow one language throughout each walkthrough.


## What are Redis Agent Playbooks?

Redis Agent Playbooks let you create and manage playbooks of curated answers and procedures for AI agents. Each playbook is a registry of entries with its own access grants and retrieval settings.

Publish an entry version, retrieve it for a task, and prepare revisions while agents use the current publication.

A FAQ gives an agent a validated answer, such as where a customer can find their refund status. A skill ([Agent Skill](https://agentskills.io/home)) guides the agent through drafting a reply from that status using a template.

<div class="grid grid-cols-1 md:grid-cols-3 gap-6 my-8">
  
  
  
</div>

## Why use Redis Agent Playbooks?

- **Reusable agent knowledge:** Manage approved FAQs and skills once, then use them across agents and applications.
- **Controlled updates:** Publish a specific entry version while authors prepare and review the next revision.
- **Relevant retrieval:** Match an agent's task with FAQ answers and skill previews using semantic discovery.
- **Progressive skill loading:** Let agents inspect skill previews before loading full instructions and supporting files.
- **Governed collaboration:** Separate reading, writing, publishing, and proposing with playbook access grants.
- **Flexible integration:** Retrieve entries through Python, HTTP, or Model Context Protocol (MCP).

## Concepts

A playbook holds two kinds of entries:

| Entry | Use it for                                                                         | What the agent receives                                              |
| ----- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| Skill | Procedures for completing a task, with optional scripts, references, or templates. | A name and description first; full instructions and files on demand. |
| FAQ   | A validated answer to a recurring question.                                       | The question and answer in the retrieval result.                     |

A publisher selects the version of each **entry** agents receive. Your application controls how retrieved content enters the model's context and which actions the agent can take.

See [Redis Agent Playbooks concepts](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/concepts) for versions, publication, and review.

## Quick example

1. Set up a playbook:
    - **Redis Cloud:** [Create a playbook](https://redis.io/docs/latest/operate/iris/agent-playbook/create-playbook).
    - **Self-managed:** [Deploy Agent Playbooks on Kubernetes](https://redis.io/docs/latest/operate/iris/agent-playbook/self-managed).
1. Install the Redis Iris Python package, which includes the `iris` CLI:

    ```bash
    pip install 'redis-iris>=1.0.0'
    ```

1. With `IRIS_AGENT_PLAYBOOKS_URL`, `IRIS_AGENT_PLAYBOOKS_PLAYBOOK_ID`, and `IRIS_AGENT_PLAYBOOKS_API_KEY` in your environment, find the published entries that match an agent's task:

**Available in:** Python (Iris), cURL (Iris), CLI (Iris)

##### Python (Iris)

```python
from redis_iris.agent_playbooks import AgentPlaybooks

playbook = AgentPlaybooks.from_env()
print(playbook.client.get_playbook_health())
```

##### cURL (Iris)

```bash
set -euo pipefail
PLAYBOOK_API="${IRIS_AGENT_PLAYBOOKS_URL%/}/iris/data/v1/agent-playbooks/playbooks/$IRIS_AGENT_PLAYBOOKS_PLAYBOOK_ID"
curl --fail-with-body --silent --show-error \
  "$PLAYBOOK_API/health" \
  -H "Authorization: Bearer $IRIS_AGENT_PLAYBOOKS_API_KEY" | jq .
```

##### CLI (Iris)

```bash
set -euo pipefail

iris agent-playbooks health
```



**Available in:** Python (Iris), cURL (Iris), CLI (Iris)

##### Python (Iris)

```python
discovery = playbook.discover(
    "Help a customer find their refund status",
    filter_={"eq": {"name": "topic", "value": "refund"}},
)
print(discovery.as_prompt())
```

##### cURL (Iris)

```bash
curl --fail-with-body --silent --show-error \
  -X POST "$PLAYBOOK_API/entries/discover" \
  -H "Authorization: Bearer $IRIS_AGENT_PLAYBOOKS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"query":"Help a customer find their refund status","filter":{"eq":{"name":"topic","value":"refund"}},"limit":5}' | jq .
```

##### CLI (Iris)

```bash
cat > discover.json <<'JSON'
{
  "query": "Help a customer find their refund status",
  "filter": {"eq": {"name": "topic", "value": "refund"}},
  "limit": 5
}
JSON
iris --json agent-playbooks discover --input discover.json | jq .
```



Follow the [quickstart](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/quickstart) to publish your first FAQ and retrieve it.

## Manage playbook entries

- [Manage FAQs](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/manage-faqs): write, publish, and update FAQs.
- [Manage skills](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/manage-skills): package Agent Skills and load their instructions and files on demand.
- [Review proposals](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/proposals): check proposed entries and accumulated evidence before accepting them.

## Serve playbook entries at runtime

- [Retrieve relevant FAQs or Agent Skills](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/retrieval) on demand.
- [Integrate with an agent](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/agent-integration) using OpenAI Agents SDK or LangGraph.
- [Connect with MCP](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/mcp).

Use the [API reference](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/api-reference) for operations and schemas, and [service limits and errors](https://redis.io/docs/latest/develop/ai/context-engine/agent-playbooks/limits) for constraints and recovery guidance.

