Upstash Redis for Agents (start-redis)
A zero-config Redis database for AI agents — no signup, no UI, no SDK setup. One HTTP request returns a working endpoint + token. Databases live for 3 days unless the user claims them.
Use this when:
- The agent needs Redis right now and the user has not given you credentials.
- You want short-term memory across tool calls, conversation history, a sub-agent work queue, or recent-first ranked recall.
This is built for quick experiments, prototypes, and demos rather than production workloads or anything tied to a real user account — the database is temporary and unauthenticated until claimed, so keep PII, secrets, and production credentials out of it.
Create or re-fetch a database
# Generate a fresh UUIDv4 yourself, then POST it as the Idempotency-Key.
# The UUIDv4 you send becomes the database id.
curl -X POST -H "Idempotency-Key: <uuidv4>" https://upstash.com/start-redis
- Sending your own UUIDv4 makes the first call retry-safe — if the response is lost, retrying with the same UUID returns the same database instead of minting a duplicate.
- Re-POST with the same
Idempotency-Key to re-fetch credentials for an existing database.
- The header is optional. Omit it to mint a new database with a server-generated id (returned in the response — re-fetch later by passing that id back as
Idempotency-Key). Only UUIDv4 is accepted.
The response is markdown containing:
Database ID, Endpoint, Token
Metrics URL (JSON: uptime, commands, keys, throughput, memory, bandwidth)
Expires date
Console URL to share with the user (where they view usage and click Claim to keep the database)
- An inline quickstart for the body-style REST API
Parse these out of the markdown response and use them directly — there is no separate JSON envelope.
Calling the database (body-style REST)
The returned endpoint speaks the Upstash Redis REST API. Prefer the body-style form: POST a JSON array as the body so you don't have to URL-encode the command.
# SET with TTL
curl https://<endpoint> \
-H "Authorization: Bearer <token>" \
-d '["SET","session:abc","{\"step\":2}","EX","3600"]'
# GET
curl https://<endpoint> \
-H "Authorization: Bearer <token>" \
-d '["GET","session:abc"]'
You can also use the official SDKs against the same endpoint + token (@upstash/redis for TS/JS, upstash-redis for Python).
Common agent patterns
| Need |
Commands |
| Short-term memory across tool calls in one run |
SET key value EX <ttl> / GET key |
| Conversation / turn-by-turn log |
LPUSH chat:<user> <json> / LRANGE chat:<user> 0 20 |
| Sub-agent work queue (producer/consumer) |
LPUSH jobs <json> / RPOP jobs |
| Ranked memory (recent-first or score-first) |
ZADD memories <score> <member> / ZREVRANGE memories 0 9 |
Tell the user
After provisioning, surface the console URL from the response to the user. Make clear that:
- The database expires in 3 days.
- They can view usage at the console URL and click Claim to keep it.
- This is unauthenticated scratch storage — don't put secrets or PII in it.
Reference
1---2name: upstash-redis-start3description: Provision a zero-config, no-signup, temporary Upstash Redis database for an AI agent with a single POST to https://upstash.com/start-redis, with no account, API key, or SDK setup required. Use when an agent needs scratch Redis right now and the user has not provided credentials, for short-term memory across tool calls, conversation history, a sub-agent work queue, ranked recall, or a quick prototype or demo. Covers idempotent creation and re-fetching credentials, calling the database through the body-style REST API or the official SDKs, and telling the user how to claim it. The database lives 3 days unless the user claims it; not for production data, PII, or secrets.4license: MIT5---6
7# Upstash Redis for Agents (`start-redis`)
8
9A zero-config Redis database for AI agents — **no signup, no UI, no SDK setup**. One HTTP request returns a working endpoint + token. Databases live for **3 days** unless the user claims them.
10
11Use this when:
12- The agent needs Redis right now and the user has not given you credentials.
13- You want short-term memory across tool calls, conversation history, a sub-agent work queue, or recent-first ranked recall.
14
15This is built for quick experiments, prototypes, and demos rather than production workloads or anything tied to a real user account — the database is temporary and unauthenticated until claimed, so keep PII, secrets, and production credentials out of it.
16
17## Create or re-fetch a database
18
19```bash
20# Generate a fresh UUIDv4 yourself, then POST it as the Idempotency-Key.
21# The UUIDv4 you send becomes the database id.
22curl -X POST -H "Idempotency-Key: <uuidv4>" https://upstash.com/start-redis
23```
24
25- Sending your own UUIDv4 makes the first call **retry-safe** — if the response is lost, retrying with the same UUID returns the same database instead of minting a duplicate.
26- Re-POST with the same `Idempotency-Key` to **re-fetch credentials** for an existing database.
27- The header is optional. Omit it to mint a new database with a server-generated id (returned in the response — re-fetch later by passing that id back as `Idempotency-Key`). Only UUIDv4 is accepted.
28
29The response is markdown containing:
30- `Database ID`, `Endpoint`, `Token`
31- `Metrics` URL (JSON: uptime, commands, keys, throughput, memory, bandwidth)
32- `Expires` date
33- `Console URL` to share with the user (where they view usage and click **Claim** to keep the database)
34- An inline quickstart for the body-style REST API
35
36Parse these out of the markdown response and use them directly — there is no separate JSON envelope.
37
38## Calling the database (body-style REST)
39
40The returned endpoint speaks the Upstash Redis REST API. Prefer the **body-style** form: POST a JSON array as the body so you don't have to URL-encode the command.
41
42```bash
43# SET with TTL
44curl https://<endpoint> \
45 -H "Authorization: Bearer <token>" \
46 -d '["SET","session:abc","{\"step\":2}","EX","3600"]'
47
48# GET
49curl https://<endpoint> \
50 -H "Authorization: Bearer <token>" \
51 -d '["GET","session:abc"]'
52```
53
54You can also use the official SDKs against the same endpoint + token (`@upstash/redis` for TS/JS, `upstash-redis` for Python).
55
56## Common agent patterns
57
58| Need | Commands |
59|------|----------|
60| Short-term memory across tool calls in one run | `SET key value EX <ttl>` / `GET key` |
61| Conversation / turn-by-turn log | `LPUSH chat:<user> <json>` / `LRANGE chat:<user> 0 20` |
62| Sub-agent work queue (producer/consumer) | `LPUSH jobs <json>` / `RPOP jobs` |
63| Ranked memory (recent-first or score-first) | `ZADD memories <score> <member>` / `ZREVRANGE memories 0 9` |
64
65## Tell the user
66
67After provisioning, surface the **console URL** from the response to the user. Make clear that:
68- The database expires in 3 days.
69- They can view usage at the console URL and click **Claim** to keep it.
70- This is unauthenticated scratch storage — don't put secrets or PII in it.
71
72## Reference
73
74- Service entry point (also serves the `GET` doc): https://upstash.com/start-redis
75- Full REST API: https://upstash.com/docs/redis/features/restapi
76- TS/JS SDK: https://upstash.com/docs/redis/sdks/ts
77- Python SDK: https://upstash.com/docs/redis/sdks/py