Overview
Add persistent memory to your AI app in 5 minutes
Databaset gives your AI apps long-term memory. Store user preferences, conversation context, and facts. When you need them again, recall by meaning, not keywords.
Prerequisites
- Node.js 18+ or Python 3.10+
- A Databaset account
- An API key from the dashboard
Step 1: Install SDK
npm install @databaset/sdkpip install databasetStep 2: Get your API key
- Go to Dashboard → API Keys → Create Key
- Copy your key and set it as an environment variable:
export DATABASET_API_KEY="db_..."Never commit API keys to source control. Use environment variables or a secrets manager.
Step 3: Initialize client
import { Memory } from '@databaset/sdk'
const memory = new Memory() // reads DATABASET_API_KEY automaticallyfrom databaset import Memory
memory = Memory() # reads DATABASET_API_KEY automaticallyexport DATABASET_API_KEY="db_your_key_here"Step 4: Store your first memory
await memory.store({
userId: 'user_123',
text: 'User prefers dark mode and speaks Hindi'
})memory.store(
user_id="user_123",
text="User prefers dark mode and speaks Hindi"
)Step 5: Recall memory
const context = await memory.recall({
userId: 'user_123',
query: 'what are user preferences?'
})
console.log(context)
// "User prefers dark mode and speaks Hindi"context = memory.recall(
user_id="user_123",
query="what are user preferences?"
)
print(context)Step 6: Use with Claude or GPT
Inject recalled context into your AI prompt for personalized responses.
const context = await memory.recall({
userId: 'user_123',
query: userMessage
})
const response = await anthropic.messages.create({
model: 'claude-sonnet-4-6',
messages: [
{
role: 'user',
content: `Context: ${context}\n\nUser: ${userMessage}`
}
]
})What's next
- API Reference: full REST API documentation
- Build a chatbot with memory: end-to-end example
- Node.js SDK: complete SDK reference
- Self-hosting guide: run Databaset on your infrastructure