Skip to content

Commit 96e68ee

Browse files
authored
Merge pull request #6 from upstash/DX-2639
DX-2639: add upstash-redis-start skill for zero-config Redis provisioning
1 parent 0913ba1 commit 96e68ee

5 files changed

Lines changed: 155 additions & 0 deletions

File tree

skills/upstash-redis-js/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ UPSTASH_REDIS_REST_URL=https://your-redis.upstash.io
3939
UPSTASH_REDIS_REST_TOKEN=your-token-here
4040
```
4141

42+
> **No credentials yet?** If you're an agent that needs scratch Redis and the user hasn't provided a database, you can mint a temporary one with a single POST to `https://upstash.com/start-redis` (3-day TTL, no signup).
43+
4244
## Skill Files Overview
4345

4446
### Data Structures (skills/data-structures/)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: upstash-redis-start
3+
description: Provision a zero-config, no-signup Upstash Redis database for an AI agent via a single POST to `https://upstash.com/start-redis`. Use when an agent needs scratch Redis for short-term memory, conversation history, sub-agent work queues, or ranked recall and the user has not provided credentials. The database lives 3 days unless the user claims it.
4+
---
5+
6+
# Upstash Redis for Agents (`start-redis`)
7+
8+
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.
9+
10+
Use this when:
11+
- The agent needs Redis right now and the user has not given you credentials.
12+
- You want short-term memory across tool calls, conversation history, a sub-agent work queue, or recent-first ranked recall.
13+
14+
Do **not** use this for: production workloads, anything tied to a user account, or anything storing PII / secrets / production credentials. The database is temporary and unauthenticated until claimed.
15+
16+
## Create or re-fetch a database
17+
18+
```bash
19+
# Generate a fresh UUIDv4 yourself, then POST it as the Idempotency-Key.
20+
# The UUIDv4 you send becomes the database id.
21+
curl -X POST -H "Idempotency-Key: <uuidv4>" https://upstash.com/start-redis
22+
```
23+
24+
- 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.
25+
- Re-POST with the same `Idempotency-Key` to **re-fetch credentials** for an existing database.
26+
- 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.
27+
28+
The response is markdown containing:
29+
- `Database ID`, `Endpoint`, `Token`
30+
- `Metrics` URL (JSON: uptime, commands, keys, throughput, memory, bandwidth)
31+
- `Expires` date
32+
- `Console URL` to share with the user (where they view usage and click **Claim** to keep the database)
33+
- An inline quickstart for the body-style REST API
34+
35+
Parse these out of the markdown response and use them directly — there is no separate JSON envelope.
36+
37+
## Calling the database (body-style REST)
38+
39+
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.
40+
41+
```bash
42+
# SET with TTL
43+
curl https://<endpoint> \
44+
-H "Authorization: Bearer <token>" \
45+
-d '["SET","session:abc","{\"step\":2}","EX","3600"]'
46+
47+
# GET
48+
curl https://<endpoint> \
49+
-H "Authorization: Bearer <token>" \
50+
-d '["GET","session:abc"]'
51+
```
52+
53+
You can also use the official SDKs against the same endpoint + token (`@upstash/redis` for TS/JS, `upstash-redis` for Python).
54+
55+
## Common agent patterns
56+
57+
| Need | Commands |
58+
|------|----------|
59+
| Short-term memory across tool calls in one run | `SET key value EX <ttl>` / `GET key` |
60+
| Conversation / turn-by-turn log | `LPUSH chat:<user> <json>` / `LRANGE chat:<user> 0 20` |
61+
| Sub-agent work queue (producer/consumer) | `LPUSH jobs <json>` / `RPOP jobs` |
62+
| Ranked memory (recent-first or score-first) | `ZADD memories <score> <member>` / `ZREVRANGE memories 0 9` |
63+
64+
## Tell the user
65+
66+
After provisioning, surface the **console URL** from the response to the user. Make clear that:
67+
- The database expires in 3 days.
68+
- They can view usage at the console URL and click **Claim** to keep it.
69+
- This is unauthenticated scratch storage — don't put secrets or PII in it.
70+
71+
## Reference
72+
73+
- Service entry point (also serves the `GET` doc): https://upstash.com/start-redis
74+
- Full REST API: https://upstash.com/docs/redis/features/restapi
75+
- TS/JS SDK: https://upstash.com/docs/redis/sdks/ts
76+
- Python SDK: https://upstash.com/docs/redis/sdks/py

skills/upstash/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Lightweight guidance for using the Upstash Redis RateLimit TypeScript/JavaScript
2727

2828
Work with the Upstash Redis TypeScript/JavaScript SDK for serverless Redis operations. Use for caching, session storage, rate limiting, leaderboards, full-text search (querying, filtering, aggregating) with Upstash Redis Search (different from regular FT.SEARCH), and all Redis data structures. Supports automatic serialization/deserialization of JavaScript types. Upstash Redis Search also available via @upstash/search-redis and @upstash/search-ioredis adapters for TCP clients.
2929

30+
## [upstash-redis-start](upstash-redis-start/overview.md)
31+
32+
Provision a zero-config, no-signup Upstash Redis database for an AI agent via a single POST to `https://upstash.com/start-redis`. Use when an agent needs scratch Redis for short-term memory, conversation history, sub-agent work queues, or ranked recall and the user has not provided credentials. The database lives 3 days unless the user claims it.
33+
3034
## [upstash-search-js](upstash-search-js/overview.md)
3135

3236
Skills covering Upstash Search quick starts, core concepts, and TypeScript/JavaScript SDK usage. Use when a user asks how to get started, how indexing works, or how to use the TS client.

skills/upstash/upstash-redis-js/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ UPSTASH_REDIS_REST_URL=https://your-redis.upstash.io
3434
UPSTASH_REDIS_REST_TOKEN=your-token-here
3535
```
3636

37+
> **No credentials yet?** If you're an agent that needs scratch Redis and the user hasn't provided a database, you can mint a temporary one with a single POST to `https://upstash.com/start-redis` (3-day TTL, no signup).
38+
3739
## Skill Files Overview
3840

3941
### Data Structures (skills/data-structures/)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Upstash Redis for Agents (`start-redis`)
2+
3+
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.
4+
5+
Use this when:
6+
- The agent needs Redis right now and the user has not given you credentials.
7+
- You want short-term memory across tool calls, conversation history, a sub-agent work queue, or recent-first ranked recall.
8+
9+
Do **not** use this for: production workloads, anything tied to a user account, or anything storing PII / secrets / production credentials. The database is temporary and unauthenticated until claimed.
10+
11+
## Create or re-fetch a database
12+
13+
```bash
14+
# Generate a fresh UUIDv4 yourself, then POST it as the Idempotency-Key.
15+
# The UUIDv4 you send becomes the database id.
16+
curl -X POST -H "Idempotency-Key: <uuidv4>" https://upstash.com/start-redis
17+
```
18+
19+
- 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.
20+
- Re-POST with the same `Idempotency-Key` to **re-fetch credentials** for an existing database.
21+
- 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.
22+
23+
The response is markdown containing:
24+
- `Database ID`, `Endpoint`, `Token`
25+
- `Metrics` URL (JSON: uptime, commands, keys, throughput, memory, bandwidth)
26+
- `Expires` date
27+
- `Console URL` to share with the user (where they view usage and click **Claim** to keep the database)
28+
- An inline quickstart for the body-style REST API
29+
30+
Parse these out of the markdown response and use them directly — there is no separate JSON envelope.
31+
32+
## Calling the database (body-style REST)
33+
34+
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.
35+
36+
```bash
37+
# SET with TTL
38+
curl https://<endpoint> \
39+
-H "Authorization: Bearer <token>" \
40+
-d '["SET","session:abc","{\"step\":2}","EX","3600"]'
41+
42+
# GET
43+
curl https://<endpoint> \
44+
-H "Authorization: Bearer <token>" \
45+
-d '["GET","session:abc"]'
46+
```
47+
48+
You can also use the official SDKs against the same endpoint + token (`@upstash/redis` for TS/JS, `upstash-redis` for Python).
49+
50+
## Common agent patterns
51+
52+
| Need | Commands |
53+
|------|----------|
54+
| Short-term memory across tool calls in one run | `SET key value EX <ttl>` / `GET key` |
55+
| Conversation / turn-by-turn log | `LPUSH chat:<user> <json>` / `LRANGE chat:<user> 0 20` |
56+
| Sub-agent work queue (producer/consumer) | `LPUSH jobs <json>` / `RPOP jobs` |
57+
| Ranked memory (recent-first or score-first) | `ZADD memories <score> <member>` / `ZREVRANGE memories 0 9` |
58+
59+
## Tell the user
60+
61+
After provisioning, surface the **console URL** from the response to the user. Make clear that:
62+
- The database expires in 3 days.
63+
- They can view usage at the console URL and click **Claim** to keep it.
64+
- This is unauthenticated scratch storage — don't put secrets or PII in it.
65+
66+
## Reference
67+
68+
- Service entry point (also serves the `GET` doc): https://upstash.com/start-redis
69+
- Full REST API: https://upstash.com/docs/redis/features/restapi
70+
- TS/JS SDK: https://upstash.com/docs/redis/sdks/ts
71+
- Python SDK: https://upstash.com/docs/redis/sdks/py

0 commit comments

Comments
 (0)