@dakera-ai/dakera 0.9.13 → 0.9.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,15 @@
1
- # Dakera TypeScript SDK
1
+ # dakera-js
2
2
 
3
- [![CI](https://github.com/dakera-ai/dakera-js/actions/workflows/ci.yml/badge.svg)](https://github.com/dakera-ai/dakera-js/actions/workflows/ci.yml)
4
- [![npm](https://img.shields.io/npm/v/dakera)](https://www.npmjs.com/package/dakera)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue)](https://www.typescriptlang.org/)
3
+ TypeScript SDK for Dakera AI — store, recall, and search agent memories against a Dakera instance.
7
4
 
8
- Official TypeScript/JavaScript SDK for [Dakera](https://dakera.ai) — the AI agent memory platform. Persistent, session-aware, cross-agent memory for your AI agents.
5
+ Part of [Dakera AI](https://dakera.ai) — the memory engine for AI agents.
9
6
 
10
- ## Installation
7
+ ---
8
+
9
+ ## Install
11
10
 
12
11
  ```bash
13
12
  npm install dakera
14
- # or
15
- yarn add dakera
16
- # or
17
- pnpm add dakera
18
13
  ```
19
14
 
20
15
  ## Quick Start
@@ -22,316 +17,60 @@ pnpm add dakera
22
17
  ```typescript
23
18
  import { DakeraClient } from 'dakera';
24
19
 
25
- // Connect to Dakera
26
- const client = new DakeraClient('http://localhost:3000');
27
-
28
- // Upsert vectors
29
- await client.upsert('my-namespace', [
30
- { id: 'vec1', values: [0.1, 0.2, 0.3], metadata: { label: 'a' } },
31
- { id: 'vec2', values: [0.4, 0.5, 0.6], metadata: { label: 'b' } },
32
- ]);
33
-
34
- // Query similar vectors
35
- const results = await client.query('my-namespace', [0.1, 0.2, 0.3], {
36
- topK: 10,
37
- });
38
-
39
- for (const result of results.results) {
40
- console.log(`${result.id}: ${result.score}`);
41
- }
42
- ```
43
-
44
- ## Features
45
-
46
- - **Full TypeScript Support**: Complete type definitions for all operations
47
- - **Branded ID Types**: `VectorId`, `AgentId`, `MemoryId`, `SessionId` prevent cross-assignment bugs
48
- - **Vector Operations**: Upsert, query, delete, fetch vectors
49
- - **Full-Text Search**: Index documents and perform BM25 search
50
- - **Hybrid Search**: Combine vector and text search with configurable weights
51
- - **Namespace Management**: Create, list, delete namespaces
52
- - **Agent Memory**: Store, recall, and manage memories for AI agents
53
- - **Metadata Filtering**: Filter queries by metadata fields
54
- - **Automatic Retries**: Built-in retry logic with exponential backoff
55
- - **Error Handling**: Typed exceptions for different error scenarios
56
-
57
- ## Usage Examples
58
-
59
- ### Vector Operations
60
-
61
- ```typescript
62
- import { DakeraClient } from 'dakera';
63
-
64
20
  const client = new DakeraClient({
65
- baseUrl: 'http://localhost:3000',
66
- apiKey: 'your-api-key', // optional
67
- timeout: 30000,
21
+ baseUrl: 'http://localhost:3300',
22
+ apiKey: 'your-key',
68
23
  });
69
24
 
70
- // Upsert vectors
71
- await client.upsert('my-namespace', [
72
- { id: 'vec1', values: [0.1, 0.2, 0.3], metadata: { category: 'A' } },
73
- { id: 'vec2', values: [0.4, 0.5, 0.6], metadata: { category: 'B' } },
74
- ]);
75
-
76
- // Query with metadata filter
77
- const results = await client.query('my-namespace', [0.1, 0.2, 0.3], {
78
- topK: 5,
79
- filter: { category: { $eq: 'A' } },
80
- includeMetadata: true,
81
- });
82
-
83
- // Batch query
84
- const batchResults = await client.batchQuery('my-namespace', [
85
- { vector: [0.1, 0.2, 0.3], topK: 5 },
86
- { vector: [0.4, 0.5, 0.6], topK: 3 },
87
- ]);
88
-
89
- // Fetch vectors by ID
90
- const vectors = await client.fetch('my-namespace', ['vec1', 'vec2']);
91
-
92
- // Delete vectors
93
- await client.delete('my-namespace', { ids: ['vec1', 'vec2'] });
94
- await client.delete('my-namespace', { filter: { category: { $eq: 'obsolete' } } });
95
- ```
96
-
97
- ### Full-Text Search
98
-
99
- ```typescript
100
- // Index documents
101
- await client.indexDocuments('my-namespace', [
102
- { id: 'doc1', content: 'Machine learning is transforming industries' },
103
- { id: 'doc2', content: 'Vector databases enable semantic search' },
104
- ]);
105
-
106
- // Search
107
- const results = await client.fulltextSearch('my-namespace', 'machine learning', {
108
- topK: 10,
25
+ // Store a vector
26
+ await client.vectors.upsert({
27
+ id: 'vec-001',
28
+ values: [0.1, 0.2, 0.3],
29
+ metadata: { text: 'agent completed task', agentId: 'my-agent' },
109
30
  });
110
31
 
111
- for (const result of results) {
112
- console.log(`${result.id}: ${result.score}`);
113
- }
114
- ```
115
-
116
- ### Hybrid Search
32
+ // Full-text search
33
+ const results = await client.fulltext.search({ query: 'completed task', topK: 5 });
34
+ results.forEach(r => console.log(r.id, r.score));
117
35
 
118
- ```typescript
119
- // Combine vector and text search
120
- const results = await client.hybridSearch(
121
- 'my-namespace',
122
- [0.1, 0.2, 0.3], // Query vector
123
- 'machine learning', // Text query
124
- {
125
- topK: 10,
126
- alpha: 0.7, // 0 = pure vector, 1 = pure text
127
- }
128
- );
129
-
130
- for (const result of results) {
131
- console.log(`${result.id}: score=${result.score}, vector=${result.vectorScore}, text=${result.textScore}`);
132
- }
133
- ```
134
-
135
- ### Namespace Management
136
-
137
- ```typescript
138
- // Create namespace
139
- await client.createNamespace('embeddings', {
140
- dimensions: 384,
141
- indexType: 'hnsw',
36
+ // Store an agent memory
37
+ await client.memories.store({
38
+ agentId: 'my-agent',
39
+ content: 'User prefers concise responses',
40
+ importance: 0.8,
41
+ tags: ['preference', 'ux'],
142
42
  });
143
-
144
- // List namespaces
145
- const namespaces = await client.listNamespaces();
146
- for (const ns of namespaces) {
147
- console.log(`${ns.name}: ${ns.vectorCount} vectors`);
148
- }
149
-
150
- // Get namespace info
151
- const info = await client.getNamespace('embeddings');
152
- console.log(`Dimensions: ${info.dimensions}, Index: ${info.indexType}`);
153
-
154
- // Delete namespace
155
- await client.deleteNamespace('old-namespace');
156
43
  ```
157
44
 
158
- ### Metadata Filtering
159
-
160
- Dakera supports rich metadata filtering:
45
+ ## Connect to Dakera
161
46
 
162
47
  ```typescript
163
- // Equality
164
- const filter1 = { status: { $eq: 'active' } };
165
-
166
- // Comparison
167
- const filter2 = { price: { $gt: 100, $lt: 500 } };
168
-
169
- // In list
170
- const filter3 = { category: { $in: ['electronics', 'books'] } };
171
-
172
- // Logical operators
173
- const filter4 = {
174
- $and: [
175
- { status: { $eq: 'active' } },
176
- { price: { $lt: 1000 } },
177
- ],
178
- };
179
-
180
- const results = await client.query('products', queryVector, {
181
- filter: filter4,
182
- topK: 20,
183
- });
184
- ```
185
-
186
- ### Error Handling
187
-
188
- ```typescript
189
- import {
190
- DakeraClient,
191
- NotFoundError,
192
- ValidationError,
193
- RateLimitError,
194
- ServerError,
195
- } from 'dakera';
196
-
197
- const client = new DakeraClient('http://localhost:3000');
198
-
199
- try {
200
- const results = await client.query('nonexistent', [0.1, 0.2]);
201
- } catch (error) {
202
- if (error instanceof NotFoundError) {
203
- console.log(`Namespace not found: ${error.message}`);
204
- } else if (error instanceof ValidationError) {
205
- console.log(`Invalid request: ${error.message}`);
206
- } else if (error instanceof RateLimitError) {
207
- console.log(`Rate limited, retry after ${error.retryAfter} seconds`);
208
- } else if (error instanceof ServerError) {
209
- console.log(`Server error: ${error.message}`);
210
- }
211
- }
212
- ```
213
-
214
- ## Configuration
215
-
216
- | Option | Type | Default | Description |
217
- |--------|------|---------|-------------|
218
- | `baseUrl` | string | required | Dakera server URL |
219
- | `apiKey` | string | undefined | API key for authentication |
220
- | `timeout` | number | 30000 | Request timeout in milliseconds |
221
- | `maxRetries` | number | 3 | Max retries for failed requests |
222
- | `headers` | object | undefined | Additional HTTP headers |
223
-
224
- ## API Reference
225
-
226
- ### DakeraClient
227
-
228
- #### Vector Operations
229
- - `upsert(namespace, vectors)` - Insert or update vectors
230
- - `query(namespace, vector, options?)` - Query similar vectors
231
- - `delete(namespace, options)` - Delete vectors
232
- - `fetch(namespace, ids, options?)` - Fetch vectors by ID
233
- - `batchQuery(namespace, queries)` - Execute multiple queries
234
-
235
- #### Full-Text Operations
236
- - `indexDocuments(namespace, documents)` - Index documents
237
- - `fulltextSearch(namespace, query, options?)` - Text search
238
- - `hybridSearch(namespace, vector, query, options?)` - Hybrid search
239
-
240
- #### Namespace Operations
241
- - `listNamespaces()` - List all namespaces
242
- - `getNamespace(namespace)` - Get namespace info
243
- - `createNamespace(namespace, options?)` - Create namespace
244
- - `deleteNamespace(namespace)` - Delete namespace
245
-
246
- #### Admin Operations
247
- - `health()` - Check server health
248
- - `getIndexStats(namespace)` - Get index statistics
249
- - `compact(namespace)` - Trigger compaction
250
- - `flush(namespace)` - Flush pending writes
251
-
252
- ## TypeScript Types
253
-
254
- All types are exported for use in your application:
255
-
256
- ```typescript
257
- import type {
258
- Vector,
259
- VectorInput,
260
- QueryResult,
261
- SearchResult,
262
- NamespaceInfo,
263
- IndexStats,
264
- Document,
265
- FilterExpression,
266
- QueryOptions,
267
- ClientOptions,
268
- } from 'dakera';
269
- ```
270
-
271
- ### Branded ID Types
272
-
273
- v0.3.0 introduced branded string types to prevent accidental cross-assignment of IDs at compile time:
274
-
275
- ```typescript
276
- import {
277
- vectorId, agentId, memoryId, sessionId,
278
- type VectorId, type AgentId, type MemoryId, type SessionId,
279
- } from 'dakera';
280
-
281
- // Factory helpers narrow plain strings to branded types
282
- const vid: VectorId = vectorId('vec-001');
283
- const aid: AgentId = agentId('my-agent');
48
+ import { DakeraClient } from 'dakera';
284
49
 
285
- // TypeScript catches cross-assignment mistakes:
286
- // const bad: VectorId = agentId('x'); // TS error
50
+ // Self-hosted
51
+ const client = new DakeraClient({ baseUrl: 'http://your-server:3300', apiKey: 'your-key' });
287
52
 
288
- // All SDK methods accept both branded and plain strings for convenience
289
- await client.upsert('my-namespace', [
290
- { id: vid, values: [0.1, 0.2, 0.3] },
291
- ]);
53
+ // Cloud (early access)
54
+ const client = new DakeraClient({ baseUrl: 'https://api.dakera.ai', apiKey: 'your-key' });
292
55
  ```
293
56
 
294
- ## Browser Support
295
-
296
- This SDK uses the Fetch API and works in:
297
- - Node.js 18+
298
- - Modern browsers (Chrome, Firefox, Safari, Edge)
299
- - Deno
300
- - Bun
301
-
302
- ## Development
303
-
304
- ```bash
305
- # Install dependencies
306
- npm install
57
+ ## Documentation
307
58
 
308
- # Build
309
- npm run build
310
-
311
- # Run tests
312
- npm test
313
-
314
- # Type check
315
- npm run typecheck
316
-
317
- # Lint
318
- npm run lint
319
- ```
59
+ [Full docs](https://dakera.ai/docs)
60
+ [API reference](https://dakera.ai/docs/api)
61
+ → [TypeScript SDK reference](https://dakera.ai/docs/sdk/typescript)
320
62
 
321
- ## Related Repositories
63
+ ## Related
322
64
 
323
- | Repository | Description |
324
- |------------|-------------|
325
- | [dakera](https://github.com/dakera-ai/dakera) | Core AI agent memory engine (Rust) |
65
+ | Repo | What it is |
66
+ |---|---|
326
67
  | [dakera-py](https://github.com/dakera-ai/dakera-py) | Python SDK |
327
68
  | [dakera-go](https://github.com/dakera-ai/dakera-go) | Go SDK |
328
- | [dakera-rs](https://github.com/dakera-ai/dakera-rs) | Rust SDK |
329
- | [dakera-cli](https://github.com/dakera-ai/dakera-cli) | Command-line interface |
330
- | [dakera-mcp](https://github.com/dakera-ai/dakera-mcp) | MCP Server for AI agent memory |
331
- | [dakera-dashboard](https://github.com/dakera-ai/dakera-dashboard) | Admin dashboard (Leptos/WASM) |
332
- | [dakera-docs](https://github.com/dakera-ai/dakera-docs) | Documentation |
333
- | [dakera-deploy](https://github.com/dakera-ai/dakera-deploy) | Deployment configs and Docker Compose |
69
+ | [dakera-rs](https://github.com/dakera-ai/dakera-rs) | Rust client |
70
+ | [dakera-cli](https://github.com/dakera-ai/dakera-cli) | CLI |
71
+ | [dakera-mcp](https://github.com/dakera-ai/dakera-mcp) | MCP server · 83 tools |
72
+ | [dakera-deploy](https://github.com/dakera-ai/dakera-deploy) | Self-host Dakera |
334
73
 
335
- ## License
74
+ ---
336
75
 
337
- MIT License - see [LICENSE](LICENSE) for details.
76
+ *Part of the Dakera AI open core. The engine is proprietary. The tools are yours.*
package/dist/index.d.mts CHANGED
@@ -617,6 +617,30 @@ interface AgentStats {
617
617
  /** Newest memory timestamp */
618
618
  newest_memory_at?: string;
619
619
  }
620
+ /** Options for `getWakeUpContext` (DAK-1690) */
621
+ interface WakeUpOptions {
622
+ /** Maximum number of memories to return (default 20, max 100) */
623
+ top_n?: number;
624
+ /** Only return memories with importance ≥ this value (default 0.0) */
625
+ min_importance?: number;
626
+ }
627
+ /**
628
+ * Response from `GET /v1/agents/{agent_id}/wake-up` (DAK-1690).
629
+ *
630
+ * Returns top-N memories ranked by `importance × exp(-ln2 × age / 14d)` for
631
+ * fast agent start-up context loading. No embedding inference — served from
632
+ * the metadata index for sub-millisecond latency.
633
+ *
634
+ * Requires Read scope on the agent namespace.
635
+ */
636
+ interface WakeUpResponse {
637
+ /** The agent whose memories are returned */
638
+ agent_id: AgentId;
639
+ /** Top-N memories ranked by recency-weighted importance */
640
+ memories: Memory[];
641
+ /** Total memories available before top_n cap was applied */
642
+ total_available: number;
643
+ }
620
644
  /** Request to build a knowledge graph */
621
645
  interface KnowledgeGraphRequest {
622
646
  agent_id: AgentId;
@@ -2480,6 +2504,19 @@ declare class DakeraClient {
2480
2504
  active_only?: boolean;
2481
2505
  limit?: number;
2482
2506
  }): Promise<Session[]>;
2507
+ /**
2508
+ * Return top-N wake-up context memories for an agent (DAK-1690).
2509
+ *
2510
+ * Calls `GET /v1/agents/{agentId}/wake-up`. Returns memories ranked by
2511
+ * `importance × exp(-ln2 × age / 14d)` — no embedding inference, served
2512
+ * from the metadata index for sub-millisecond latency.
2513
+ *
2514
+ * Requires Read scope on the agent namespace.
2515
+ *
2516
+ * @param agentId - Agent identifier.
2517
+ * @param options - Optional `top_n` (default 20, max 100) and `min_importance` (default 0.0).
2518
+ */
2519
+ getWakeUpContext(agentId: string, options?: WakeUpOptions): Promise<WakeUpResponse>;
2483
2520
  /** Build a knowledge graph from a seed memory */
2484
2521
  knowledgeGraph(request: KnowledgeGraphRequest): Promise<KnowledgeGraphResponse>;
2485
2522
  /** Build a full knowledge graph for an agent */
@@ -2993,4 +3030,4 @@ declare class TimeoutError extends DakeraError {
2993
3030
  constructor(message: string);
2994
3031
  }
2995
3032
 
2996
- export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, type AuditEvent, type AuditExportResponse, type AuditListResponse, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationConfig, type ConsolidationLogEntry, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DecayStrategyName, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractEntitiesRequest, type ExtractEntitiesResponse, type ExtractedEntity, type ExtractionProviderInfo, type ExtractionResult, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KgExportResponse, type KgPathResponse, type KgQueryResponse, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type KpiSnapshot, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryExportResponse, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportResponse, type MemoryImportancePatchRequest, type MemoryPolicy, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OdeEntity, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecallResponse, type RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionEndResponse, type SessionId, type SessionStartResponse, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
3033
+ export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, type AuditEvent, type AuditExportResponse, type AuditListResponse, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationConfig, type ConsolidationLogEntry, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DecayStrategyName, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractEntitiesRequest, type ExtractEntitiesResponse, type ExtractedEntity, type ExtractionProviderInfo, type ExtractionResult, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KgExportResponse, type KgPathResponse, type KgQueryResponse, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type KpiSnapshot, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryExportResponse, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportResponse, type MemoryImportancePatchRequest, type MemoryPolicy, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OdeEntity, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecallResponse, type RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionEndResponse, type SessionId, type SessionStartResponse, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WakeUpOptions, type WakeUpResponse, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
package/dist/index.d.ts CHANGED
@@ -617,6 +617,30 @@ interface AgentStats {
617
617
  /** Newest memory timestamp */
618
618
  newest_memory_at?: string;
619
619
  }
620
+ /** Options for `getWakeUpContext` (DAK-1690) */
621
+ interface WakeUpOptions {
622
+ /** Maximum number of memories to return (default 20, max 100) */
623
+ top_n?: number;
624
+ /** Only return memories with importance ≥ this value (default 0.0) */
625
+ min_importance?: number;
626
+ }
627
+ /**
628
+ * Response from `GET /v1/agents/{agent_id}/wake-up` (DAK-1690).
629
+ *
630
+ * Returns top-N memories ranked by `importance × exp(-ln2 × age / 14d)` for
631
+ * fast agent start-up context loading. No embedding inference — served from
632
+ * the metadata index for sub-millisecond latency.
633
+ *
634
+ * Requires Read scope on the agent namespace.
635
+ */
636
+ interface WakeUpResponse {
637
+ /** The agent whose memories are returned */
638
+ agent_id: AgentId;
639
+ /** Top-N memories ranked by recency-weighted importance */
640
+ memories: Memory[];
641
+ /** Total memories available before top_n cap was applied */
642
+ total_available: number;
643
+ }
620
644
  /** Request to build a knowledge graph */
621
645
  interface KnowledgeGraphRequest {
622
646
  agent_id: AgentId;
@@ -2480,6 +2504,19 @@ declare class DakeraClient {
2480
2504
  active_only?: boolean;
2481
2505
  limit?: number;
2482
2506
  }): Promise<Session[]>;
2507
+ /**
2508
+ * Return top-N wake-up context memories for an agent (DAK-1690).
2509
+ *
2510
+ * Calls `GET /v1/agents/{agentId}/wake-up`. Returns memories ranked by
2511
+ * `importance × exp(-ln2 × age / 14d)` — no embedding inference, served
2512
+ * from the metadata index for sub-millisecond latency.
2513
+ *
2514
+ * Requires Read scope on the agent namespace.
2515
+ *
2516
+ * @param agentId - Agent identifier.
2517
+ * @param options - Optional `top_n` (default 20, max 100) and `min_importance` (default 0.0).
2518
+ */
2519
+ getWakeUpContext(agentId: string, options?: WakeUpOptions): Promise<WakeUpResponse>;
2483
2520
  /** Build a knowledge graph from a seed memory */
2484
2521
  knowledgeGraph(request: KnowledgeGraphRequest): Promise<KnowledgeGraphResponse>;
2485
2522
  /** Build a full knowledge graph for an agent */
@@ -2993,4 +3030,4 @@ declare class TimeoutError extends DakeraError {
2993
3030
  constructor(message: string);
2994
3031
  }
2995
3032
 
2996
- export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, type AuditEvent, type AuditExportResponse, type AuditListResponse, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationConfig, type ConsolidationLogEntry, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DecayStrategyName, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractEntitiesRequest, type ExtractEntitiesResponse, type ExtractedEntity, type ExtractionProviderInfo, type ExtractionResult, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KgExportResponse, type KgPathResponse, type KgQueryResponse, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type KpiSnapshot, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryExportResponse, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportResponse, type MemoryImportancePatchRequest, type MemoryPolicy, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OdeEntity, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecallResponse, type RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionEndResponse, type SessionId, type SessionStartResponse, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
3033
+ export { type AccessPatternHint, type AgentFeedbackSummary, type AgentId, type AgentNetworkEdge, type AgentNetworkInfo, type AgentNetworkNode, type AgentNetworkStats, type AgentStats, type AgentSummary, type AggregationGroup, type AggregationRequest, type AggregationResponse, type AnalyticsOptions, type AnalyticsOverview, type ApiKey, type AuditEvent, type AuditExportResponse, type AuditListResponse, AuthenticationError, AuthorizationError, type AutoPilotConfig, type AutoPilotConfigRequest, type AutoPilotConfigResponse, type AutoPilotConsolidationResult, type AutoPilotDedupResult, type AutoPilotStatusResponse, type AutoPilotTriggerAction, type AutoPilotTriggerResponse, type BackupInfo, type BatchForgetRequest, type BatchForgetResponse, type BatchMemoryFilter, type BatchQuerySpec, type BatchRecallRequest, type BatchRecallResponse, type BatchTextQueryOptions, type BatchTextQueryResponse, type Branded, type CacheStats, type ClientOptions, type ClusterNode, type ClusterStatus, type ColumnUpsertRequest, type ConfigureNamespaceRequest, type ConfigureNamespaceResponse, ConnectionError, type ConsolidateRequest, type ConsolidateResponse, type ConsolidationConfig, type ConsolidationLogEntry, type ConsolidationResultSnapshot, type CreateKeyRequest, type CreateNamespaceKeyResponse, type CrossAgentNetworkRequest, type CrossAgentNetworkResponse, DakeraClient, DakeraError, type DakeraEvent, type DecayConfigResponse, type DecayConfigUpdateRequest, type DecayConfigUpdateResponse, type DecayStatsResponse, type DecayStrategyName, type DedupResultSnapshot, type DeduplicateRequest, type DeduplicateResponse, type DeleteOptions, type DeleteResponse, type DistanceMetric, type Document, type DocumentInput, type EdgeType, type EmbeddingModel, type EntityExtractionResponse, ErrorCode, type ExportRequest, type ExportResponse, type ExportedVector, type ExtractEntitiesRequest, type ExtractEntitiesResponse, type ExtractedEntity, type ExtractionProviderInfo, type ExtractionResult, type FeedbackHealthResponse, type FeedbackHistoryEntry, type FeedbackHistoryResponse, type FeedbackResponse, type FeedbackSignal, type FilterExpression, type FilterOperators, type FullKnowledgeGraphRequest, type FullTextSearchResult, type GraphEdge, type GraphExport, type GraphLinkResponse, type GraphNode, type GraphPath, type HealthResponse, type HybridSearchResult, type IndexStats, type JobProgressEvent, type KeyUsage, type KgExportResponse, type KgPathResponse, type KgQueryResponse, type KnowledgeEdge, type KnowledgeGraphRequest, type KnowledgeGraphResponse, type KnowledgeNode, type KpiSnapshot, type LastDecayCycleStats, type LatencyAnalytics, type ListNamespaceKeysResponse, type ListSessionsOptions, type Memory, type MemoryEntitiesResponse, type MemoryEvent, type MemoryExportResponse, type MemoryFeedbackBodyRequest, type MemoryFeedbackRequest, type MemoryFeedbackResponse, type MemoryGraph, type MemoryGraphOptions, type MemoryId, type MemoryImportResponse, type MemoryImportancePatchRequest, type MemoryPolicy, type MemoryType, type MultiVectorSearchRequest, type MultiVectorSearchResponse, type MultiVectorSearchResult, type NamespaceCreatedEvent, type NamespaceDeletedEvent, type NamespaceInfo, type NamespaceKeyInfo, type NamespaceKeyUsageResponse, type NamespaceNerConfig, NotFoundError, type OdeEntity, type OpStatus, type OperationProgressEvent, type OpsStats, type QueryExplainRequest, type QueryExplainResponse, type QueryOptions, type QueryResult, RateLimitError, type RateLimitHeaders, type ReadConsistency, type RecallRequest, type RecallResponse, type RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionEndResponse, type SessionId, type SessionStartResponse, type SlowQuery, type StalenessConfig, type StartSessionRequest, type StorageAnalytics, type StoreMemoryRequest, type StoreMemoryResponse, type StreamLaggedEvent, type SummarizeRequest, type SummarizeResponse, type TextDocument, type TextQueryOptions, type TextQueryResponse, type TextSearchResult, type TextUpsertOptions, type TextUpsertResponse, type ThroughputAnalytics, TimeoutError, type TtlConfig, type UnifiedQueryRequest, type UnifiedQueryResponse, type UnifiedSearchResult, type UpdateImportanceRequest, type UpdateMemoryRequest, type UpsertOptions, type UpsertResponse, ValidationError, type Vector, type VectorId, type VectorInput, type VectorMutationOp, type VectorsMutatedEvent, type WakeUpOptions, type WakeUpResponse, type WarmCacheRequest, type WarmCacheResponse, type WarmingPriority, type WarmingTargetTier, agentId, memoryId, sessionId, vectorId };
package/dist/index.js CHANGED
@@ -1381,6 +1381,25 @@ var DakeraClient = class {
1381
1381
  const qs = params.toString();
1382
1382
  return this.request("GET", `/v1/agents/${agentId2}/sessions${qs ? `?${qs}` : ""}`);
1383
1383
  }
1384
+ /**
1385
+ * Return top-N wake-up context memories for an agent (DAK-1690).
1386
+ *
1387
+ * Calls `GET /v1/agents/{agentId}/wake-up`. Returns memories ranked by
1388
+ * `importance × exp(-ln2 × age / 14d)` — no embedding inference, served
1389
+ * from the metadata index for sub-millisecond latency.
1390
+ *
1391
+ * Requires Read scope on the agent namespace.
1392
+ *
1393
+ * @param agentId - Agent identifier.
1394
+ * @param options - Optional `top_n` (default 20, max 100) and `min_importance` (default 0.0).
1395
+ */
1396
+ async getWakeUpContext(agentId2, options) {
1397
+ const params = new URLSearchParams();
1398
+ if (options?.top_n !== void 0) params.set("top_n", String(options.top_n));
1399
+ if (options?.min_importance !== void 0) params.set("min_importance", String(options.min_importance));
1400
+ const qs = params.toString();
1401
+ return this.request("GET", `/v1/agents/${agentId2}/wake-up${qs ? `?${qs}` : ""}`);
1402
+ }
1384
1403
  // ===========================================================================
1385
1404
  // Knowledge Graph Operations
1386
1405
  // ===========================================================================
package/dist/index.mjs CHANGED
@@ -1341,6 +1341,25 @@ var DakeraClient = class {
1341
1341
  const qs = params.toString();
1342
1342
  return this.request("GET", `/v1/agents/${agentId2}/sessions${qs ? `?${qs}` : ""}`);
1343
1343
  }
1344
+ /**
1345
+ * Return top-N wake-up context memories for an agent (DAK-1690).
1346
+ *
1347
+ * Calls `GET /v1/agents/{agentId}/wake-up`. Returns memories ranked by
1348
+ * `importance × exp(-ln2 × age / 14d)` — no embedding inference, served
1349
+ * from the metadata index for sub-millisecond latency.
1350
+ *
1351
+ * Requires Read scope on the agent namespace.
1352
+ *
1353
+ * @param agentId - Agent identifier.
1354
+ * @param options - Optional `top_n` (default 20, max 100) and `min_importance` (default 0.0).
1355
+ */
1356
+ async getWakeUpContext(agentId2, options) {
1357
+ const params = new URLSearchParams();
1358
+ if (options?.top_n !== void 0) params.set("top_n", String(options.top_n));
1359
+ if (options?.min_importance !== void 0) params.set("min_importance", String(options.min_importance));
1360
+ const qs = params.toString();
1361
+ return this.request("GET", `/v1/agents/${agentId2}/wake-up${qs ? `?${qs}` : ""}`);
1362
+ }
1344
1363
  // ===========================================================================
1345
1364
  // Knowledge Graph Operations
1346
1365
  // ===========================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dakera-ai/dakera",
3
- "version": "0.9.13",
3
+ "version": "0.9.15",
4
4
  "description": "TypeScript/JavaScript SDK for Dakera AI memory platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",