60db’s Memory system gives your AI applications a long-term, searchable memory. It stores user preferences, conversation history, knowledge base documents, and arbitrary facts, then retrieves the most relevant ones on demand using hybrid semantic + keyword search.Built on a multi-layer retrieval architecture combining vector search with a knowledge graph, Memory enables:
Personalized AI chat — the SLM remembers user preferences across sessions
Knowledge base Q&A — ingest docs and retrieve grounded answers
import { SixtyDBClient } from '60db';const client = new SixtyDBClient('your-api-key');// Store a personal memoryawait client.memory.ingest({ text: "I prefer vegetarian food and am lactose intolerant", type: "user", infer: true, // extract structured facts via LLM});// Store a knowledge base entryawait client.memory.ingest({ text: "Our refund policy allows returns within 30 days of purchase.", title: "Refund Policy", type: "knowledge", collection: "company_handbook",});
from sixtydb import SixtyDBClientclient = SixtyDBClient(api_key="your-api-key")# Store a personal memoryclient.memory.ingest( text="I prefer vegetarian food and am lactose intolerant", type="user", infer=True,)# Store a knowledge base entryclient.memory.ingest( text="Our refund policy allows returns within 30 days of purchase.", title="Refund Policy", type="knowledge", collection="company_handbook",)
curl -X POST https://api.60db.com/memory/ingest \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "I prefer vegetarian food and am lactose intolerant", "type": "user", "infer": true }'
For longer-form content — PDFs, Word docs, spreadsheets, scanned pages, emails — use POST /memory/documents/extract. The server handles format detection, OCR, and chunking for you, so you just upload the raw file and 60db does the rest.Under the hood, 60db runs your file through its document extraction engine (91+ formats with built-in OCR for scanned documents), splits the extracted text into overlapping chunks, and ingests each chunk as a knowledge-type memory in one batch.
JavaScript
Python
cURL
// Upload a PDF from a file inputconst form = new FormData();form.append('file', pdfFile); // File or Blobform.append('collection', 'company_handbook');form.append('type', 'knowledge');form.append('title', 'Employee Handbook 2026');const res = await fetch('https://api.60db.com/memory/documents/extract', { method: 'POST', headers: { 'Authorization': 'Bearer sk_your_api_key' }, body: form, // do NOT set Content-Type — browser adds multipart boundary});const { data } = await res.json();console.log(`Uploaded ${data.filename} → ${data.chunks} chunks (${data.characters} chars)`);
The returned metadata.page_count and detected_languages come from the document extraction engine and are useful for displaying upload progress or filtering by source language. Scanned PDFs will list the OCR-detected language codes (eng, fra, spa, etc.).
The /memory/context endpoint is purpose-built for retrieval-augmented generation. Given a user query, it fetches the most relevant memories, recent events, and graph relationships, and returns a pre-formatted context string ready to prepend to your LLM prompt.
JavaScript
Python
// Before calling the SLM, assemble contextconst ctx = await client.memory.context({ query: userMessage, session_id: chatSessionId, top_k: 8, max_context_length: 2000, include_timeline: true, include_graph: false,});// Prepend to system messageconst systemMessage = `You are a helpful assistant.## Relevant memories${ctx.data.prompt_ready}`;// Call SLM chat with enriched contextconst response = await client.chat.completions.create({ model: '60db-tiny', messages: [ { role: 'system', content: systemMessage }, { role: 'user', content: userMessage }, ],});
# Before calling the SLM, assemble contextctx = client.memory.context( query=user_message, session_id=chat_session_id, top_k=8, max_context_length=2000, include_timeline=True,)system_message = f"""You are a helpful assistant.## Relevant memories{ctx['data']['prompt_ready']}"""response = client.chat.completions.create( model="60db-tiny", messages=[ {"role": "system", "content": system_message}, {"role": "user", "content": user_message}, ],)
// List your collectionsconst collections = await client.memory.collections.list();// Create a team collection (admin/owner only)await client.memory.collections.create({ collection_id: "customer_support", label: "Customer Support KB", kind: "team", shared: true,});
To use Memory via an API key (for programmatic access), the key must have the memory scope. When creating an API key in Settings → Developers, check the “Memory & RAG” box.
Memory is pay-as-you-go — no subscription, no seat pricing, no minimum commitment. You pay only for the operations you run, deducted from a single workspace wallet you top up via Stripe, Razorpay, or Dodo Payments.
Operation
Rate
Ingest a memory
$0.0001 per 1,000 characters
Upload a document (extract)
$0.003 per MB
Upload a document (ingest)
$0.0001 per 1,000 extracted characters
Search (hybrid recall)
$0.0003 per query
Context assembly (LLM-ready)
$0.0005 per query
Real-world cost examples:
A knowledge base with 100 MB of docs + 10,000 searches/month → ~$23/month
A personal assistant with 1,000 user memories + 500 searches/day → ~$5/month
A support bot with 1 GB of docs + 100,000 searches/month → ~$53/month
Compared to proprietary memory services at 249–5,000/month flat, 60db Memory is 5–50x cheaper for most workloads — and you only pay for what you actually use.
Every billable request returns these response headers so you can track spend without polling:
x-credit-balance: 9.465200 ← wallet balance after this chargex-credit-charged: 0.000300 ← amount charged for this requestx-billing-tx: 84ffd09e-... ← audit row UUID
Automatic refunds — if a request fails after being charged (upstream outage, corrupt file, etc.), the charge is reversed automatically and logged as a compensating row in transaction_log. No support tickets required.Never billed — listing collections, creating collections, checking memory status, deleting memories, and GET /memory/usage are always free so you can still manage your data when the wallet is empty.See the full Pricing & Billing reference for rate details, refund policy, and the complete header/error reference.
The Memory service is designed to degrade gracefully:
If the memory layer is temporarily unreachable, POST /memory/ingest queues your memory in a retry table, returns 202 Accepted, and automatically refunds the charge so you aren’t billed for work that didn’t happen.
POST /memory/context returns an empty prompt on outage — your SLM chat still works, just without memory context. No charge when context is empty.
POST /memory/search returns 503 — the UI shows a “Memory temporarily unavailable” banner without blocking other features. Auto-refunded.
POST /memory/documents/extract auto-refunds the extract fee if extraction fails (corrupt file, empty PDF, OCR error). If extraction succeeds but the wallet can’t cover the post-extraction ingest fee, the extract fee is refunded and a 402 is returned.