Skip to Content
Anuma SDKReactInternalFunctionscreateMemoryVaultTool

createMemoryVaultTool

createMemoryVaultTool(vaultCtx: VaultMemoryOperationsContext | MemoryStore, options?: MemoryVaultToolOptions, embeddingOptions?: MemoryEngineEmbeddingOptions, cache?: VaultEmbeddingCache): ToolConfig

Defined in: src/lib/memoryVault/tool.ts:197 

Creates a memory vault tool for use with chat completions.

The tool allows the LLM to save and update persistent memories. Each operation can be intercepted for user confirmation before committing.

Parameters

ParameterTypeDescription

vaultCtx

VaultMemoryOperationsContext | MemoryStore

Vault operations context, or a MemoryStore (no folders; the store embeds its own writes)

options?

MemoryVaultToolOptions

Optional configuration (onSave callback for confirmation)

embeddingOptions?

MemoryEngineEmbeddingOptions

‐

cache?

VaultEmbeddingCache

‐

Returns

ToolConfig

A ToolConfig that can be passed to chat completion tools

Example

const tool = createMemoryVaultTool(vaultCtx, { onSave: async (op) => { // Show confirmation toast, return true/false return await showConfirmationToast(op); }, }); await sendMessage({ messages: [...], clientTools: [tool], });
Last updated on