Skip to content
Dakera-AIPublic

About

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

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Dakera AI

dakera-js

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

CI npm Downloads License: MIT Docs LoCoMo 88.2% Playground


Why Dakera?

Dakera Others
LoCoMo Recall@20 88.2% (1,536 Q, LLM-judged retrieval recall) not directly comparable
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

→ Try the playground · 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/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:3000', apiKey: 'dk-mykey' });
await client.storeMemory('my-agent', { content: 'User prefers brevity', importance: 0.9 });

Full example — store, recall, upsert, and hybrid search:

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);
}

What's new for Dakera server v0.12.0

This SDK release (0.12.0) targets Dakera server v0.12.0 and is compatible with both v0.11.108 and v0.12.0 servers: every addition is opt-in or additive, requests that do not use them are byte-identical to before, and the v0.12-only routes simply answer 404/501 on an older server. Upgrade guide for operators: docs/v0.12/UPGRADE.md in the server release (the server repository is private; see the public Dakera changelog for release notes).

  • Capabilities — client.capabilities() (GET /v1/capabilities): models (bge-m3, colbert-small), index kinds (ivfpq), search modes (rabitq), record kinds/dtypes, query languages, and the attachment / transcription / vision / scoring sections. Unknown values from a newer server never throw.
  • Health — healthReady() / healthLive() / waitUntilReady(). A starting v0.12 server answers /health/ready with 503 + Retry-After: that means not ready, never healthy.
  • Errors — every v0.12 error is JSON and every 503 carries Retry-After; the retry loop now waits that long. New typed errors: PayloadTooLargeError (413: isQuota for a full namespace, otherwise an oversize request), NotImplementedError (501: isFeatureDisabled, details names the env var), ConflictError (409); err.details, err.resource (404) and err.retryAfterSeconds.
  • Attachments (server DAKERA_ATTACHMENTS=1) — uploadAttachment, listAttachments, downloadAttachment, deleteAttachment, transcribeAttachment (WAV), indexImageAttachment (PNG, needs DAKERA_VISION=1), job polling with waitForAttachmentJob, and attachment_ref on storeMemory.
  • Records (server DAKERA_RECORDS=1) — upsertRecords / getRecord: one primary vector plus named representations (dense, token_multivector, patch_multivector; stored as f32, f16, i8).
  • Per-request lang on storeMemory, storeMemoriesBatch, updateMemory, recall, searchMemories and extractEntities (see capabilities().query_languages).
  • Namespace entity config — replaceNamespaceEntityConfig() is PUT /v1/namespaces/{ns}/config (full replacement; clears entity_types). configureNamespaceNer() stays a merging PATCH.
await client.waitUntilReady();                       // never treats a starting server as healthy
const up = await client.uploadAttachment('uploads', wavBytes, 'audio/wav');
const job = await client.transcribeAttachment('uploads', up.attachment_ref, { agent_id: 'my-agent' });
await client.waitForAttachmentJob(job);              // the transcript is now a memory
await client.recall('my-agent', 'was ist gesagt worden?', { lang: 'de' });

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
  • T-I-F Reliability — TifScore type and evaluateTif() for Truth-Indeterminacy-Falsity scoring of memory reliability
  • Entity Extraction — GLiNER NER for automatic entity detection
  • Attachments & Records — audio transcription, image indexing, multi-representation records (server v0.12)
  • SSE Streaming — async generator event subscriptions, browser-compatible
  • Branded Types — VectorId, 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: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 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, 88.2% LoCoMo. Vectors, hybrid search, knowledge graphs, sessions.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages