Test with cURL
Send your first request to see memory in action:
curl -X POST http://generalmillsnacufs2020.com/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "My name is Alex"}],
"user": "user-123"
}'
How Memory Works
1. Send messages with a user ID
2. Memori automatically extracts facts from conversations
3. On future requests, relevant memories are injected into context
4. The AI remembers everything about each user
Tip: The user field is required. Use your app's user ID so each user has their own memory.
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="http://generalmillsnacufs2020.com/v1/",
api_key="not-needed"
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "I love hiking"}],
user="user-123" # Required for memory
)
print(response.choices[0].message.content)
JavaScript / Node.js
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'http://generalmillsnacufs2020.com/v1/',
apiKey: 'not-needed'
});
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'I work at Acme Corp' }],
user: 'user-123'
});
console.log(response.choices[0].message.content);
Drop-in replacement: Any OpenAI-compatible SDK works. Just change the base URL.
Endpoints
| Method | Endpoint | Description |
| POST | /v1/chat/completions | Chat with memory |
| GET | /v1/memories/{user_id} | Get user memories |
| DELETE | /v1/memories/{user_id} | Clear user memories |
| GET | /v1/usage | Memory usage stats |
| GET | /health | Health check |
Chat Request Body
{
"model": "gpt-4", // Any model name (routed to Gradient AI)
"messages": [...], // OpenAI message format
"user": "user-123", // Required: unique user identifier
"temperature": 0.7, // Optional: 0-2
"max_tokens": 1000 // Optional
}
Response Extensions
Responses include a memori field with memory stats:
{
"choices": [...],
"memori": {
"facts_extracted": 2, // New facts from this message
"facts_recalled": 3, // Memories used for context
"memories_used": 150, // Total memories stored
"memories_limit": 5000 // Your quota
}
}
Option 1: Call the API (Recommended)
Use this endpoint from anywhere - your server, frontend, or serverless functions:
http://generalmillsnacufs2020.com/v1/chat/completions
Works with any language or framework that supports HTTP requests or OpenAI SDKs.
Option 2: Build on the Droplet
Deploy your own app alongside Memori on the same server:
# SSH into your Droplet
ssh root@your-droplet-ip
# Call the local API from your app
curl http://localhost:8000/v1/chat/completions ...
For Droplet management, see DigitalOcean Droplet Docs.
Need More Memories?
This deployment includes 5,000 free memories. For unlimited usage:
Memori Cloud - Managed, unlimited memories
Self-host Memori - Full control, Apache 2.0 license