Memory API
Intelligent memory for your AI agents
The Memory API gives your AI agents persistent, intelligent memory that understands time, relationships, and context. Built for cost efficiency at scale.
Quick Start
1. Get your API key
Sign up at aisnapbuild.com and generate an API key from your dashboard.
2. Install the SDK
npm install @aisnapbuild/memory3. Store your first memory
import { MemoryClient } from '@aisnapbuild/memory';
const memory = new MemoryClient({
apiKey: process.env.AISNAPBUILD_API_KEY
});
// Store a memory
await memory.store({
content: "User prefers dark mode interfaces",
entityId: "user_123",
metadata: { source: "settings", confidence: 0.95 }
});
// Query memories
const results = await memory.query({
text: "user preferences",
limit: 5,
temporalWeight: 0.8 // Prefer recent memories
});Core Features
Temporal Awareness
Time-weighted memory retrieval with configurable decay functions. Recent memories naturally surface when relevant.
Relationship Mapping
Automatic entity extraction and graph-based storage. Query relationships between users, products, concepts.
Cost Efficiency
Smart caching, deduplication, and tiered storage. Optimize for your workload without sacrificing intelligence.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/memory | Store a new memory |
| GET | /v1/memory/query | Query memories with semantic search |
| GET | /v1/memory/{id} | Retrieve a specific memory |
| DELETE | /v1/memory/{id} | Delete a memory |
| POST | /v1/relationships | Create entity relationships |
| GET | /v1/relationships/graph | Query relationship graph |
Base URL: https://api.aisnapbuild.com
Authentication
All API requests require an API key passed in the Authorization header:
Authorization: Bearer YOUR_API_KEYKeep your API key secure. Never expose it in client-side code.Learn more about authentication →
Use Cases
Conversational AI
Give chatbots memory that persists across sessions with natural time decay.
Personalization
Remember user preferences and behavior patterns for tailored experiences.
Knowledge Bases
Store and retrieve organizational knowledge with relationship context.
Agent Workflows
Share context between multiple AI agents working on complex tasks.