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-retrieval.md

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

Retrieve Session Memory and Individual Events

The SDK exposes three read paths against session memory; pick the narrowest one for the job.

Python TypeScript Returns Use when
get_session_memory(session_id=...) getSessionMemory(sessionId) All events for the session in order, plus owner_id Rebuilding the prompt context for a conversation
get_session_event(session_id=..., event_id=...) getSessionEvent(sessionId, eventId) One event You already have the eventId (e.g. from addSessionEvent response)
list_sessions(limit=..., page_token=...) listSessions({limit, pageToken}) Page of session IDs + total Admin/debug listing of sessions in a store

The session's owner_id is set from the first event's actor_id and is immutable for the lifetime of the session.

Correct: Fetch the whole session when reconstructing the agent's working context.

Python:

def load_session(agent_memory, session_id: str) -> list:
    res = agent_memory.get_session_memory(session_id=session_id)
    # res.session_id, res.owner_id, res.events (ordered by created_at)
    return res.events

TypeScript:

async function loadSession(agentMemory: AgentMemory, sessionId: string) {
  const res = await agentMemory.getSessionMemory(sessionId);
  // res.sessionId, res.ownerId, res.events (ordered by createdAt)
  return res.events;
}

Two timestamps on each event. Every SessionEvent in the response carries:

  • created_at / createdAt — the client-supplied UTC timestamp you passed at write time. This is what the agent considers "when the turn happened" and what events are ordered by.
  • system_timestamp / systemTimestamp — a server-set UTC timestamp recording when the data plane ingested the event. Useful for diagnostics (e.g. clock skew between agent and server, or detecting replayed events with stale created_at values).

Both are datetime (Python) / Date (TypeScript) on the SDK side; serialized as UTC ISO-8601 on the wire.

Correct: Page through sessions for admin tools.

Python:

def iter_session_ids(agent_memory):
    token = None
    while True:
        page = agent_memory.list_sessions(limit=200, page_token=token)
        yield from page.sessions
        token = page.next_page_token
        if not token:
            return

TypeScript:

async function* iterSessionIds(agentMemory: AgentMemory) {
  let pageToken: string | undefined;
  while (true) {
    const page = await agentMemory.listSessions({ limit: 200, pageToken });
    yield* page.sessions;
    if (!page.nextPageToken) return;
    pageToken = page.nextPageToken;
  }
}

Incorrect: Paging the full session list to find one event you already have an ID for.

# Bad: O(sessions) just to find one eventId you already have.
for sid in iter_session_ids(agent_memory):
    for ev in load_session(agent_memory, sid):
        if ev.event_id == target_event_id:
            return ev

Use get_session_event / getSessionEvent instead — it is an O(1) lookup.

Pagination limits:

  • list_sessions.limit defaults to 100, max 1000.
  • next_page_token / nextPageToken is opaque — pass it back verbatim, don't try to decode it.

Deletion:

  • delete_session_memory(session_id=...) / deleteSessionMemory(sessionId) removes the entire session and all its events.
  • delete_session_event(session_id=..., event_id=...) / deleteSessionEvent(sessionId, eventId) removes one event.
  • Already-promoted long-term memories are not affected — delete those separately via bulk_delete_long_term_memories / bulkDeleteLongTermMemories.

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.