Upstash Agent Memory: Serverless Redis for AI Agent State
Agents built on serverless functions have a state problem. Each request starts with no memory of the last one, so the conversation and anything the agent learned have to live somewhere else. Upstash sells serverless Redis that you call over HTTP. Its open-source AgentKit turns that Redis into agent memory. Below: what Upstash stores for an agent and how its memory tools work, then what per-command pricing means for chatty agents.
What is Upstash agent state, in one sentence?
Upstash agent state is an AI agent's chat history and long-term memory, kept in a serverless Upstash Redis database that each stateless request reads over a REST API.
Serverless functions can use it because the API is plain REST. Mastra's Upstash storage docs give two reasons it fits: you manage no connections, and it runs at the edge. Upstash's SDKs read a REST URL and a token from the environment and talk HTTP. The AgentKit docs show the client reading both with one call.
How does Upstash Redis compare with Upstash Vector for agent memory?
Upstash has two products that people reach for here. AgentKit is built on Redis, so that is the path Upstash documents for agents.
| Upstash Redis with AgentKit | Upstash Vector | |
|---|---|---|
| What it is | Serverless Redis plus an agent toolkit | Managed vector database |
| Search | Redis Search: full-text, fuzzy and hybrid | Dense, sparse or hybrid vector indexes |
| Built-in agent tools | Memory, chat history, RAG, tool cache, rate limits | None, you build the memory layer |
| Free tier | 500K commands a month, 250 MB data | 10,000 queries and 10,000 updates a day |
| Needs a second database for RAG | No, per AgentKit's docs | It is the RAG database |
Sources: the AgentKit repository and Redis Search docs. Vector figures come from the Upstash Vector docs and Redis figures from Redis pricing, accessed October 28, 2026.
How does Upstash AgentKit store agent memory?
The AgentKit repository calls it a toolkit for building production agents "entirely on Upstash Redis." It is MIT licensed. AgentKit has adapters for the Vercel AI SDK, Vercel's Eve framework and TanStack AI. There is also a memory provider for Hermes Agent on PyPI.
AgentKit keeps the model's memory apart from the chat transcript. The Eve docs put the line plainly: memory "holds facts the model decided to keep," while chat history is the transcript.
Memory is written by the model, which gets a save tool and a recall tool plus instructions on when to use them. Each memory is a Redis key scoped to a user.
Chat history is off by default in the Eve extension. Once you turn it on, every message from either side is saved automatically as the session streams. Each chat is one JSON document, indexed so it can be fuzzy-searched later. Reads return at most 50 messages per call. You can set an expiry per chat, and without one, history never expires.
The toolkit also runs RAG over documents you write into your own Redis Search index. The AI SDK adapter adds a cache for tool results and a rate limiter you check before calling the model.
The docs call userId the only tenant boundary and warn you to derive it from a verified server-side session. A userId taken from the client lets one user read another's memory.
What is Redis Search, and why does it replace a vector database?
Redis Search is Upstash's first extension beyond the official Redis spec. Built on Tantivy, a Rust search library, it indexes JSON, hashes, strings and streams. Writes are tracked automatically once an index exists. Queries are JSON. Besides fuzzy and phrase matching, they support hybrid search that merges full-text and semantic results.
That is why AgentKit needs no separate vector store. Memory recall and chat search run on the same database as the state itself. The Redis Search page does not state a release status or usage limits, so check your plan before you lean on it.
What does Upstash cost for an agent workload?
Per the Redis pricing page, accessed October 28, 2026:
| Plan | Price | Includes |
|---|---|---|
| Free | $0 | 500K commands a month, 250 MB data, 10 GB bandwidth |
| Pay as you go | $0.20 per 100K commands | First 1 GB storage free, then $0.25 per GB. Bandwidth free to 200 GB |
| Fixed 250MB | $10 a month | 50 GB bandwidth |
| Fixed 1GB | $20 a month | 100 GB bandwidth |
| Fixed 5GB | $100 a month | 500 GB bandwidth |
Larger fixed plans go up to 500 GB. Each read region adds to the fixed price.
Agents issue far more commands than a cache does. Every streamed message is a command. So is every memory lookup. Mastra's Upstash storage docs warn that pay as you go "can result in unexpectedly high costs" for agent conversations and recommend a fixed plan. We agree for anything past a prototype, because a fixed plan caps the bill when one chatty user streams thousands of messages.
Read the fine print
AgentKit is young. Its repository showed no tagged releases when we checked, and the only version visible was 0.2.0 of the core package. Treat its APIs as subject to change.
Integrations differ in what they store. Mastra's Upstash store keeps threads and messages. It cannot hold Mastra's observability traces, so you need a second store for those.
Upstash stores and searches whatever the model chooses to save. The quality of that memory depends on your prompts and your model.
The bottom line
If your agent runs on serverless functions, Upstash Redis with AgentKit is a sensible default for chat history and per-user memory, with no extra vector database. Start on the free tier and move to a fixed plan before launch. Derive userId on the server from day one.
Does your coding agent need the same kind of memory?
Upstash solves memory for the agents you ship to users. The agents you build with have the same gap. Claude Code or Codex starts each session without what the last one figured out, such as how this project deploys or why a test is flaky. If you use more than one of them, each keeps its own notes.
memU applies the same idea to coding agents: the model decides what to keep. A scheduled background task slices new session logs into jobs, and the agent distills each one into readable Markdown memory or a reusable skill. memU itself only stores and retrieves what the agent prepared, with no LLM calls of its own. A standing instruction in CLAUDE.md or AGENTS.md tells the agent to retrieve before answering. All supported hosts share one backend, so Claude Code can retrieve what a Codex session learned.
The hosted version is free and syncs across devices. Get an API key from memu.so and send your coding agent one message:
Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is
YOUR_MEMU_API_KEY.
The self-hosted option and the support matrix are in the memU GitHub repository.
FAQ
Can Upstash Redis store LLM chat history?
Yes. AgentKit saves every user and assistant message as one JSON document per chat once chat history is on. You can set an expiry per chat.
Does Upstash AgentKit need a vector database?
No. Its semantic features run on Upstash Redis Search, which supports hybrid full-text and semantic queries in the same Redis database.
Is Upstash free for AI agents?
The free tier includes 500K commands a month and 250 MB of storage. Busy agents use commands quickly, so plan for pay as you go or a fixed plan from $10 a month.
Which frameworks work with Upstash AgentKit?
AgentKit ships adapters for the Vercel AI SDK and TanStack AI, plus Vercel's Eve. Mastra has its own Upstash storage adapter.
How do I keep users' agent memories separate in Upstash?
AgentKit scopes memory and history by userId. Set it from a verified server-side session. A client-supplied userId lets one user read another's memory.