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

Step 1: Install SDK

npm install @databaset/sdk

Step 2: Get your API key

  1. Go to Dashboard → API Keys → Create Key
  2. 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 automatically

Step 4: Store your first memory

await memory.store({
  userId: '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"

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