/redis-development:add-intent-routerfrom redis-development
Replaces keyword/LLM routing with a Redis Iris Intent Router. Asks five questions, writes intents.yaml, provisions the router, and wires router.match() for semantic intent dispatch.
Ships in redis-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One match() call in place of the code that decides where a message goes. The Router embeds the message, finds the nearest example phrasings, groups them by intent, applies a threshold, and returns the matching intents best first, each with the target you attached. No match is an empty result, not an error. The routes and their phrasings are content, not code: ask first, write intents.yaml, provision, load, then wire.
Read the project:
if "refund" in text, a regex table, a match statement, a classifier prompt ("Classify this message as one of ..."), or a router node or conditional edge in a graph.amatch and adefine are the async twins; every other method is sync only.Then ask the developer these five questions, nothing more. A shrug takes the default.
| Ask | If the answer is | Configure |
|---|---|---|
| What are the routes today? | A list | One intent each in intents.yaml. Names use letters, digits, ., _ and - |
| Give three to five real phrasings for each route | Phrasings | examples for that intent. An intent with no examples never matches |
| What does each route dispatch to? | A tool, a sub-agent, a prompt | target: {type, ref, args}. The Router stores it and never interprets it |
| The code already knows | No target; dispatch on the intent name | |
| What should happen when nothing matches? | Fall back to the general agent (default) | Keep the existing default path for an empty result |
| Ask a clarifying question | That branch on an empty result | |
| Which embedding model? | OpenAI (default) | --provider openai --model text-embedding-3-small --dimensions 1536 |
| Another | iris intent-router service models lists what the deployment offers. The choice is fixed once the Router exists |
Do this before writing code. Never guess framework APIs from memory.
Write intents.yaml from the answers and commit it: it is the reviewable record of the routes.
intents:
- name: track_order
description: Where an order is and when it arrives
examples: ["where is my order", "track my package", "has my parcel shipped yet"]
target: {type: tool, ref: orders.track}
- name: refund_request
examples: ["I want my money back", "refund this order", "return and refund"]
target: {type: agent, ref: refunds}
minScore: 0.4 # stricter than the Router's default for this one
Provision from the terminal on a self-managed suite. A cloud profile refuses the control-plane commands with cloud_unsupported: the person creates the Router in Iris → Intent Router → New Intent Router and its key in Iris → Access & Identity. Add --local for a local stack (it assumes 127.0.0.1:9400 and 9401), or let the person export IRIS_INTENT_ROUTER_SERVICE_URL, IRIS_INTENT_ROUTER_SERVICE_TOKEN, IRIS_INTENT_ROUTER_URL, IRIS_IDENTITY_URL and IRIS_IDENTITY_TOKEN. Full reference: iris intent-router <command> --help (for example iris intent-router service create --help).
iris --json --no-input intent-router service create --name support --provider openai --model text-embedding-3-small --dimensions 1536 --role read --dry-run
iris --json --no-input intent-router service create --name support --provider openai --model text-embedding-3-small --dimensions 1536 --role read --wait --write-env .env
iris --json --no-input intent-router service check <routerId from the result> --env-file .env
--json --no-input before the product name. You get one JSON value on stdout, errors as one JSON value on stderr, and no prompts.--write-env PATH (or --write PATH on service key). Never run create or key with --json and no file: that prints the key into your transcript.credential_required, stop. Tell the person which variable to set (details.env) and link details.obtain. Never ask for a secret in chat, pass one on the command line, or echo, cat or grep an env file.resource_exists, ask whether to --reuse or pick another name. Never delete to retry. If create fails with details.created: true, run the command in details.command.--write-env .env writes IRIS_INTENT_ROUTER_URL, IRIS_INTENT_ROUTER_ID and IRIS_INTENT_ROUTER_API_KEY. Add the same three names to .env.example with empty values. Never commit .env.
Two keys, never one:
| Key | Role | Mint |
|---|---|---|
Agent (in .env) | read: match and list | --role read on create |
Authoring, for loading intents.yaml | write | iris intent-router service key ROUTER_ID --role write --write .env.authoring; load it only in the shell that runs intents add, never in the agent's .env |
Load the intents with the authoring key. intents add is one atomic batch: an existing name is replaced, and nothing is written if any intent is invalid:
iris --json --no-input intent-router intents add --file intents.yaml
iris --json --no-input intent-router intents list --all
Re-run intents add after every change to intents.yaml.
Create once at startup:
from redis_iris import IntentRouter
router = IntentRouter.from_env()
Replace the decision with one call:
found = router.match(message) # await router.amatch(...)
if found.best:
route = found.best.name # "track_order"
target = found.best.target # what intents.yaml attached, or None
# dispatch exactly where the old if/else or classifier branch did
else:
... # question 4: the existing fallback path
found.best.score is the score, higher is closer. match(message, limit=3) returns the next candidates, and min_score= overrides every threshold for one call. A limit above the server's cap is rejected, not clamped.
Where it goes (confirm names in step 2):
| Framework | Replace |
|---|---|
| LangGraph | the router node or the function behind the conditional edge: return the next node from found.best |
| OpenAI Agents SDK | the triage agent or handoff choice, when it only picks a route |
| Google ADK | the routing agent or before_agent_callback choice |
| CrewAI | the manager's delegation choice, when it is a fixed set of routes |
| Plain loop | the if/else or match statement |
Remove what it replaced: the keyword lists, the regex table, the classifier prompt and its model call. Keep the dispatch code; only the choice moves.
The SDK raises on a missing setting or an outage. Ask whether a Router failure may fail the turn; most agents catch it and take the question 4 fallback.
iris intent-router service check ROUTER_ID --env-file .env passes every hop: token, Router READY, Identity Service, a key granting the Router, one data read.iris intent-router intents list --all shows every intent from intents.yaml with its example count.iris intent-router match "<a phrasing that is not in the examples>" --limit 3 returns the right intent first.iris intent-router match "<something no route covers>" returns an empty list.IRIS_INTENT_ROUTER_API_KEY and confirm ConfigurationError names it.Wrong intent first: add phrasings to the right intent or raise its minScore, re-run intents add. Everything empty: lower the Router's or the intent's threshold (intents update NAME --min-score). With the noop embedding provider, matching is lexical overlap, not semantic.
List the five answers, the intents and example counts in intents.yaml, the embedding model, keys minted and their roles, where match() went and what it replaced, the fallback path, verification output, and anything you could not confirm over MCP.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub redis/agent-skills --plugin redis-development14 skills in this plugin
/add-agent-memoryWire Redis Agent Memory into an existing agent with redis-iris so it remembers users across sessions. Asks five questions (what to remember, what to share, what never to keep, how long to keep it, whether users can be forgotten), writes the answers to service.yaml, provisions the service from the terminal with `iris agent-memory service create`, then wires recall and write-back into the agent's turn in any framework. Use when the agent forgets users, uses InMemoryStore or a checkpointer only, keeps memory in a dict or local DB, or the user asks for long-term memory, recall, or right-to-erasure./add-agent-playbooksAdd Redis Iris Agent Playbooks to an existing agent. Use when approved answers or repeatable procedures live in prompts, document retrieval, or a semantic response cache. Connect or provision a Playbook, publish FAQs and Skills, and verify the first application turn with optional review proposals./add-context-gatewayPut the MCP servers an existing agent uses behind one Redis Iris Context Gateway with redis-iris, so the agent connects to one MCP endpoint with one agent key instead of configuring each server and its secret. Asks whether the Gateway is in Redis Cloud or self-managed, then five questions (which MCP servers and secrets the agent has today, how many tools it sees, which read-only tools may be cached, which tools return large results, whether the framework speaks MCP itself). Self-managed, it provisions the Gateway and its Upstreams from the terminal with `iris context-gateway` and sets cache and compression policies. In Redis Cloud the developer creates them in the console. Then it points the agent at the Gateway in any framework and verifies it with `tools list` and `tools call`. Use when the agent configures several MCP servers one by one, carries one secret per server, loads too many tool schemas into the prompt, or the user asks for Context Gateway, one MCP endpoint, tool caching, or result handles.Other plugins' skills for the same job