memoryragsemantic-searchredis

Give agents long-term memory on Upstash Redis. Tools to save and recall memories scoped to a user, backed by Upstash Redis Search, so no separate vector database is needed. The same package has search tools for RAG, chat history, rate limiting, and tool caching.

Installation

pnpm add @upstash/agentkit-ai-sdk
# Add to your .env file
UPSTASH_REDIS_REST_TOKEN=your_api_key_here

Usage

import { generateText, isStepCount } from 'ai';
import { createMemoryTools } from '@upstash/agentkit-ai-sdk';

// reads UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
const { text } = await generateText({
  model: 'openai/gpt-5-mini',
  prompt: 'Remember that my favorite editor is Neovim.',
  tools: createMemoryTools({ userId: 'user-123' }),
  stopWhen: isStepCount(5),
});

console.log(text);