@dakera-ai/dakera 0.9.7 → 0.9.8
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 +93 -3
- package/dist/index.d.ts +93 -3
- package/dist/index.js +61 -4
- package/dist/index.mjs +61 -4
- package/package.json +1 -1
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 */
|
|
@@ -1619,6 +1626,48 @@ interface ExtractEntitiesResponse {
|
|
|
1619
1626
|
/** Wall-clock time taken by the ODE sidecar in milliseconds. */
|
|
1620
1627
|
processing_time_ms: number;
|
|
1621
1628
|
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Decay strategy name. The COG-1 variants (power_law, logarithmic, flat) are
|
|
1631
|
+
* only valid inside MemoryPolicy per-type fields; the global DecayConfig
|
|
1632
|
+
* endpoint still accepts only "exponential" | "linear" | "step".
|
|
1633
|
+
*/
|
|
1634
|
+
type DecayStrategyName = 'exponential' | 'linear' | 'step' | 'power_law' | 'logarithmic' | 'flat';
|
|
1635
|
+
/**
|
|
1636
|
+
* Per-namespace memory lifecycle policy (COG-1).
|
|
1637
|
+
*
|
|
1638
|
+
* Controls type-specific TTLs, decay curves, and spaced repetition behaviour.
|
|
1639
|
+
* All fields are optional and have sensible server-side defaults; only set the
|
|
1640
|
+
* ones you want to override.
|
|
1641
|
+
*
|
|
1642
|
+
* Used by {@link DakeraClient.getMemoryPolicy} and
|
|
1643
|
+
* {@link DakeraClient.setMemoryPolicy}.
|
|
1644
|
+
*/
|
|
1645
|
+
interface MemoryPolicy {
|
|
1646
|
+
/** Default TTL for `working` memories in seconds (default: 14 400 = 4 h). */
|
|
1647
|
+
working_ttl_seconds?: number;
|
|
1648
|
+
/** Default TTL for `episodic` memories in seconds (default: 2 592 000 = 30 d). */
|
|
1649
|
+
episodic_ttl_seconds?: number;
|
|
1650
|
+
/** Default TTL for `semantic` memories in seconds (default: 31 536 000 = 365 d). */
|
|
1651
|
+
semantic_ttl_seconds?: number;
|
|
1652
|
+
/** Default TTL for `procedural` memories in seconds (default: 63 072 000 = 730 d). */
|
|
1653
|
+
procedural_ttl_seconds?: number;
|
|
1654
|
+
/** Decay strategy for `working` memories (default: `"exponential"`). */
|
|
1655
|
+
working_decay?: DecayStrategyName;
|
|
1656
|
+
/** Decay strategy for `episodic` memories (default: `"power_law"`). */
|
|
1657
|
+
episodic_decay?: DecayStrategyName;
|
|
1658
|
+
/** Decay strategy for `semantic` memories (default: `"logarithmic"`). */
|
|
1659
|
+
semantic_decay?: DecayStrategyName;
|
|
1660
|
+
/** Decay strategy for `procedural` memories (default: `"flat"` — no decay). */
|
|
1661
|
+
procedural_decay?: DecayStrategyName;
|
|
1662
|
+
/**
|
|
1663
|
+
* Multiplier for the TTL extension on each recall hit.
|
|
1664
|
+
* Extension = `access_count × sr_factor × sr_base_interval_seconds`.
|
|
1665
|
+
* Set to 0 to disable. Default: 1.0.
|
|
1666
|
+
*/
|
|
1667
|
+
spaced_repetition_factor?: number;
|
|
1668
|
+
/** Base interval in seconds for spaced repetition (default: 86 400 = 1 d). */
|
|
1669
|
+
spaced_repetition_base_interval_seconds?: number;
|
|
1670
|
+
}
|
|
1622
1671
|
|
|
1623
1672
|
/**
|
|
1624
1673
|
* Dakera Client
|
|
@@ -2137,12 +2186,27 @@ declare class DakeraClient {
|
|
|
2137
2186
|
batchQueryText(namespace: string, queries: string[], options?: BatchTextQueryOptions): Promise<BatchTextQueryResponse>;
|
|
2138
2187
|
/** Store a memory for an agent */
|
|
2139
2188
|
storeMemory(agentId: string, request: StoreMemoryRequest): Promise<StoreMemoryResponse>;
|
|
2140
|
-
/**
|
|
2189
|
+
/**
|
|
2190
|
+
* Recall memories for an agent.
|
|
2191
|
+
*
|
|
2192
|
+
* @param agentId - Agent identifier
|
|
2193
|
+
* @param query - Semantic query text
|
|
2194
|
+
* @param options - Optional recall parameters
|
|
2195
|
+
* @param options.top_k - Number of primary results (default: 5)
|
|
2196
|
+
* @param options.memory_type - Filter by memory type
|
|
2197
|
+
* @param options.min_importance - Minimum importance threshold
|
|
2198
|
+
* @param options.include_associated - COG-2: traverse KG depth-1 and include
|
|
2199
|
+
* associatively linked memories in `associated_memories` (default: false)
|
|
2200
|
+
* @param options.associated_memories_cap - COG-2: max associated memories (default: 10, max: 10)
|
|
2201
|
+
* @returns RecallResponse with `memories` and optionally `associated_memories`
|
|
2202
|
+
*/
|
|
2141
2203
|
recall(agentId: string, query: string, options?: {
|
|
2142
2204
|
top_k?: number;
|
|
2143
2205
|
memory_type?: string;
|
|
2144
2206
|
min_importance?: number;
|
|
2145
|
-
|
|
2207
|
+
include_associated?: boolean;
|
|
2208
|
+
associated_memories_cap?: number;
|
|
2209
|
+
}): Promise<RecallResponse>;
|
|
2146
2210
|
/** Get a specific memory */
|
|
2147
2211
|
getMemory(agentId: string, memoryId: string): Promise<Memory>;
|
|
2148
2212
|
/** Update an existing memory */
|
|
@@ -2749,6 +2813,32 @@ declare class DakeraClient {
|
|
|
2749
2813
|
* @throws {Error} If `odeUrl` is not configured.
|
|
2750
2814
|
*/
|
|
2751
2815
|
odeExtractEntities(content: string, agentId: string, memoryId?: string, entityTypes?: string[]): Promise<ExtractEntitiesResponse>;
|
|
2816
|
+
/**
|
|
2817
|
+
* Return the memory lifecycle policy for a namespace (COG-1).
|
|
2818
|
+
*
|
|
2819
|
+
* `GET /v1/namespaces/{namespace}/memory_policy`
|
|
2820
|
+
*
|
|
2821
|
+
* When no explicit policy has been configured the server returns COG-1
|
|
2822
|
+
* defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
|
|
2823
|
+
* exponential / power_law / logarithmic / flat decay; SR factor 1.0.
|
|
2824
|
+
*
|
|
2825
|
+
* @param namespace Namespace to inspect.
|
|
2826
|
+
*/
|
|
2827
|
+
getMemoryPolicy(namespace: string): Promise<MemoryPolicy>;
|
|
2828
|
+
/**
|
|
2829
|
+
* Set the memory lifecycle policy for a namespace (COG-1).
|
|
2830
|
+
*
|
|
2831
|
+
* `PUT /v1/namespaces/{namespace}/memory_policy`
|
|
2832
|
+
*
|
|
2833
|
+
* The policy is persisted in namespace config and applied immediately to
|
|
2834
|
+
* the decay engine background task. Only populate the fields you want to
|
|
2835
|
+
* override — all fields have safe server-side defaults.
|
|
2836
|
+
*
|
|
2837
|
+
* @param namespace Namespace to configure.
|
|
2838
|
+
* @param policy {@link MemoryPolicy} with the desired settings.
|
|
2839
|
+
* @returns The updated policy as confirmed by the server.
|
|
2840
|
+
*/
|
|
2841
|
+
setMemoryPolicy(namespace: string, policy: MemoryPolicy): Promise<MemoryPolicy>;
|
|
2752
2842
|
}
|
|
2753
2843
|
|
|
2754
2844
|
/**
|
|
@@ -2813,4 +2903,4 @@ declare class TimeoutError extends DakeraError {
|
|
|
2813
2903
|
constructor(message: string);
|
|
2814
2904
|
}
|
|
2815
2905
|
|
|
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 };
|
|
2906
|
+
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 */
|
|
@@ -1619,6 +1626,48 @@ interface ExtractEntitiesResponse {
|
|
|
1619
1626
|
/** Wall-clock time taken by the ODE sidecar in milliseconds. */
|
|
1620
1627
|
processing_time_ms: number;
|
|
1621
1628
|
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Decay strategy name. The COG-1 variants (power_law, logarithmic, flat) are
|
|
1631
|
+
* only valid inside MemoryPolicy per-type fields; the global DecayConfig
|
|
1632
|
+
* endpoint still accepts only "exponential" | "linear" | "step".
|
|
1633
|
+
*/
|
|
1634
|
+
type DecayStrategyName = 'exponential' | 'linear' | 'step' | 'power_law' | 'logarithmic' | 'flat';
|
|
1635
|
+
/**
|
|
1636
|
+
* Per-namespace memory lifecycle policy (COG-1).
|
|
1637
|
+
*
|
|
1638
|
+
* Controls type-specific TTLs, decay curves, and spaced repetition behaviour.
|
|
1639
|
+
* All fields are optional and have sensible server-side defaults; only set the
|
|
1640
|
+
* ones you want to override.
|
|
1641
|
+
*
|
|
1642
|
+
* Used by {@link DakeraClient.getMemoryPolicy} and
|
|
1643
|
+
* {@link DakeraClient.setMemoryPolicy}.
|
|
1644
|
+
*/
|
|
1645
|
+
interface MemoryPolicy {
|
|
1646
|
+
/** Default TTL for `working` memories in seconds (default: 14 400 = 4 h). */
|
|
1647
|
+
working_ttl_seconds?: number;
|
|
1648
|
+
/** Default TTL for `episodic` memories in seconds (default: 2 592 000 = 30 d). */
|
|
1649
|
+
episodic_ttl_seconds?: number;
|
|
1650
|
+
/** Default TTL for `semantic` memories in seconds (default: 31 536 000 = 365 d). */
|
|
1651
|
+
semantic_ttl_seconds?: number;
|
|
1652
|
+
/** Default TTL for `procedural` memories in seconds (default: 63 072 000 = 730 d). */
|
|
1653
|
+
procedural_ttl_seconds?: number;
|
|
1654
|
+
/** Decay strategy for `working` memories (default: `"exponential"`). */
|
|
1655
|
+
working_decay?: DecayStrategyName;
|
|
1656
|
+
/** Decay strategy for `episodic` memories (default: `"power_law"`). */
|
|
1657
|
+
episodic_decay?: DecayStrategyName;
|
|
1658
|
+
/** Decay strategy for `semantic` memories (default: `"logarithmic"`). */
|
|
1659
|
+
semantic_decay?: DecayStrategyName;
|
|
1660
|
+
/** Decay strategy for `procedural` memories (default: `"flat"` — no decay). */
|
|
1661
|
+
procedural_decay?: DecayStrategyName;
|
|
1662
|
+
/**
|
|
1663
|
+
* Multiplier for the TTL extension on each recall hit.
|
|
1664
|
+
* Extension = `access_count × sr_factor × sr_base_interval_seconds`.
|
|
1665
|
+
* Set to 0 to disable. Default: 1.0.
|
|
1666
|
+
*/
|
|
1667
|
+
spaced_repetition_factor?: number;
|
|
1668
|
+
/** Base interval in seconds for spaced repetition (default: 86 400 = 1 d). */
|
|
1669
|
+
spaced_repetition_base_interval_seconds?: number;
|
|
1670
|
+
}
|
|
1622
1671
|
|
|
1623
1672
|
/**
|
|
1624
1673
|
* Dakera Client
|
|
@@ -2137,12 +2186,27 @@ declare class DakeraClient {
|
|
|
2137
2186
|
batchQueryText(namespace: string, queries: string[], options?: BatchTextQueryOptions): Promise<BatchTextQueryResponse>;
|
|
2138
2187
|
/** Store a memory for an agent */
|
|
2139
2188
|
storeMemory(agentId: string, request: StoreMemoryRequest): Promise<StoreMemoryResponse>;
|
|
2140
|
-
/**
|
|
2189
|
+
/**
|
|
2190
|
+
* Recall memories for an agent.
|
|
2191
|
+
*
|
|
2192
|
+
* @param agentId - Agent identifier
|
|
2193
|
+
* @param query - Semantic query text
|
|
2194
|
+
* @param options - Optional recall parameters
|
|
2195
|
+
* @param options.top_k - Number of primary results (default: 5)
|
|
2196
|
+
* @param options.memory_type - Filter by memory type
|
|
2197
|
+
* @param options.min_importance - Minimum importance threshold
|
|
2198
|
+
* @param options.include_associated - COG-2: traverse KG depth-1 and include
|
|
2199
|
+
* associatively linked memories in `associated_memories` (default: false)
|
|
2200
|
+
* @param options.associated_memories_cap - COG-2: max associated memories (default: 10, max: 10)
|
|
2201
|
+
* @returns RecallResponse with `memories` and optionally `associated_memories`
|
|
2202
|
+
*/
|
|
2141
2203
|
recall(agentId: string, query: string, options?: {
|
|
2142
2204
|
top_k?: number;
|
|
2143
2205
|
memory_type?: string;
|
|
2144
2206
|
min_importance?: number;
|
|
2145
|
-
|
|
2207
|
+
include_associated?: boolean;
|
|
2208
|
+
associated_memories_cap?: number;
|
|
2209
|
+
}): Promise<RecallResponse>;
|
|
2146
2210
|
/** Get a specific memory */
|
|
2147
2211
|
getMemory(agentId: string, memoryId: string): Promise<Memory>;
|
|
2148
2212
|
/** Update an existing memory */
|
|
@@ -2749,6 +2813,32 @@ declare class DakeraClient {
|
|
|
2749
2813
|
* @throws {Error} If `odeUrl` is not configured.
|
|
2750
2814
|
*/
|
|
2751
2815
|
odeExtractEntities(content: string, agentId: string, memoryId?: string, entityTypes?: string[]): Promise<ExtractEntitiesResponse>;
|
|
2816
|
+
/**
|
|
2817
|
+
* Return the memory lifecycle policy for a namespace (COG-1).
|
|
2818
|
+
*
|
|
2819
|
+
* `GET /v1/namespaces/{namespace}/memory_policy`
|
|
2820
|
+
*
|
|
2821
|
+
* When no explicit policy has been configured the server returns COG-1
|
|
2822
|
+
* defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
|
|
2823
|
+
* exponential / power_law / logarithmic / flat decay; SR factor 1.0.
|
|
2824
|
+
*
|
|
2825
|
+
* @param namespace Namespace to inspect.
|
|
2826
|
+
*/
|
|
2827
|
+
getMemoryPolicy(namespace: string): Promise<MemoryPolicy>;
|
|
2828
|
+
/**
|
|
2829
|
+
* Set the memory lifecycle policy for a namespace (COG-1).
|
|
2830
|
+
*
|
|
2831
|
+
* `PUT /v1/namespaces/{namespace}/memory_policy`
|
|
2832
|
+
*
|
|
2833
|
+
* The policy is persisted in namespace config and applied immediately to
|
|
2834
|
+
* the decay engine background task. Only populate the fields you want to
|
|
2835
|
+
* override — all fields have safe server-side defaults.
|
|
2836
|
+
*
|
|
2837
|
+
* @param namespace Namespace to configure.
|
|
2838
|
+
* @param policy {@link MemoryPolicy} with the desired settings.
|
|
2839
|
+
* @returns The updated policy as confirmed by the server.
|
|
2840
|
+
*/
|
|
2841
|
+
setMemoryPolicy(namespace: string, policy: MemoryPolicy): Promise<MemoryPolicy>;
|
|
2752
2842
|
}
|
|
2753
2843
|
|
|
2754
2844
|
/**
|
|
@@ -2813,4 +2903,4 @@ declare class TimeoutError extends DakeraError {
|
|
|
2813
2903
|
constructor(message: string);
|
|
2814
2904
|
}
|
|
2815
2905
|
|
|
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 };
|
|
2906
|
+
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,28 @@ var DakeraClient = class {
|
|
|
1066
1066
|
async storeMemory(agentId2, request) {
|
|
1067
1067
|
return this.request("POST", `/v1/agents/${agentId2}/memories`, request);
|
|
1068
1068
|
}
|
|
1069
|
-
/**
|
|
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
|
+
* @returns RecallResponse with `memories` and optionally `associated_memories`
|
|
1082
|
+
*/
|
|
1070
1083
|
async recall(agentId2, query, options) {
|
|
1071
|
-
const body = { query
|
|
1072
|
-
|
|
1073
|
-
|
|
1084
|
+
const body = { query };
|
|
1085
|
+
if (options?.top_k !== void 0) body["top_k"] = options.top_k;
|
|
1086
|
+
if (options?.memory_type !== void 0) body["memory_type"] = options.memory_type;
|
|
1087
|
+
if (options?.min_importance !== void 0) body["min_importance"] = options.min_importance;
|
|
1088
|
+
if (options?.include_associated) body["include_associated"] = true;
|
|
1089
|
+
if (options?.associated_memories_cap !== void 0) body["associated_memories_cap"] = options.associated_memories_cap;
|
|
1090
|
+
return this.request("POST", `/v1/agents/${agentId2}/memories/recall`, body);
|
|
1074
1091
|
}
|
|
1075
1092
|
/** Get a specific memory */
|
|
1076
1093
|
async getMemory(agentId2, memoryId2) {
|
|
@@ -2112,6 +2129,46 @@ var DakeraClient = class {
|
|
|
2112
2129
|
clearTimeout(timer);
|
|
2113
2130
|
}
|
|
2114
2131
|
}
|
|
2132
|
+
// =========================================================================
|
|
2133
|
+
// COG-1: Per-namespace Memory Lifecycle Policy
|
|
2134
|
+
// =========================================================================
|
|
2135
|
+
/**
|
|
2136
|
+
* Return the memory lifecycle policy for a namespace (COG-1).
|
|
2137
|
+
*
|
|
2138
|
+
* `GET /v1/namespaces/{namespace}/memory_policy`
|
|
2139
|
+
*
|
|
2140
|
+
* When no explicit policy has been configured the server returns COG-1
|
|
2141
|
+
* defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
|
|
2142
|
+
* exponential / power_law / logarithmic / flat decay; SR factor 1.0.
|
|
2143
|
+
*
|
|
2144
|
+
* @param namespace Namespace to inspect.
|
|
2145
|
+
*/
|
|
2146
|
+
async getMemoryPolicy(namespace) {
|
|
2147
|
+
return this.request(
|
|
2148
|
+
"GET",
|
|
2149
|
+
`/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`
|
|
2150
|
+
);
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Set the memory lifecycle policy for a namespace (COG-1).
|
|
2154
|
+
*
|
|
2155
|
+
* `PUT /v1/namespaces/{namespace}/memory_policy`
|
|
2156
|
+
*
|
|
2157
|
+
* The policy is persisted in namespace config and applied immediately to
|
|
2158
|
+
* the decay engine background task. Only populate the fields you want to
|
|
2159
|
+
* override — all fields have safe server-side defaults.
|
|
2160
|
+
*
|
|
2161
|
+
* @param namespace Namespace to configure.
|
|
2162
|
+
* @param policy {@link MemoryPolicy} with the desired settings.
|
|
2163
|
+
* @returns The updated policy as confirmed by the server.
|
|
2164
|
+
*/
|
|
2165
|
+
async setMemoryPolicy(namespace, policy) {
|
|
2166
|
+
return this.request(
|
|
2167
|
+
"PUT",
|
|
2168
|
+
`/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`,
|
|
2169
|
+
policy
|
|
2170
|
+
);
|
|
2171
|
+
}
|
|
2115
2172
|
};
|
|
2116
2173
|
|
|
2117
2174
|
// src/types.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1026,11 +1026,28 @@ var DakeraClient = class {
|
|
|
1026
1026
|
async storeMemory(agentId2, request) {
|
|
1027
1027
|
return this.request("POST", `/v1/agents/${agentId2}/memories`, request);
|
|
1028
1028
|
}
|
|
1029
|
-
/**
|
|
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
|
+
* @returns RecallResponse with `memories` and optionally `associated_memories`
|
|
1042
|
+
*/
|
|
1030
1043
|
async recall(agentId2, query, options) {
|
|
1031
|
-
const body = { query
|
|
1032
|
-
|
|
1033
|
-
|
|
1044
|
+
const body = { query };
|
|
1045
|
+
if (options?.top_k !== void 0) body["top_k"] = options.top_k;
|
|
1046
|
+
if (options?.memory_type !== void 0) body["memory_type"] = options.memory_type;
|
|
1047
|
+
if (options?.min_importance !== void 0) body["min_importance"] = options.min_importance;
|
|
1048
|
+
if (options?.include_associated) body["include_associated"] = true;
|
|
1049
|
+
if (options?.associated_memories_cap !== void 0) body["associated_memories_cap"] = options.associated_memories_cap;
|
|
1050
|
+
return this.request("POST", `/v1/agents/${agentId2}/memories/recall`, body);
|
|
1034
1051
|
}
|
|
1035
1052
|
/** Get a specific memory */
|
|
1036
1053
|
async getMemory(agentId2, memoryId2) {
|
|
@@ -2072,6 +2089,46 @@ var DakeraClient = class {
|
|
|
2072
2089
|
clearTimeout(timer);
|
|
2073
2090
|
}
|
|
2074
2091
|
}
|
|
2092
|
+
// =========================================================================
|
|
2093
|
+
// COG-1: Per-namespace Memory Lifecycle Policy
|
|
2094
|
+
// =========================================================================
|
|
2095
|
+
/**
|
|
2096
|
+
* Return the memory lifecycle policy for a namespace (COG-1).
|
|
2097
|
+
*
|
|
2098
|
+
* `GET /v1/namespaces/{namespace}/memory_policy`
|
|
2099
|
+
*
|
|
2100
|
+
* When no explicit policy has been configured the server returns COG-1
|
|
2101
|
+
* defaults: working=4 h, episodic=30 d, semantic=365 d, procedural=730 d;
|
|
2102
|
+
* exponential / power_law / logarithmic / flat decay; SR factor 1.0.
|
|
2103
|
+
*
|
|
2104
|
+
* @param namespace Namespace to inspect.
|
|
2105
|
+
*/
|
|
2106
|
+
async getMemoryPolicy(namespace) {
|
|
2107
|
+
return this.request(
|
|
2108
|
+
"GET",
|
|
2109
|
+
`/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`
|
|
2110
|
+
);
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* Set the memory lifecycle policy for a namespace (COG-1).
|
|
2114
|
+
*
|
|
2115
|
+
* `PUT /v1/namespaces/{namespace}/memory_policy`
|
|
2116
|
+
*
|
|
2117
|
+
* The policy is persisted in namespace config and applied immediately to
|
|
2118
|
+
* the decay engine background task. Only populate the fields you want to
|
|
2119
|
+
* override — all fields have safe server-side defaults.
|
|
2120
|
+
*
|
|
2121
|
+
* @param namespace Namespace to configure.
|
|
2122
|
+
* @param policy {@link MemoryPolicy} with the desired settings.
|
|
2123
|
+
* @returns The updated policy as confirmed by the server.
|
|
2124
|
+
*/
|
|
2125
|
+
async setMemoryPolicy(namespace, policy) {
|
|
2126
|
+
return this.request(
|
|
2127
|
+
"PUT",
|
|
2128
|
+
`/v1/namespaces/${encodeURIComponent(namespace)}/memory_policy`,
|
|
2129
|
+
policy
|
|
2130
|
+
);
|
|
2131
|
+
}
|
|
2075
2132
|
};
|
|
2076
2133
|
|
|
2077
2134
|
// src/types.ts
|