All skills
redis avatar

/iris-development

@d20b723 official
by redisredis/agent-skills163 stars
30

Iris is Redis's umbrella for AI-focused products. Use this skill when integrating with the Iris Redis Agent Memory (RAM) data plane on Redis Cloud — recording session events for an AI agent, creating or searching long-term memories, configuring a memory store, or tuning background memory promotion. Code examples use the official `redis-agent-memory` (Python) and `@redis-iris/agent-memory` (TypeScript) SDKs.

Use this Skill: https://skilld.dev/gh/redis/agent-skills/iris-development

This session only. Nothing lands on disk.

referencessetup-auth-token.md

≈788 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Authenticate the SDK with a Store API Key

Every data-plane request carries Authorization: Bearer <store-api-key>. The SDKs add this header for you — just pass the key (and store ID) at client construction. Both SDKs follow the same convention:

Field Python TypeScript Environment variable
Server URL server_url (1st positional) serverURL (set yourself, e.g. AGENT_MEMORY_BASE_URL)
API key api_key apiKey AGENT_MEMORY_API_KEY
Store ID store_id (global) storeId (global) AGENT_MEMORY_STORE_ID

store_id / storeId is a global parameter — set it on the client once and every per-store operation uses it by default. You can still override it per call.

Correct: Read the key from a secrets manager (or environment) and construct the client once per process.

Python:

import os
from redis_agent_memory import AgentMemory

# Construct once at startup; reuse across requests.
# The `with` block ensures the underlying httpx client is closed cleanly.
def make_client() -> AgentMemory:
    return AgentMemory(
        os.environ["AGENT_MEMORY_BASE_URL"],         # e.g. https://gcp-us-east4.memory.redis.io
        store_id=os.environ["AGENT_MEMORY_STORE_ID"],
        api_key=os.environ["AGENT_MEMORY_API_KEY"],
    )

with make_client() as agent_memory:
    agent_memory.health()

TypeScript:

import { AgentMemory } from "@redis-iris/agent-memory";

// Construct once at module scope; the SDK is safe to share across requests.
export const agentMemory = new AgentMemory({
  serverURL: process.env.AGENT_MEMORY_BASE_URL!,
  storeId:   process.env.AGENT_MEMORY_STORE_ID!,
  apiKey:    process.env.AGENT_MEMORY_API_KEY!,
});

await agentMemory.health();

Incorrect: Hard-coding the key, building the client per request, or constructing the bearer header by hand.

# Bad: key in source — leaks through git history and any traceback log.
agent_memory = AgentMemory(
    "https://gcp-us-east4.memory.redis.io",
    store_id="01HZ...",
    api_key="sk-live-abc123...",       # <-- never
)

# Bad: new client per request — wastes the underlying TCP/TLS pool.
def handle(req):
    with AgentMemory(URL, store_id=SID, api_key=KEY) as agent_memory:
        return agent_memory.get_session_memory(session_id=req.session_id)
// Bad: rebuilding the Authorization header manually defeats the SDK's typing,
// retry, and error-class machinery.
const res = await fetch(`${URL}/v1/stores/${SID}/session-memory/events`, {
  method:  "POST",
  headers: { Authorization: `Bearer ${KEY}` },
  body:    JSON.stringify(event),
});

Rotation: Regenerate the key from the Cloud console. There is no short-lived-token flow — rotation is the only mitigation if a key leaks.

Per-operation override: Both SDKs accept a store_id / storeId argument on every call, which overrides the global. Use this when one process talks to multiple stores; do not use it to "scope" calls — global is fine for single-store apps.

Reference: Redis Cloud Agent Memory

Source: SKILL.md on GitHub

1 warning1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides comprehensive documentation and code examples for integrating with Redis Agent Memory (RAM) using official Python and TypeScript SDKs. It follows security best practices for credential management and relies on official Redis infrastructure.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 1 issue

Signed by skilld at d20b723. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
metadata
{
  "author": "redis",
  "version": "1.0.0"
}
  • Python
  • TypeScript
  • redis
  • agent-memory
  • session-memory
  • long-term-memory
  • semantic-search
  • redis-cloud

README badge

README badge for redis/agent-skills/iris-development

Manages session and long-term memory for AI agents on Redis Cloud using the official `redis-agent-memory` (Python) and `@redis-iris/agent-memory` (TypeScript) SDKs. Covers recording conversation events, searching semantically indexed memories, configuring memory stores, and tuning background memory promotion between session and persistent tiers.

Generated from the current SKILL.md.

Does this skill work with both Python and TypeScript?
Yes. The skill provides code examples for both the official `redis-agent-memory` (Python) SDK and `@redis-iris/agent-memory` (TypeScript) SDK.
What is Redis Agent Memory (RAM)?
It is a managed persistent memory service for AI agents on Redis Cloud with two tiers: session memory for conversation history and long-term memory for semantically searchable facts. A background promotion worker extracts durable facts from sessions automatically.
Do I need to set up a Redis Cloud service first?
Yes. You must create a Memory service on Redis Cloud and obtain an API key and store ID, which the SDK reads from `AGENT_MEMORY_API_KEY` and `AGENT_MEMORY_STORE_ID` environment variables.
Can I search memories semantically?
Yes. The skill covers semantic search of long-term memory with filtering using the `search_long_term_memory()` (Python) or `searchLongTermMemory()` (TypeScript) method.
What is the difference between session events and long-term memory?
Session memory is append-only conversation history per session. Long-term memory stores semantically searchable records extracted from sessions by the background promotion worker or created directly; use the skill's session-when-to-use rule to decide which to use.

Generated from the current SKILL.md. These answers refresh after source changes.