Use Node.js or Python SDK to add memory capabilities to your app in minutes
SDK initialization without API Key
Call autoRegister() to auto-register and get API Key
Important: Save the API Key to your business system (database/config file)
Next time, initialize with saved API Key, memory data will be automatically linked
Memory data follows the API Key. The same API Key can access the same memories on any device.
npm install @t0ken.ai/memoryx-sdk
import { APIClient } from '@t0ken.ai/memoryx-sdk';
// First time: no API Key needed
const client = new APIClient();
// Auto register, get API Key
const account = await client.autoRegister('my-app', 'My Application');
console.log('API Key:', account.api_key);
console.log('Project ID:', account.project_id);
// ⚠️ Important: Save API Key to your database or config file!
import { APIClient } from '@t0ken.ai/memoryx-sdk';
// Read saved API Key from your storage
const savedApiKey = await db.getApiKey(userId);
// Initialize with saved API Key
const client = new APIClient({ apiKey: savedApiKey });
// Add memory
await client.sendMemories([
{ content: 'User prefers dark theme', metadata: { category: 'semantic' } }
]);
// Search memories
const results = await client.search('user preference');
autoRegister()
Auto register to get API Key
sendMemories()
Send memories (single/batch)
search()
Semantic search memories
list()
Get memory list
delete()
Delete memory
getTaskStatus()
Query async task status
pip install t0ken-memoryx
from memoryx import APIClient
# First time: no API Key needed
client = APIClient()
# Auto register, get API Key
account = client.auto_register("my-app", "My Application")
print(f"API Key: {account['api_key']}")
print(f"Project ID: {account['project_id']}")
# ⚠️ Important: Save API Key to your database or config file!
from memoryx import APIClient
# Read saved API Key from your storage
saved_api_key = db.get_api_key(user_id)
# Initialize with saved API Key
client = APIClient(api_key=saved_api_key)
# Add memory
client.send_memories([
{"content": "User prefers dark theme", "metadata": {"category": "semantic"}}
])
# Search memories
results = client.search("user preference")
auto_register()
Auto register to get API Key
send_memories()
Send memories (single/batch)
search()
Semantic search memories
list()
Get memory list
delete()
Delete memory
get_task_status()
Query async task status
episodic
Episodic memory - specific events and experiences
semantic
Semantic memory - facts and concepts
procedural
Procedural memory - skills and methods
emotional
Emotional memory - preferences and feelings
reflective
Reflective memory - summaries and reflections