Skip to Content
Anuma SDKReactInternalFunctionscreateMemoryVaultTool

createMemoryVaultTool

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

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

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

Vault operations context for database access

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