Motion Memory Plugin for Agent Host: Installation and Configuration Guide

    This article explains how to deploy the Motion Memory plugin in an Agent Host environment so an LLM-based agent can retain key behavior traces, task states, and personalized information across sessions. It covers the background and plugin architecture, preparation requirements, manual installation, placement of plugin files, mounting the settings UI plugin into the dependency directory, enabling plugins in the YAML patch configuration, restart verification, model-assisted installation, and common troubleshooting. It also compares directory junctions with directory copies and recommends verification through tool registration, settings UI loading, and memory recall.

    1. Background: Why the Motion Memory Plugin Is Needed

    When building an Agent Host environment based on large language models, a common pain point is that the model itself does not have long-term memory across sessions. After each conversation ends, the context disappears, and the agent cannot remember user preferences, historical task states, or interaction habits. The so-called “motion memory” refers to the ability to persist key behavior traces, task states, and personalized information while the agent continues to run, and to recall them on demand in later sessions.

    This capability is usually mounted into the host environment as a plugin. The host is responsible for loading plugins, registering tools, and providing a unified configuration entry point. The plugin focuses on reading, writing, retrieving, and managing the lifecycle of memory data. The solution described in this article consists of three parts: a memory core plugin that exposes a set of tool interfaces prefixed with memory_ to the model, a settings UI plugin that provides a graphical configuration panel, and a pure-function module set that encapsulates reusable memory processing logic. Together, they form a complete and maintainable memory subsystem.

    2. Preparation Before Installation

    Before installing, clarify several key concepts:

    1. Profile: The host environment manages independent workspaces by profile. Each profile has its own plugin directory, dependency directory, and configuration files. The multi-profile mechanism allows users to isolate agent instances for different purposes on the same machine.
    2. Plugin directory (plugins/): The host scans this directory at startup and loads plugin files organized in a specific format.
    3. Dependency directory (node_modules/): Some plugins use a package-structure loading method and must be placed in the dependency directory to be resolved correctly. This is a special requirement for the settings UI plugin.
    4. Patch configuration file: The host uses a YAML patch file to declare the plugin entries that need to be enabled. Only plugins registered in this file are actually activated.

    Before installation, confirm that the host environment can start normally and enter a session, the path of the target profile is known, and the operating system has permission to create directory links. On Windows, creating a directory junction usually does not require administrator privileges, but it is recommended to operate as a regular user.

    Manual installation is the best way to understand the plugin mechanism. First-time users should prefer this approach.

    3.1 Obtain Plugin Resources

    First, download the complete source package from the project release repository and extract it. In the extracted directory, plugin-related content is located under the plugins/ subdirectory and contains three types of assets:

    • motion-memory.js: The memory core plugin. The host loads this script at startup and registers memory read/write tools with the model.
    • mm-settings/: The settings UI plugin. It contains an entry script, a frontend client script, and a package descriptor, and provides a visual configuration panel for memory parameters.
    • motion-memory-modules/: A collection of pure-function modules referenced by the core plugin. It encapsulates serialization, retrieval, and merge logic for memory data, does not depend on the host environment, and is easy to unit test.

    3.2 Place Plugin Files

    Copy the three items above into the plugin directory of the target profile, keeping the original directory names and hierarchy unchanged. Pay special attention to the following: the core plugin is a single-file script and can be placed directly at the root level of the plugin directory, while the settings UI plugin and the function modules are directories and must be copied as a whole. Missing internal files will cause loading failures.

    3.3 Mount the Settings UI Plugin into the Dependency Directory

    This is the most error-prone step in the entire installation process. The client part of the settings UI plugin is loaded using a semi-package structure, and the host resolves it from the profile’s dependency directory. Therefore, an entry for mm-settings must be created in the dependency directory. There are two options:

    Option A: Directory junction (recommended on Windows)

    Use a directory junction to create a link in the dependency directory that points to mm-settings in the plugin directory. The essence is to make the same files accessible at two paths. The advantages are clear:

    • When the plugin is upgraded, only one copy in the plugin directory needs to be updated, and the entry in the dependency directory is synchronized automatically.
    • There is no risk of version inconsistency between two copies.
    • Deleting the link does not affect the original files.

    The command is as follows:

    1. mklink /J "<your-profile>\node_modules\mm-settings" "<your-profile>\plugins\mm-settings"

    Option B: Directory copy

    If the operating system does not support directory junctions, or if the user prefers a simple and direct approach, the mm-settings/ directory can be copied directly into the dependency directory to form an independent copy at node_modules/mm-settings/. This option has zero barrier to entry, but it has a clear drawback: when the plugin is upgraded, files in both locations must be updated in sync. Otherwise, the UI version and core version may become inconsistent, causing behavior anomalies that are difficult to troubleshoot.

    Recommendation: Prefer directory junctions. Use the copy option only when junctions are not feasible, such as across file systems or in some environments with restricted permissions, and document the existence of the two copies in maintenance documentation to avoid forgetting them.

    3.4 Enable Plugins in the Patch Configuration

    After the files are placed, the plugins are still inactive. Enable entries must be registered in the profile’s patch configuration file in YAML format. The core idea is to use an insert operation to append entries to the plugin list. Each entry contains a unique identifier id and a load path name. An example configuration is as follows:

    1. - insert:
    2. - id: motion-memory
    3. name: ./plugins/motion-memory.js
    4. - id: mm-settings
    5. name: mm-settings

    Two notes:

    • The name of the core plugin uses a relative path pointing to the specific script file in the plugin directory.
    • The name of the settings UI plugin uses a package name. The host resolves it from the dependency directory according to package resolution rules, which is exactly why the previous mounting step is required.
    • The id must be globally unique. It is recommended to keep it consistent with the directory name for easier troubleshooting.

    3.5 Restart and Verify

    Save the configuration and restart the host environment. Installation can be verified at three levels:

    1. Tool registration verification: In a session, check the list of available tools. A group of memory tools prefixed with memory_ should appear.
    2. UI verification: Open the host settings panel. The configuration page corresponding to the memory plugin should be visible.
    3. Functional verification: Ask the agent to record a memory, restart the session, and then ask it to recall the memory. Confirm that the persistence chain is complete and usable.

    4. Option 2: Let a Model Assistant Install It

    If the host environment is already in a conversational state, there is a more labor-saving approach: send the installation instructions above directly as a prompt to the running session and let the model assistant complete the download, file placement, link creation, and configuration changes according to the same steps.

    This approach is suitable for users who are not familiar with the command line, but note the following:

    • Require the model to output a summary of each step for human review.
    • Operations involving paths and permissions vary across environments. If the model reports a failure, fall back to the manual method.
    • After configuration changes are completed, a human still needs to confirm that the YAML format is correct before restarting.

    After successful installation, the host still needs to be restarted for the memory tools and settings UI to take effect.

    5. Common Issues and Troubleshooting

    • Memory tools are not visible after restart: First check the insert syntax and indentation in the patch configuration file, because YAML is sensitive to whitespace. Then confirm that the plugin files are actually located at the declared paths.
    • The settings UI does not open or reports a module not found: In most cases, the mount in the dependency directory is missing or the path is misspelled. Recheck whether the junction points to the correct source directory.
    • Memory is written but cannot be recalled: Check whether the function module directory was copied completely and whether the storage path for memory data has write permission.
    • Upgrading the plugin: After replacing files in the plugin directory, no additional action is required when using the junction approach. When using the copy approach, the copy in the dependency directory must be updated in sync.

    6. Conclusion

    This article covers the deployment of the Motion Memory plugin in an Agent Host, including the complete flow from resource acquisition, file placement, dependency mounting, and configuration enabling to restart verification. It also compares directory junctions and directory copies. There are three core lessons: first, understand the host’s three-part loading mechanism of “plugin directory + dependency directory + patch configuration”; second, prefer directory junctions to avoid version drift caused by duplicate files; third, after installation, always cross-verify through tool registration, UI loading, and functional recall. With this method, similar plugin installation and management tasks can be handled by analogy, laying a solid foundation for building agent applications with long-term memory capabilities.