langchain.js
    Preparing search index...

    Interface MemoryTool20250818Options

    Options for creating a memory tool.

    interface MemoryTool20250818Options {
        execute: (
            action:
                | { command: "view"; path: string }
                | { command: "create"; file_text: string; path: string }
                | {
                    command: "str_replace";
                    new_str: string;
                    old_str: string;
                    path: string;
                }
                | {
                    command: "insert";
                    insert_line: number;
                    insert_text: string;
                    path: string;
                }
                | { command: "delete"; path: string }
                | { command: "rename"; new_path: string; old_path: string },
        ) => string | Promise<string>;
    }
    Index

    Properties

    Properties

    execute: (
        action:
            | { command: "view"; path: string }
            | { command: "create"; file_text: string; path: string }
            | {
                command: "str_replace";
                new_str: string;
                old_str: string;
                path: string;
            }
            | {
                command: "insert";
                insert_line: number;
                insert_text: string;
                path: string;
            }
            | { command: "delete"; path: string }
            | { command: "rename"; new_path: string; old_path: string },
    ) => string | Promise<string>

    Optional execute function that handles memory command execution. In LangChain, this is typically handled separately when processing tool calls, but this option is provided for compatibility with the AI SDK pattern. Note: This option is currently unused but reserved for future use.