Retrieve Memory API
Retrieve persistent memory values stored by your AI agent via REST API. Designed to be the companion to memory-set — together they give your agents stateful memory that outlasts any individual conversation or session.
Try it live →How it works
POST a key and optional namespace. Returns the stored value, creation timestamp, last-updated timestamp, associated tags, and TTL if set. Returns null with a clear indicator if the key does not exist (rather than throwing an error).
Use cases
- Retrieve user preferences at the start of each conversation
- Read the last-saved state of a workflow to resume where it left off
- Check if a computed result is already cached before recalculating
- Load agent configuration that was set up in a previous session
API Reference
POST https://slopshop.gg/v1/memory-get
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | required | The memory key name |
value |
any | optional | The value to store (for set operations) |
namespace |
string | optional | Optional namespace for isolation |
Example response
{
"data": {
"key": "my-key",
"value": "stored value",
"updated_at": "2025-01-15T10:30:00Z"
},
"meta": {
"credits_used": 1,
"engine": "real",
"ms": 4
}
}
Examples
Three real-world scenarios showing how developers use Retrieve Memory in production.
curl -X POST https://slopshop.gg/v1/memory-get \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"key": "user_language", "namespace": "user:42"}'
curl -X POST https://slopshop.gg/v1/memory-get \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"key": "workflow_step", "namespace": "job:8821"}'
curl -X POST https://slopshop.gg/v1/memory-get \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"key": "report_2024_q3"}'
Code examples
curl
curl -X POST https://slopshop.gg/v1/memory-get \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "your data here"}'
Python
import requests
response = requests.post(
"https://slopshop.gg/v1/memory-get",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"input": "your data here"}
)
result = response.json()
print(result["data"])
Node.js
const response = await fetch("https://slopshop.gg/v1/memory-get", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);
CLI
# Install the Slopshop CLI
npm install -g slopshop
# Set your API key
export SLOPSHOP_KEY=your_api_key
# Call memory-get
slop memory-get '{"input": "your data here"}'
Pricing
Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 1 credit per call — that's $0.001. See all pricing tiers.
Related APIs in Memory
View the full API catalog · Try in playground · Documentation