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.

referencessession-when-to-use.md

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

Choose Session Events vs Long-Term Memory

Redis Agent Memory has two tiers. They serve different jobs — picking the wrong one is the single biggest source of cost and correctness problems.

Tier What it stores Retrieval Lifetime Cost shape
Session memory Raw, ordered conversation events for one session Whole session or by eventId Session-scoped TTL (configured at store creation) Cheap writes, no LLM cost on the write path
Long-term memory Extracted facts/summaries/messages Semantic search across sessions Default 1 year TTL Each promotion runs an LLM call

Correct: Append every turn of the conversation as a session event. Let the background promotion worker decide what becomes long-term memory.

Python:

from datetime import datetime, timezone
from redis_agent_memory import AgentMemory, models

# Every user/assistant turn → add_session_event. That's it.
agent_memory.add_session_event(
    session_id=session_id,
    actor_id="user-42",
    role=models.MessageRole.USER,
    content=[{"text": user_msg}],
    created_at=datetime.now(timezone.utc),
)
agent_memory.add_session_event(
    session_id=session_id,
    actor_id="agent-1",
    role=models.MessageRole.ASSISTANT,
    content=[{"text": reply}],
    created_at=datetime.now(timezone.utc),
)
# Promotion happens asynchronously — see promotion-overview.

TypeScript:

await agentMemory.addSessionEvent({
  sessionId: sessionId,
  actorId:   "user-42",
  role:      "USER",
  content:   [{ text: userMsg }],
  createdAt: new Date(),
});
await agentMemory.addSessionEvent({
  sessionId: sessionId,
  actorId:   "agent-1",
  role:      "ASSISTANT",
  content:   [{ text: reply }],
  createdAt: new Date(),
});

Correct: Write to long-term memory directly when you already have a structured fact and don't want to pay for extraction.

Python:

# Pre-known fact — skip the LLM and write LTM directly.
agent_memory.bulk_create_long_term_memories(memories=[
    {
        "id":          "user-42-timezone",
        "text":        "User 42 is in Europe/Sofia (UTC+2/+3).",
        "memory_type": models.MemoryType.SEMANTIC,
        "owner_id":    "user-42",
        "topics":      ["profile", "timezone"],
    },
])

TypeScript:

await agentMemory.bulkCreateLongTermMemories({
  memories: [
    {
      id:         "user-42-timezone",
      text:       "User 42 is in Europe/Sofia (UTC+2/+3).",
      memoryType: "semantic",
      ownerId:    "user-42",
      topics:     ["profile", "timezone"],
    },
  ],
});

Incorrect: Using long-term memory as the conversation buffer.

# Bad: each turn pays for embedding + LTM write, and the agent loses turn order.
for turn in conversation:
    agent_memory.bulk_create_long_term_memories(memories=[{
        "id":          f"{session_id}-{turn.idx}",
        "text":        turn.text,
        "memory_type": models.MemoryType.MESSAGE,
    }])

Why it's bad: LTM is vector-indexed (cost per write) and unordered (you re-paginate to reconstruct a session). Session memory is append-only and keeps createdAt order for free.

Rule of thumb: if you'd want to retrieve it in a different future conversation, it belongs in LTM (usually via promotion). If you only need it for the current turn or the rest of this session, it stays in session 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.