Documentation

Everything you need to integrate Memory Layer into your applications

Quick Start

Get up and running in under 5 minutes

Install the SDK:

npm install memory-layer-sdk

Initialize:

import { MemoryLayer } from 'memory-layer-sdk';

const memory = new MemoryLayer({
  apiKey: process.env.MEMORY_LAYER_KEY
});

Store context:

await memory.store({
  userId: 'user_123',
  context: { preference: 'dark mode' }
});

Recall:

const data = await memory.recall({ userId: 'user_123' });

API Reference

Complete API documentation

POST /api/memory/store
Store user context and conversations

GET /api/memory/recall/:userId
Retrieve stored context for a user

DELETE /api/memory/:userId
Clear user memory (GDPR compliance)

POST /api/memory/search
Semantic search across stored memories

Integration Examples

Real-world implementation patterns

Chatbot Integration:
const response = await fetch('/api/chat', {
  method: 'POST',
  body: JSON.stringify({
    message: userInput,
    context: await memory.recall({ userId })
  })
});

CRM Integration:
await memory.store({
  userId: clientId,
  context: {
    lastInteraction: new Date(),
    preferences: clientPrefs,
    history: conversationLog
  }
});

Security & Privacy

Data protection and compliance

✓ End-to-end encryption
✓ GDPR & CCPA compliant
✓ SOC 2 Type II certified
✓ User data deletion on request
✓ No data sharing with third parties
✓ Configurable data retention policies