@dakera-ai/dakera
v0.11.57
Published
TypeScript/JavaScript SDK for Dakera AI memory platform
Maintainers
Readme
Why Dakera?
| | Dakera | Others | |---|---|---| | LoCoMo accuracy | 87.8% (1,540 Q standard eval) | 60–92% | | Deployment | Single binary, Docker one-liner | External vector DB + embedding service required | | Embeddings | Built-in — no OpenAI key needed | Requires external embedding API | | Search modes | Vector · BM25 · Hybrid · Knowledge Graph | Usually one or two | | Bundle | ESM + CJS, browser-compatible | Often Node-only |
→ Full benchmark results · dakera.ai
Run Dakera
docker run -d \
--name dakera \
-p 3000:3000 \
-e DAKERA_ROOT_API_KEY=dk-mykey \
ghcr.io/dakera-ai/dakera:latest
curl http://localhost:3000/health # → {"status":"ok"}For persistent storage with Docker Compose:
curl -sSfL https://raw.githubusercontent.com/Dakera-AI/dakera-deploy/main/docker-compose.yml \
-o docker-compose.yml
DAKERA_API_KEY=dk-mykey docker compose up -dFull deployment guide (Docker Compose, Kubernetes, Helm): dakera-deploy
Install
npm install @dakera-ai/dakeraWorks with Node.js (20+), Deno, Bun, Cloudflare Workers, and modern browsers. Ships ESM + CJS with full TypeScript declarations.
Quick Start
import { DakeraClient } from '@dakera-ai/dakera';
const client = new DakeraClient({
baseUrl: 'http://localhost:3000',
apiKey: 'dk-mykey',
});
// Store an agent memory
await client.storeMemory('my-agent', {
content: 'User prefers concise responses with code examples',
importance: 0.9,
memory_type: 'semantic',
});
// Recall memories (semantic search)
const response = await client.recall('my-agent', 'what does the user prefer?', {
top_k: 5,
});
for (const m of response.memories) {
console.log(`[${m.score?.toFixed(2)}] ${m.content}`);
}
// Upsert vectors
await client.upsert('my-namespace', [
{ id: 'vec1', values: [0.1, 0.2, 0.3], metadata: { category: 'docs' } },
]);
// Hybrid search (vector + BM25)
const results = await client.hybridSearch('my-namespace', 'completed task', { topK: 5, vectorWeight: 0.7 });
for (const r of results) {
console.log(r.id, r.score);
}SSE Streaming
// Subscribe to real-time memory events
const stream = client.subscribeMemoryEvents('my-agent');
for await (const event of stream) {
console.log(event.type, event.memory_id);
}Features
- Agent Memory — store, recall, search, and forget memories with importance scoring
- Sessions — group memories by conversation with auto-consolidation on session end
- Knowledge Graph — traverse memory relationships, find paths, export graphs
- Vector Search — ANN queries with metadata filters and batch operations
- Full-Text Search — BM25 ranking with stemming and stop-word filtering
- Hybrid Search — combine vector similarity with keyword matching
- Text Auto-Embedding — server-side embedding generation (no local model needed)
- Namespaces — isolated vector stores per project, tenant, or use case
- Feedback Loop — upvote/downvote/flag memories to improve recall quality
- Entity Extraction — GLiNER NER for automatic entity detection
- SSE Streaming — async generator event subscriptions, browser-compatible
- Branded Types —
VectorId,AgentId,MemoryId,SessionIdfor compile-time safety - ESM + CJS — dual bundle output, works in Node.js and browsers
- Retry & Rate Limiting — built-in exponential backoff and rate-limit header tracking
- Zero Runtime Deps — uses native
fetch, no external HTTP libraries
Connect to Dakera
import { DakeraClient } from '@dakera-ai/dakera';
// Self-hosted
const client = new DakeraClient({
baseUrl: 'http://your-server:3000',
apiKey: 'your-key',
});
// Cloud (early access)
const client = new DakeraClient({
baseUrl: 'http://<your-server-ip>:3000',
apiKey: 'your-key',
});
// With custom retry config
const client = new DakeraClient({
baseUrl: 'http://localhost:3000',
apiKey: 'your-key',
retryBackoff: { maxRetries: 5, baseDelayMs: 200, maxDelayMs: 10000 },
});Examples
See the examples/ directory:
basic.ts— vectors, namespaces, queries, filters, batch operationsmemory.ts— store/recall memories, sessions, agent statsadvanced.ts— text embedding, full-text, hybrid search, knowledge graph, feedback
Run examples with:
npx tsx examples/basic.tsResources
| | | |---|---| | Documentation | Full API reference and guides | | TypeScript SDK docs | TypeScript-specific reference | | Benchmark | LoCoMo evaluation results | | dakera.ai | Website and early access | | GitHub Org | All public repos | | dakera-deploy | Self-hosting guide |
Other SDKs
| SDK | Package |
|---|---|
| dakera-py | dakera (PyPI) |
| dakera-rs | dakera-client (crates.io) |
| dakera-go | github.com/dakera-ai/dakera-go |
| dakera-cli | CLI tool |
| dakera-mcp | MCP server for Claude/Cursor |
