---
title: Upstash AgentKit
description: Give your agents ranked recall and automatic capture on Upstash Redis, or a Redis backend for file memory.
type: memory
keywords:
  - upstash
  - agentkit
  - redis
  - memory
  - memory slots
  - file memory
  - long-term memory
  - ranked recall
  - conversation history
---

# Upstash AgentKit

Memory provider integration for eve. Give your agents ranked recall and automatic capture on Upstash Redis, or a Redis backend for file memory.

## Install

Install the Upstash AgentKit memory provider for eve:

```bash
eve add memory/upstash-agentkit
```

This installs `@upstash/agentkit-eve` and `@upstash/redis`, then writes a memory slot. The `@upstash/agentkit-eve/memory` entry point requires eve 0.45.2 or later.

## Quick start

Add an Upstash Redis database's REST credentials to the agent's environment:

```bash title=".env.local"
UPSTASH_REDIS_REST_URL=https://...
UPSTASH_REDIS_REST_TOKEN=...
```

The registry creates this memory slot:

```ts title="agent/memory/upstash-agentkit.ts"
import { redisMemory } from "@upstash/agentkit-eve/memory";
import { defineMemory } from "eve/memory";
import { byPrincipal } from "eve/memory/scope";

export default defineMemory({
  description: "Recall and manage durable context for the current user.",
  provider: redisMemory({ topK: 5 }),
  scope: byPrincipal,
});
```

The filename creates the `upstash-agentkit` slot. It recalls matching curated facts before each turn, captures user messages after completed turns by default, and gives the model `upstash-agentkit__save_memory`, `upstash-agentkit__search_memory`, `upstash-agentkit__read_session`, and `upstash-agentkit__forget_memory` tools.

## Configure

`byPrincipal` keeps memory disabled for anonymous and runtime principals, and shares the local-development scope while you run `eve dev`. For a multi-tenant agent, replace it with a scope resolver that derives both tenant and caller identity from verified session context. See [Multi-tenant memory](/docs/patterns/multi-tenant-memory).

Use `redisDocuments()` with `fileMemory({ backend: redisDocuments() })` when you want eve's bounded, model-curated document and its `save_memory` and `remove_memory` tools, but want Redis rather than the default local or Vercel Blob backend. Use `redisMemory()` for relevance-ranked recall and automatic capture. Both partition Redis with eve's locked scope key.

The provider stores memory content in your Upstash Redis database. Review its retention before enabling it for sensitive data. See the [Upstash AgentKit eve guide](https://upstash.com/docs/redis/sdks/agentkit/eve) for options including retention, recall limits, and automatic capture.

AgentKit also ships `@upstash/agentkit-eve-extension`, an eve extension that adds Redis Search tools over your own documents and searchable chat history. Mount it separately under `agent/extensions/` when you need those capabilities; the memory slot does not depend on it.

[Read the full memory provider documentation](https://upstash.com/docs/redis/sdks/agentkit/eve)

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)