Skip to content

Dakera-AI/dakera-js

Dakera AI

dakera-js

TypeScript/JavaScript SDK for Dakera AI — the memory engine for AI agents

CI npm Downloads License: MIT Docs LoCoMo 87.8%


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 3300:3300 \
  -e DAKERA_ROOT_API_KEY=dk-mykey \
  ghcr.io/dakera-ai/dakera:latest

curl http://localhost:3300/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 -d

Full deployment guide (Docker Compose, Kubernetes, Helm): dakera-deploy


Install

npm install @dakera-ai/dakera

Works 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:3300',
  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 TypesVectorId, AgentId, MemoryId, SessionId for 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:3300',
  apiKey: 'your-key',
});

// Cloud (early access)
const client = new DakeraClient({
  baseUrl: 'https://api.dakera.ai',
  apiKey: 'your-key',
});

// With custom retry config
const client = new DakeraClient({
  baseUrl: 'http://localhost:3300',
  apiKey: 'your-key',
  retryBackoff: { maxRetries: 5, baseDelayMs: 200, maxDelayMs: 10000 },
});

Examples

See the examples/ directory:

  • basic.ts — vectors, namespaces, queries, filters, batch operations
  • memory.ts — store/recall memories, sessions, agent stats
  • advanced.ts — text embedding, full-text, hybrid search, knowledge graph, feedback

Run examples with:

npx tsx examples/basic.ts

Resources

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

dakera.ai · Docs · Benchmark · Request Early Access

Built with Rust. Single binary. Zero external dependencies.

About

TypeScript/JavaScript SDK for Dakera AI agent memory — self-hosted, vectors, hybrid search, knowledge graphs, sessions.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors