diff --git a/README.md b/README.md
index 2f78972..f903bbd 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
-
+
---
@@ -23,7 +23,7 @@
| | Dakera | Others |
|---|---|---|
-| **LoCoMo accuracy** | **87.8%** (1,540 Q standard eval) | 60–92% |
+| **LoCoMo accuracy** | **88.2%** (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 |
@@ -149,7 +149,7 @@ const client = new DakeraClient({
// Cloud (early access)
const client = new DakeraClient({
- baseUrl: 'http://localhost:3000',
+ baseUrl: 'http://:3000',
apiKey: 'your-key',
});
diff --git a/package-lock.json b/package-lock.json
index b4647eb..6cd3b30 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1837,9 +1837,9 @@
}
},
"node_modules/brace-expansion": {
- "version": "5.0.5",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
- "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
+ "version": "5.0.6",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
+ "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
"dev": true,
"license": "MIT",
"dependencies": {
diff --git a/package.json b/package.json
index 97c3424..1a2cde5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@dakera-ai/dakera",
- "version": "0.11.56",
+ "version": "0.11.57",
"description": "TypeScript/JavaScript SDK for Dakera AI memory platform",
"main": "dist/index.js",
"module": "dist/index.mjs",
diff --git a/src/client.test.ts b/src/client.test.ts
index 28cfeb6..3b3e6bf 100644
--- a/src/client.test.ts
+++ b/src/client.test.ts
@@ -576,6 +576,44 @@ describe('DakeraClient', () => {
});
});
+ // ---------------------------------------------------------------------------
+ // DAK-5508: Batch Store Memory
+ // ---------------------------------------------------------------------------
+
+ describe('storeMemoriesBatch', () => {
+ it('POSTs to /v1/memories/store/batch and returns BatchStoreMemoryResponse', async () => {
+ mockFetch.mockResolvedValueOnce({
+ ok: true,
+ status: 200,
+ headers: new Headers({ 'content-type': 'application/json' }),
+ json: async () => ({
+ stored: [
+ { id: 'mem-1', content: 'Dark mode', agent_id: 'agent-1', tags: [], importance: 0.8, created_at: 1700000000 },
+ { id: 'mem-2', content: 'Berlin user', agent_id: 'agent-1', tags: [], importance: 0.7, created_at: 1700000001 },
+ ],
+ stored_count: 2,
+ total_embedding_time_ms: 42,
+ }),
+ });
+
+ const resp = await client.storeMemoriesBatch({
+ agent_id: 'agent-1',
+ memories: [
+ { content: 'Dark mode', importance: 0.8 },
+ { content: 'Berlin user', importance: 0.7 },
+ ],
+ });
+
+ expect(resp.stored_count).toBe(2);
+ expect(resp.stored).toHaveLength(2);
+ expect(resp.stored[0].id).toBe('mem-1');
+ expect(resp.total_embedding_time_ms).toBe(42);
+ const [url, init] = mockFetch.mock.calls[0];
+ expect(url).toContain('/v1/memories/store/batch');
+ expect(init?.method).toBe('POST');
+ });
+ });
+
// ---------------------------------------------------------------------------
// OPS-1: Rate-Limit Headers (v0.7.0)
// ---------------------------------------------------------------------------
diff --git a/src/client.ts b/src/client.ts
index a5b834b..3aa3499 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -120,6 +120,8 @@ import type {
BatchRecallResponse,
BatchForgetRequest,
BatchForgetResponse,
+ BatchStoreMemoryRequest,
+ BatchStoreMemoryResponse,
RateLimitHeaders,
AutoPilotStatusResponse,
AutoPilotConfigRequest,
@@ -1537,6 +1539,29 @@ export class DakeraClient {
return this.request('DELETE', '/v1/memories/forget/batch', request);
}
+ /**
+ * Store multiple memories in a single request (DAK-5508).
+ *
+ * Uses `POST /v1/memories/store/batch`. The server embeds all contents in a
+ * single ONNX inference pass, yielding ≥100× throughput vs. N sequential
+ * single-store calls. Accepts up to 1 000 memories per call.
+ *
+ * @example
+ * ```ts
+ * const resp = await client.storeMemoriesBatch({
+ * agent_id: 'agent-1',
+ * memories: [
+ * { content: 'The user prefers dark mode', importance: 0.8 },
+ * { content: 'The user is based in Berlin', importance: 0.7 },
+ * ],
+ * });
+ * console.log(`Stored ${resp.stored_count} memories`);
+ * ```
+ */
+ async storeMemoriesBatch(request: BatchStoreMemoryRequest): Promise {
+ return this.request('POST', '/v1/memories/store/batch', request);
+ }
+
/** Search memories for an agent */
async searchMemories(agentId: string, query: string, options?: { top_k?: number; memory_type?: string; min_importance?: number; routing?: import('./types').RoutingMode; rerank?: boolean }): Promise {
const body: Record = { query };
diff --git a/src/index.ts b/src/index.ts
index 9908c89..ababaca 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -93,6 +93,10 @@ export type {
BatchRecallResponse,
BatchForgetRequest,
BatchForgetResponse,
+ BatchStoreMemoryItem,
+ BatchStoreMemoryRequest,
+ BatchStoreMemoryResponse,
+ BatchStoredMemory,
// Rate-limit headers (OPS-1)
RateLimitHeaders,
// Session types
diff --git a/src/types.ts b/src/types.ts
index 2a9f0bb..8d7816e 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -1654,6 +1654,70 @@ export interface BatchForgetResponse {
deleted_count: number;
}
+// ============================================================================
+// Batch Store Memory Types (DAK-5508)
+// ============================================================================
+
+/**
+ * A single memory entry within a {@link BatchStoreMemoryRequest}.
+ *
+ * Mirrors `StoreMemoryRequest` but omits `agent_id` — supplied at batch level.
+ */
+export interface BatchStoreMemoryItem {
+ /** Memory content text (required, max 100 000 chars). */
+ content: string;
+ /** One of `"episodic"`, `"semantic"`, `"procedural"`, or `"working"`. */
+ memory_type?: MemoryType;
+ /** Importance score 0.0–1.0 (default: 0.5). */
+ importance?: number;
+ /** Optional tags to associate with the memory. */
+ tags?: string[];
+ /** Optional session ID to associate with. */
+ session_id?: string;
+ /** Arbitrary metadata dictionary. */
+ metadata?: Record;
+ /** Optional TTL in seconds. */
+ ttl_seconds?: number;
+ /** Optional explicit expiry as a Unix timestamp (seconds). */
+ expires_at?: number;
+ /** Optional custom ID. Auto-generated if not provided. */
+ id?: string;
+}
+
+/**
+ * Request body for `POST /v1/memories/store/batch` (DAK-5508).
+ *
+ * Accepts up to 1 000 memories per call. The server embeds all contents in a
+ * single ONNX inference pass, yielding ≥100× throughput vs. N sequential
+ * single-store calls.
+ */
+export interface BatchStoreMemoryRequest {
+ /** Agent namespace to store the memories in. */
+ agent_id: string;
+ /** Memories to store (1–1000 items). */
+ memories: BatchStoreMemoryItem[];
+}
+
+/** A single stored memory returned in a {@link BatchStoreMemoryResponse}. */
+export interface BatchStoredMemory {
+ id: string;
+ content: string;
+ agent_id: string;
+ tags: string[];
+ importance: number;
+ created_at: number;
+}
+
+/** Response from `POST /v1/memories/store/batch`. */
+export interface BatchStoreMemoryResponse {
+ /** Stored memories in the same order as the request items. */
+ stored: BatchStoredMemory[];
+ /** Number of memories successfully stored. */
+ stored_count: number;
+ /** Time spent on ONNX embedding for the entire batch (milliseconds). */
+ total_embedding_time_ms: number;
+}
+
// ============================================================================
// Memory Knowledge Graph Types (CE-5 / SDK-9)
// ============================================================================