---
name: add-redis-iris
description: Add Redis Iris to an existing AI agent in any framework (LangGraph, LangChain, OpenAI Agents SDK, Google ADK, Pydantic AI, CrewAI, or a plain loop). Use when the user asks to add Iris, Redis Agent Memory, Agent Playbooks, Context Gateway, Intent Router, or Lens to their agent, or asks which Iris product their agent needs. Detects the framework and routes to the product skill.
license: MIT
metadata:
  author: redis
  version: "1.0.0"
title: add-redis-iris
canonical_url: https://skilld.dev/gh/redis/agent-skills/add-redis-iris
last_updated: 2026-11-12T09:06:29.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install redis/agent-skills/add-redis-iris`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/add-redis-iris`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/redis/agent-skills/add-redis-iris) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/add-redis-iris`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/add-redis-iris --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/add-redis-iris --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Add Redis Iris

Inspect, install, route. Do not rewrite the agent.

## 1. Find the agent

Locate:

- **The turn**: where the model is called (`invoke`, `Runner.run`, `generate_content`, `agent.run`, `kickoff`, `chat.completions.create`, `messages.create`).
- **Tool registration**: where tools are defined and handed to the model.
- **User and session ids**: where the request's user id and thread or session id live.
- **More than one loop** (a hand-written loop and a framework, or two frameworks)? Create the product objects once in a module with no framework imports, wire each loop at its own seam, and convert one loop at a time. Do not pick the loop for the user.

## 2. Detect the framework

Search imports:

| Import | Framework |
|---|---|
| `langgraph`, `langchain`, `langchain_core` | LangGraph / LangChain |
| `agents` (package `openai-agents`) | OpenAI Agents SDK |
| `google.adk` | Google ADK |
| `pydantic_ai` | Pydantic AI |
| `crewai` | CrewAI |
| only `openai`, `anthropic`, or another model client | Plain loop |

Note the version from the lockfile. Product skills look up that version's API over MCP.

## 3. Find what it lacks

| Symptom in the code | Product | Skill |
|---|---|---|
| No long-term memory, `InMemoryStore`, checkpointer only, memory in a dict or local DB | Agent Memory | `add-agent-memory` |
| Already on Redis Agent Memory through its own REST or MCP client, hand-written adapters, or model-facing memory tools | Agent Memory | `add-agent-memory`, "Already on Redis Agent Memory" |
| Policy or procedures hardcoded in the prompt, tool usage guidance in the prompt, or a vector store over policy docs | Agent Playbooks | `add-agent-playbooks` |
| A semantic response cache: model answers stored and re-served to later users, curated by hand | Agent Playbooks | `add-agent-playbooks`, "Replacing a response cache" |
| Several MCP servers configured one by one in the agent, each with its own secret, or too many tool schemas in the prompt | Context Gateway | `add-context-gateway` |
| A keyword if/else router, or an LLM call just to pick a route | Intent Router | `add-intent-router` |
| No per-turn tracing: no way to see which LLM calls, tools and retrievals one answer used, or what it cost | Lens | `add-lens` |

If the user named a product, use that. If unclear, ask once, listing what you found.

Lens goes next to any product, or on its own: it traces the turn, and every Iris product traces itself inside it. Offer it alongside whatever else you add.

## 4. Install

- `uv.lock` or `[tool.uv]` present: `uv add redis-iris`.
- Poetry: `poetry add redis-iris`.
- Otherwise add `redis-iris` to the project's requirements file.

If resolution fails on pre-releases, retry with `uv add --prerelease=allow redis-iris`. Confirm: `uv run python -c "import redis_iris; print(redis_iris.__version__)"`.

## 5. Route

Follow each chosen product skill. More than one product: each skill adds its own calls. Optionally build them from one config with `Iris.from_env()` (`iris.agent_memory()`, `iris.agent_playbooks()`, `iris.context_gateway()`, `iris.intent_router()`).

Ask once whether the services run on Redis Cloud or a self-managed suite, then write the project's `iris.toml` profile. Only the `iris` CLI reads `iris.toml`; the app reads env vars. It holds URLs only: a token in TOML makes the CLI exit 2. Select the profile with `IRIS_CONFIG=./iris.toml` and `IRIS_PROFILE=cloud` or `IRIS_PROFILE=suite`.

Redis Cloud. The person fills `.env` from the console: `IRIS_<PRODUCT>_URL`, its ID and `_API_KEY` per product.

```toml
[profiles.cloud]
kind = "cloud"
console_url = "https://cloud.redis.io"

[profiles.cloud.agent_memory]
url = "https://gcp-us-east4.memory.redis.io"  # the data-plane URL from the console
```

Self-managed suite. The operator's tokens go in `.env.admin`, never the app's `.env`; `service create --write-env .env` writes the app's `.env`.

```toml
[profiles.suite]
kind = "self-managed"

[profiles.suite.agent_memory]
service_url = "https://memory-admin.example.com"  # control plane: the CLI calls it for service create and check
url = "https://memory.example.com"  # data plane: what the agent calls
identity_url = "https://memory-identity.example.com"  # Identity Service that mints the agent's keys
```

Add one table per product the app uses: `agent_memory`, `agent_playbooks`, `context_gateway`, `intent_router`. `[profiles.suite.context_gateway]` has no `url`: `service create --write-env` writes the Gateway's endpoint. A suite with one shared Identity Service sets `[profiles.suite.identity]` `url` once instead of each `identity_url`. `IRIS_<PRODUCT>_SERVICE_URL`, `IRIS_<PRODUCT>_URL` and `IRIS_<PRODUCT>_IDENTITY_URL` override the profile.

## Rules

- Keep the user's framework, graph, and prompts. Smallest diff.
- Never guess framework APIs from memory. Look them up over MCP (see each product skill).
- Only use APIs in `redis_iris`. `redis_iris.integrations.langgraph.attach` (extra `redis-iris[langgraph]`) and `redis_iris.integrations.adk.attach` (no extra) exist; there is no `IrisTool`, `iris.tools()`, or `iris.turn()`.
- The SDK raises on a missing setting or an outage. Ask whether a product failure may fail the turn; most production agents catch it and continue with an empty block.
- Never commit secrets.
