@dakera-ai/dakera 0.9.7 → 0.9.9

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/dist/index.d.mts CHANGED
@@ -454,6 +454,13 @@ interface RecalledMemory {
454
454
  /** Creation timestamp */
455
455
  created_at?: string;
456
456
  }
457
+ /** COG-2: Response from the recall endpoint with optional associative memories */
458
+ interface RecallResponse {
459
+ /** Primary recalled memories */
460
+ memories: RecalledMemory[];
461
+ /** COG-2: KG depth-1 associated memories (only present when include_associated was true) */
462
+ associated_memories?: RecalledMemory[];
463
+ }
457
464
  /** Response from storing a memory */
458
465
  interface StoreMemoryResponse {
459
466
  /** Created memory ID */
@@ -480,6 +487,10 @@ interface RecallRequest {
480
487
  memory_type?: string;
481
488
  /** Minimum importance threshold */
482
489
  min_importance?: number;
490
+ /** CE-7: only recall memories created at or after this ISO-8601 timestamp */
491
+ since?: string;
492
+ /** CE-7: only recall memories created at or before this ISO-8601 timestamp */
493
+ until?: string;
483
494
  }
484
495
  /** Request to update importance */
485
496
  interface UpdateImportanceRequest {
@@ -1619,6 +1630,69 @@ interface ExtractEntitiesResponse {
1619
1630
  /** Wall-clock time taken by the ODE sidecar in milliseconds. */
1620
1631
  processing_time_ms: number;
1621
1632
  }
1633
+ /**
1634
+ * Decay strategy name. The COG-1 variants (power_law, logarithmic, flat) are
1635
+ * only valid inside MemoryPolicy per-type fields; the global DecayConfig
1636
+ * endpoint still accepts only "exponential" | "linear" | "step".
1637
+ */
1638
+ type DecayStrategyName = 'exponential' | 'linear' | 'step' | 'power_law' | 'logarithmic' | 'flat';
1639
+ /**
1640
+ * Per-namespace memory lifecycle policy (COG-1).
1641
+ *
1642
+ * Controls type-specific TTLs, decay curves, and spaced repetition behaviour.
1643
+ * All fields are optional and have sensible server-side defaults; only set the
1644
+ * ones you want to override.
1645
+ *
1646
+ * Used by {@link DakeraClient.getMemoryPolicy} and
1647
+ * {@link DakeraClient.setMemoryPolicy}.
1648
+ */
1649
+ interface MemoryPolicy {
1650
+ /** Default TTL for `working` memories in seconds (default: 14 400 = 4 h). */
1651
+ working_ttl_seconds?: number;
1652
+ /** Default TTL for `episodic` memories in seconds (default: 2 592 000 = 30 d). */
1653
+ episodic_ttl_seconds?: number;
1654
+ /** Default TTL for `semantic` memories in seconds (default: 31 536 000 = 365 d). */
1655
+ semantic_ttl_seconds?: number;
1656
+ /** Default TTL for `procedural` memories in seconds (default: 63 072 000 = 730 d). */
1657
+ procedural_ttl_seconds?: number;
1658
+ /** Decay strategy for `working` memories (default: `"exponential"`). */
1659
+ working_decay?: DecayStrategyName;
1660
+ /** Decay strategy for `episodic` memories (default: `"power_law"`). */
1661
+ episodic_decay?: DecayStrategyName;
1662
+ /** Decay strategy for `semantic` memories (default: `"logarithmic"`). */
1663
+ semantic_decay?: DecayStrategyName;
1664
+ /** Decay strategy for `procedural` memories (default: `"flat"` — no decay). */
1665
+ procedural_decay?: DecayStrategyName;
1666
+ /**
1667
+ * Multiplier for the TTL extension on each recall hit.
1668
+ * Extension = `access_count × sr_factor × sr_base_interval_seconds`.
1669
+ * Set to 0 to disable. Default: 1.0.
1670
+ */
1671
+ spaced_repetition_factor?: number;
1672
+ /** Base interval in seconds for spaced repetition (default: 86 400 = 1 d). */
1673
+ spaced_repetition_base_interval_seconds?: number;
1674
+ /**
1675
+ * Enable background DBSCAN deduplication for this namespace.
1676
+ * When `true` the server merges semantically near-duplicate memories every
1677
+ * `consolidation_interval_hours` hours. Default: `false`.
1678
+ */
1679
+ consolidation_enabled?: boolean;
1680
+ /**
1681
+ * DBSCAN epsilon — cosine-similarity threshold to consider two memories
1682
+ * duplicates (default: `0.92`; higher = only merge very close neighbours).
1683
+ */
1684
+ consolidation_threshold?: number;
1685
+ /**
1686
+ * How often (in hours) the background consolidation job runs for this
1687
+ * namespace (default: `24`).
1688
+ */
1689
+ consolidation_interval_hours?: number;
1690
+ /**
1691
+ * **Read-only.** Lifetime count of memories merged by the consolidation
1692
+ * engine. The server manages this field; any value you send is ignored.
1693
+ */
1694
+ consolidated_count?: number;
1695
+ }
1622
1696
 
1623
1697
  /**
1624
1698
  * Dakera Client
@@ -2137,12 +2211,31 @@ declare class DakeraClient {
2137
2211
  batchQueryText(namespace: string, queries: string[], options?: BatchTextQueryOptions): Promise<BatchTextQueryResponse>;
2138
2212
  /** Store a memory for an agent */
2139
2213
  storeMemory(agentId: string, request: StoreMemoryRequest): Promise<StoreMemoryResponse>;
2140
- /** Recall memories for an agent */
2214
+ /**
2215
+ * Recall memories for an agent.
2216
+ *
2217
+ * @param agentId - Agent identifier
2218
+ * @param query - Semantic query text
2219
+ * @param options - Optional recall parameters
2220
+ * @param options.top_k - Number of primary results (default: 5)
2221
+ * @param options.memory_type - Filter by memory type
2222
+ * @param options.min_importance - Minimum importance threshold
2223
+ * @param options.include_associated - COG-2: traverse KG depth-1 and include
2224
+ * associatively linked memories in `associated_memories` (default: false)
2225
+ * @param options.associated_memories_cap - COG-2: max associated memories (default: 10, max: 10)
2226
+ * @param options.since - CE-7: only recall memories created at or after this ISO-8601 timestamp
2227
+ * @param options.until - CE-7: only recall memories created at or before this ISO-8601 timestamp
2228
+ * @returns RecallResponse with `memories` and optionally `associated_memories`
2229
+ */
2141
2230
  recall(agentId: string, query: string, options?: {
2142
2231
  top_k?: number;
2143
2232
  memory_type?: string;
2144
2233
  min_importance?: number;
2145
- }): Promise<RecalledMemory[]>;
2234
+ include_associated?: boolean;
2235
+ associated_memories_cap?: number;
2236
+ since?: string;
2237
+ until?: string;
2238
+ }): Promise<RecallResponse>;
2146
2239
  /** Get a specific memory */
2147
2240
  getMemory(agentId: string, memoryId: string): Promise<Memory>;
2148
2241
  /** Update an existing memory */
@@ -2749,6 +2842,32 @@ declare class DakeraClient {
2749
2842
  * @throws {Error} If `odeUrl` is not configured.
2750
2843
  */
2751
2844
  odeExtractEntities(content: string, agentId: string, memoryId?: string, entityTypes?: string[]): Promise<ExtractEntitiesResponse>;
2845
+ /**
2846
+ * Return the memory lifecycle policy for a namespace (COG-1).
2847
+ *
2848
+ * `GET /v1/namespaces/{namespace}/memory_policy`
2849
+ *
2850
+ * When no explicit policy has been configured the server returns COG-1
2851
+ * defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
2852
+ * exponential / power_law / logarithmic / flat decay; SR factor 1.0.
2853
+ *
2854
+ * @param namespace Namespace to inspect.
2855
+ */
2856
+ getMemoryPolicy(namespace: string): Promise<MemoryPolicy>;
2857
+ /**
2858
+ * Set the memory lifecycle policy for a namespace (COG-1).
2859
+ *
2860
+ * `PUT /v1/namespaces/{namespace}/memory_policy`
2861
+ *
2862
+ * The policy is persisted in namespace config and applied immediately to
2863
+ * the decay engine background task. Only populate the fields you want to
2864
+ * override — all fields have safe server-side defaults.
2865
+ *
2866
+ * @param namespace Namespace to configure.
2867
+ * @param policy {@link MemoryPolicy} with the desired settings.
2868
+ * @returns The updated policy as confirmed by the server.
2869
+ */
2870
+ setMemoryPolicy(namespace: string, policy: MemoryPolicy): Promise<MemoryPolicy>;
2752
2871
  }
2753
2872
 
2754
2873
  /**
@@ -2813,4 +2932,4 @@ declare class TimeoutError extends DakeraError {
2813
2932
  constructor(message: string);
2814
2933
  }
2815
2934
 
2816
- 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 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 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 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 RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionId, 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 };
2935
+ 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 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 SessionId, 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 };
package/dist/index.d.ts CHANGED
@@ -454,6 +454,13 @@ interface RecalledMemory {
454
454
  /** Creation timestamp */
455
455
  created_at?: string;
456
456
  }
457
+ /** COG-2: Response from the recall endpoint with optional associative memories */
458
+ interface RecallResponse {
459
+ /** Primary recalled memories */
460
+ memories: RecalledMemory[];
461
+ /** COG-2: KG depth-1 associated memories (only present when include_associated was true) */
462
+ associated_memories?: RecalledMemory[];
463
+ }
457
464
  /** Response from storing a memory */
458
465
  interface StoreMemoryResponse {
459
466
  /** Created memory ID */
@@ -480,6 +487,10 @@ interface RecallRequest {
480
487
  memory_type?: string;
481
488
  /** Minimum importance threshold */
482
489
  min_importance?: number;
490
+ /** CE-7: only recall memories created at or after this ISO-8601 timestamp */
491
+ since?: string;
492
+ /** CE-7: only recall memories created at or before this ISO-8601 timestamp */
493
+ until?: string;
483
494
  }
484
495
  /** Request to update importance */
485
496
  interface UpdateImportanceRequest {
@@ -1619,6 +1630,69 @@ interface ExtractEntitiesResponse {
1619
1630
  /** Wall-clock time taken by the ODE sidecar in milliseconds. */
1620
1631
  processing_time_ms: number;
1621
1632
  }
1633
+ /**
1634
+ * Decay strategy name. The COG-1 variants (power_law, logarithmic, flat) are
1635
+ * only valid inside MemoryPolicy per-type fields; the global DecayConfig
1636
+ * endpoint still accepts only "exponential" | "linear" | "step".
1637
+ */
1638
+ type DecayStrategyName = 'exponential' | 'linear' | 'step' | 'power_law' | 'logarithmic' | 'flat';
1639
+ /**
1640
+ * Per-namespace memory lifecycle policy (COG-1).
1641
+ *
1642
+ * Controls type-specific TTLs, decay curves, and spaced repetition behaviour.
1643
+ * All fields are optional and have sensible server-side defaults; only set the
1644
+ * ones you want to override.
1645
+ *
1646
+ * Used by {@link DakeraClient.getMemoryPolicy} and
1647
+ * {@link DakeraClient.setMemoryPolicy}.
1648
+ */
1649
+ interface MemoryPolicy {
1650
+ /** Default TTL for `working` memories in seconds (default: 14 400 = 4 h). */
1651
+ working_ttl_seconds?: number;
1652
+ /** Default TTL for `episodic` memories in seconds (default: 2 592 000 = 30 d). */
1653
+ episodic_ttl_seconds?: number;
1654
+ /** Default TTL for `semantic` memories in seconds (default: 31 536 000 = 365 d). */
1655
+ semantic_ttl_seconds?: number;
1656
+ /** Default TTL for `procedural` memories in seconds (default: 63 072 000 = 730 d). */
1657
+ procedural_ttl_seconds?: number;
1658
+ /** Decay strategy for `working` memories (default: `"exponential"`). */
1659
+ working_decay?: DecayStrategyName;
1660
+ /** Decay strategy for `episodic` memories (default: `"power_law"`). */
1661
+ episodic_decay?: DecayStrategyName;
1662
+ /** Decay strategy for `semantic` memories (default: `"logarithmic"`). */
1663
+ semantic_decay?: DecayStrategyName;
1664
+ /** Decay strategy for `procedural` memories (default: `"flat"` — no decay). */
1665
+ procedural_decay?: DecayStrategyName;
1666
+ /**
1667
+ * Multiplier for the TTL extension on each recall hit.
1668
+ * Extension = `access_count × sr_factor × sr_base_interval_seconds`.
1669
+ * Set to 0 to disable. Default: 1.0.
1670
+ */
1671
+ spaced_repetition_factor?: number;
1672
+ /** Base interval in seconds for spaced repetition (default: 86 400 = 1 d). */
1673
+ spaced_repetition_base_interval_seconds?: number;
1674
+ /**
1675
+ * Enable background DBSCAN deduplication for this namespace.
1676
+ * When `true` the server merges semantically near-duplicate memories every
1677
+ * `consolidation_interval_hours` hours. Default: `false`.
1678
+ */
1679
+ consolidation_enabled?: boolean;
1680
+ /**
1681
+ * DBSCAN epsilon — cosine-similarity threshold to consider two memories
1682
+ * duplicates (default: `0.92`; higher = only merge very close neighbours).
1683
+ */
1684
+ consolidation_threshold?: number;
1685
+ /**
1686
+ * How often (in hours) the background consolidation job runs for this
1687
+ * namespace (default: `24`).
1688
+ */
1689
+ consolidation_interval_hours?: number;
1690
+ /**
1691
+ * **Read-only.** Lifetime count of memories merged by the consolidation
1692
+ * engine. The server manages this field; any value you send is ignored.
1693
+ */
1694
+ consolidated_count?: number;
1695
+ }
1622
1696
 
1623
1697
  /**
1624
1698
  * Dakera Client
@@ -2137,12 +2211,31 @@ declare class DakeraClient {
2137
2211
  batchQueryText(namespace: string, queries: string[], options?: BatchTextQueryOptions): Promise<BatchTextQueryResponse>;
2138
2212
  /** Store a memory for an agent */
2139
2213
  storeMemory(agentId: string, request: StoreMemoryRequest): Promise<StoreMemoryResponse>;
2140
- /** Recall memories for an agent */
2214
+ /**
2215
+ * Recall memories for an agent.
2216
+ *
2217
+ * @param agentId - Agent identifier
2218
+ * @param query - Semantic query text
2219
+ * @param options - Optional recall parameters
2220
+ * @param options.top_k - Number of primary results (default: 5)
2221
+ * @param options.memory_type - Filter by memory type
2222
+ * @param options.min_importance - Minimum importance threshold
2223
+ * @param options.include_associated - COG-2: traverse KG depth-1 and include
2224
+ * associatively linked memories in `associated_memories` (default: false)
2225
+ * @param options.associated_memories_cap - COG-2: max associated memories (default: 10, max: 10)
2226
+ * @param options.since - CE-7: only recall memories created at or after this ISO-8601 timestamp
2227
+ * @param options.until - CE-7: only recall memories created at or before this ISO-8601 timestamp
2228
+ * @returns RecallResponse with `memories` and optionally `associated_memories`
2229
+ */
2141
2230
  recall(agentId: string, query: string, options?: {
2142
2231
  top_k?: number;
2143
2232
  memory_type?: string;
2144
2233
  min_importance?: number;
2145
- }): Promise<RecalledMemory[]>;
2234
+ include_associated?: boolean;
2235
+ associated_memories_cap?: number;
2236
+ since?: string;
2237
+ until?: string;
2238
+ }): Promise<RecallResponse>;
2146
2239
  /** Get a specific memory */
2147
2240
  getMemory(agentId: string, memoryId: string): Promise<Memory>;
2148
2241
  /** Update an existing memory */
@@ -2749,6 +2842,32 @@ declare class DakeraClient {
2749
2842
  * @throws {Error} If `odeUrl` is not configured.
2750
2843
  */
2751
2844
  odeExtractEntities(content: string, agentId: string, memoryId?: string, entityTypes?: string[]): Promise<ExtractEntitiesResponse>;
2845
+ /**
2846
+ * Return the memory lifecycle policy for a namespace (COG-1).
2847
+ *
2848
+ * `GET /v1/namespaces/{namespace}/memory_policy`
2849
+ *
2850
+ * When no explicit policy has been configured the server returns COG-1
2851
+ * defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
2852
+ * exponential / power_law / logarithmic / flat decay; SR factor 1.0.
2853
+ *
2854
+ * @param namespace Namespace to inspect.
2855
+ */
2856
+ getMemoryPolicy(namespace: string): Promise<MemoryPolicy>;
2857
+ /**
2858
+ * Set the memory lifecycle policy for a namespace (COG-1).
2859
+ *
2860
+ * `PUT /v1/namespaces/{namespace}/memory_policy`
2861
+ *
2862
+ * The policy is persisted in namespace config and applied immediately to
2863
+ * the decay engine background task. Only populate the fields you want to
2864
+ * override — all fields have safe server-side defaults.
2865
+ *
2866
+ * @param namespace Namespace to configure.
2867
+ * @param policy {@link MemoryPolicy} with the desired settings.
2868
+ * @returns The updated policy as confirmed by the server.
2869
+ */
2870
+ setMemoryPolicy(namespace: string, policy: MemoryPolicy): Promise<MemoryPolicy>;
2752
2871
  }
2753
2872
 
2754
2873
  /**
@@ -2813,4 +2932,4 @@ declare class TimeoutError extends DakeraError {
2813
2932
  constructor(message: string);
2814
2933
  }
2815
2934
 
2816
- 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 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 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 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 RecalledMemory, type RetryConfig, type RotateEncryptionKeyRequest, type RotateEncryptionKeyResponse, type SearchResult, ServerError, type Session, type SessionId, 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 };
2935
+ 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 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 SessionId, 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 };
package/dist/index.js CHANGED
@@ -1066,11 +1066,32 @@ var DakeraClient = class {
1066
1066
  async storeMemory(agentId2, request) {
1067
1067
  return this.request("POST", `/v1/agents/${agentId2}/memories`, request);
1068
1068
  }
1069
- /** Recall memories for an agent */
1069
+ /**
1070
+ * Recall memories for an agent.
1071
+ *
1072
+ * @param agentId - Agent identifier
1073
+ * @param query - Semantic query text
1074
+ * @param options - Optional recall parameters
1075
+ * @param options.top_k - Number of primary results (default: 5)
1076
+ * @param options.memory_type - Filter by memory type
1077
+ * @param options.min_importance - Minimum importance threshold
1078
+ * @param options.include_associated - COG-2: traverse KG depth-1 and include
1079
+ * associatively linked memories in `associated_memories` (default: false)
1080
+ * @param options.associated_memories_cap - COG-2: max associated memories (default: 10, max: 10)
1081
+ * @param options.since - CE-7: only recall memories created at or after this ISO-8601 timestamp
1082
+ * @param options.until - CE-7: only recall memories created at or before this ISO-8601 timestamp
1083
+ * @returns RecallResponse with `memories` and optionally `associated_memories`
1084
+ */
1070
1085
  async recall(agentId2, query, options) {
1071
- const body = { query, ...options };
1072
- const result = await this.request("POST", `/v1/agents/${agentId2}/memories/recall`, body);
1073
- return result.memories ?? result;
1086
+ const body = { query };
1087
+ if (options?.top_k !== void 0) body["top_k"] = options.top_k;
1088
+ if (options?.memory_type !== void 0) body["memory_type"] = options.memory_type;
1089
+ if (options?.min_importance !== void 0) body["min_importance"] = options.min_importance;
1090
+ if (options?.include_associated) body["include_associated"] = true;
1091
+ if (options?.associated_memories_cap !== void 0) body["associated_memories_cap"] = options.associated_memories_cap;
1092
+ if (options?.since !== void 0) body["since"] = options.since;
1093
+ if (options?.until !== void 0) body["until"] = options.until;
1094
+ return this.request("POST", `/v1/agents/${agentId2}/memories/recall`, body);
1074
1095
  }
1075
1096
  /** Get a specific memory */
1076
1097
  async getMemory(agentId2, memoryId2) {
@@ -2112,6 +2133,46 @@ var DakeraClient = class {
2112
2133
  clearTimeout(timer);
2113
2134
  }
2114
2135
  }
2136
+ // =========================================================================
2137
+ // COG-1: Per-namespace Memory Lifecycle Policy
2138
+ // =========================================================================
2139
+ /**
2140
+ * Return the memory lifecycle policy for a namespace (COG-1).
2141
+ *
2142
+ * `GET /v1/namespaces/{namespace}/memory_policy`
2143
+ *
2144
+ * When no explicit policy has been configured the server returns COG-1
2145
+ * defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
2146
+ * exponential / power_law / logarithmic / flat decay; SR factor 1.0.
2147
+ *
2148
+ * @param namespace Namespace to inspect.
2149
+ */
2150
+ async getMemoryPolicy(namespace) {
2151
+ return this.request(
2152
+ "GET",
2153
+ `/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`
2154
+ );
2155
+ }
2156
+ /**
2157
+ * Set the memory lifecycle policy for a namespace (COG-1).
2158
+ *
2159
+ * `PUT /v1/namespaces/{namespace}/memory_policy`
2160
+ *
2161
+ * The policy is persisted in namespace config and applied immediately to
2162
+ * the decay engine background task. Only populate the fields you want to
2163
+ * override — all fields have safe server-side defaults.
2164
+ *
2165
+ * @param namespace Namespace to configure.
2166
+ * @param policy {@link MemoryPolicy} with the desired settings.
2167
+ * @returns The updated policy as confirmed by the server.
2168
+ */
2169
+ async setMemoryPolicy(namespace, policy) {
2170
+ return this.request(
2171
+ "PUT",
2172
+ `/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`,
2173
+ policy
2174
+ );
2175
+ }
2115
2176
  };
2116
2177
 
2117
2178
  // src/types.ts
package/dist/index.mjs CHANGED
@@ -1026,11 +1026,32 @@ var DakeraClient = class {
1026
1026
  async storeMemory(agentId2, request) {
1027
1027
  return this.request("POST", `/v1/agents/${agentId2}/memories`, request);
1028
1028
  }
1029
- /** Recall memories for an agent */
1029
+ /**
1030
+ * Recall memories for an agent.
1031
+ *
1032
+ * @param agentId - Agent identifier
1033
+ * @param query - Semantic query text
1034
+ * @param options - Optional recall parameters
1035
+ * @param options.top_k - Number of primary results (default: 5)
1036
+ * @param options.memory_type - Filter by memory type
1037
+ * @param options.min_importance - Minimum importance threshold
1038
+ * @param options.include_associated - COG-2: traverse KG depth-1 and include
1039
+ * associatively linked memories in `associated_memories` (default: false)
1040
+ * @param options.associated_memories_cap - COG-2: max associated memories (default: 10, max: 10)
1041
+ * @param options.since - CE-7: only recall memories created at or after this ISO-8601 timestamp
1042
+ * @param options.until - CE-7: only recall memories created at or before this ISO-8601 timestamp
1043
+ * @returns RecallResponse with `memories` and optionally `associated_memories`
1044
+ */
1030
1045
  async recall(agentId2, query, options) {
1031
- const body = { query, ...options };
1032
- const result = await this.request("POST", `/v1/agents/${agentId2}/memories/recall`, body);
1033
- return result.memories ?? result;
1046
+ const body = { query };
1047
+ if (options?.top_k !== void 0) body["top_k"] = options.top_k;
1048
+ if (options?.memory_type !== void 0) body["memory_type"] = options.memory_type;
1049
+ if (options?.min_importance !== void 0) body["min_importance"] = options.min_importance;
1050
+ if (options?.include_associated) body["include_associated"] = true;
1051
+ if (options?.associated_memories_cap !== void 0) body["associated_memories_cap"] = options.associated_memories_cap;
1052
+ if (options?.since !== void 0) body["since"] = options.since;
1053
+ if (options?.until !== void 0) body["until"] = options.until;
1054
+ return this.request("POST", `/v1/agents/${agentId2}/memories/recall`, body);
1034
1055
  }
1035
1056
  /** Get a specific memory */
1036
1057
  async getMemory(agentId2, memoryId2) {
@@ -2072,6 +2093,46 @@ var DakeraClient = class {
2072
2093
  clearTimeout(timer);
2073
2094
  }
2074
2095
  }
2096
+ // =========================================================================
2097
+ // COG-1: Per-namespace Memory Lifecycle Policy
2098
+ // =========================================================================
2099
+ /**
2100
+ * Return the memory lifecycle policy for a namespace (COG-1).
2101
+ *
2102
+ * `GET /v1/namespaces/{namespace}/memory_policy`
2103
+ *
2104
+ * When no explicit policy has been configured the server returns COG-1
2105
+ * defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
2106
+ * exponential / power_law / logarithmic / flat decay; SR factor 1.0.
2107
+ *
2108
+ * @param namespace Namespace to inspect.
2109
+ */
2110
+ async getMemoryPolicy(namespace) {
2111
+ return this.request(
2112
+ "GET",
2113
+ `/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`
2114
+ );
2115
+ }
2116
+ /**
2117
+ * Set the memory lifecycle policy for a namespace (COG-1).
2118
+ *
2119
+ * `PUT /v1/namespaces/{namespace}/memory_policy`
2120
+ *
2121
+ * The policy is persisted in namespace config and applied immediately to
2122
+ * the decay engine background task. Only populate the fields you want to
2123
+ * override — all fields have safe server-side defaults.
2124
+ *
2125
+ * @param namespace Namespace to configure.
2126
+ * @param policy {@link MemoryPolicy} with the desired settings.
2127
+ * @returns The updated policy as confirmed by the server.
2128
+ */
2129
+ async setMemoryPolicy(namespace, policy) {
2130
+ return this.request(
2131
+ "PUT",
2132
+ `/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`,
2133
+ policy
2134
+ );
2135
+ }
2075
2136
  };
2076
2137
 
2077
2138
  // src/types.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dakera-ai/dakera",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "TypeScript/JavaScript SDK for Dakera AI memory platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",