MemoryBridge: Local Persistent Memory and Cross-Session Recovery for AI Agents

Preface

In environments like Cursor and Claude Code, when starting a new conversation or using /new, the model typically loses access to the working context of the previous session: recently decided technical selections, unfinished tasks, and modified configuration paths all have to be manually re-explained. Common workarounds include manually pasting chat history or writing key points into the project README, but these are neither structured nor easily retrievable by the Agent on a specific topic.

Below is an introduction to MemoryBridge on SkillHub (coordinates @user_6c78b4cc/memory-bridge). It uses a local CLI and SKILL.md rules to create a closed loop of “writing logs → merging long-term memory → restoring context via a new Session bridge,” and highlights pure local operation with zero external API consumption (SkillHub tag requires_api_key=false).

What is this?

MemoryBridge is a Skill published by community publisher user_6c78b4cc under the ai-agent category on SkillHub. The current page version is 1.1.1, and the source is community.

The official one-sentence positioning: Give AI agents persistent memory to automatically restore context across sessions; provide 10 commands, pure local operation, zero API consumption, and out-of-the-box Chinese search support.

The documentation and scripts within the Skill package use memory-manager as the product name (SKILL.md, scripts/memory_cli.py, etc.). After installation, the Agent calls the scripts according to the persistence and startup rules in SKILL.md. Data is stored in paths such as memory/, MEMORY.md, and memory/bridge/ under the workspace (see below for the default layout).

Core Functions

The following capabilities are derived from SKILL.md, README.md, and references/architecture.md within the Skill package, and can be cross-referenced with the SkillHub introduction.

Ten CLI Commands

The core entry point is scripts/memory_cli.py (Python 3.8+). The commands and their uses are as follows:

Command Function
log Append daily work log
search Full-text search (jieba segmentation; documentation notes degradation to n-gram if jieba is absent)
recall Extract contextual memory by topic
summary Generate recent summary, specify days
merge Merge daily logs into MEMORY.md
clean Archive old logs, specify retention days
bridge Generate summary for cross-session recovery
list List log files
stats Memory library statistics
check Persistence compliance and risk check (log time, merge time, bridge freshness, daemon status, etc.)

Agent-Side Rules (SKILL.md)

The Skill requires the Agent to call log in specific scenarios, such as: when trigger words like “decide / selection / remember” appear in the message, when important installations or configuration changes are completed, or when the conversation turns reach checkpoint conditions. When a new Session starts, the Agent should proactively execute bridge to pull the previous segment of context, rather than just waiting for the user to verbally say “memory bridge.”

Daemon and Scheduled Merging

  • memory_daemon.py: Monitors changes in memory files; the documentation describes it as automatically performing merge and updating the bridge snapshot after debouncing.
  • Optional Cron: For example, execute merge every 30 minutes (documentation emphasizes no model API token consumption).
  • log_and_merge.sh: A shell script wrapping “write + merge.”

Multi-Workspace

The CLI supports --workdir to independently perform bridge operations for different Agent working directories; the documentation uses the Longying (Dragon Shadow) workspace as an example.

Installation and Activation

Installing the Skill via SkillHub

The installation guide provided on the SkillHub page is: Let the Agent install @user_6c78b4cc/memory-bridge according to the SkillHub installation documentation.

If the skillhub CLI is already available on your machine, you need to install the Skill to the current Agent’s skills directory (defaults to ./skills/ if --dir is not specified, which the Agent might not recognize). Path examples from the installation documentation:

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

Example (replace the path with the skills directory corresponding to your environment):

command -v skillhub && skillhub --version

skillhub install memory-bridge --namespace user_6c78b4cc --dir ~/.cursor/skills/

For first-time SkillHub CLI users, you can install skillhub via curl according to the official documentation; see https://skillhub.cn/install/skillhub.md for details.

Installing Python Dependencies and Directory

The Skill package provides a one-click script to check for Python 3.8+, install the optional dependency jieba, initialize memory/ and MEMORY.md, etc.:

bash <Skill安装目录>/scripts/install.sh
# Force reinstall dependencies: bash install.sh --force

Note: install.sh creates the memory directory structure under ~/.openclaw/workspace/ by default. If you mainly use Cursor or other non-OpenClaw environments, you need to combine --workdir or manually align the memory directory with your Agent workspace to avoid inconsistency between the script initialization path and the daily working directory.

Enabling

After placing the Skill directory into the Agent’s skills path, restart or refresh the Agent to load SKILL.md. Subsequently, the Agent will call python3 scripts/memory_cli.py ... in the conversation according to the rules (the working directory is generally the Skill package root or the workspace specified in the documentation).

Typical Usage

The following commands are excerpted from the Skill package README.md. Replace MEM with the actual path to scripts/memory_cli.py inside your local Skill.

Daily use: Persist data, check status, restore in a new Session.

MEM=~/.cursor/skills/@user_6c78b4cc/memory-bridge/scripts/memory_cli.py

python3 $MEM log "Completed a certain configuration change"
python3 $MEM check
python3 $MEM bridge

On-demand retrieval and maintenance:

python3 $MEM search "keyword"
python3 $MEM recall "topic"
python3 $MEM summary 7
python3 $MEM merge
python3 $MEM clean 30
python3 $MEM list
python3 $MEM stats

Multi-workspace bridge example (paths from official documentation):

python3 $MEM --workdir ~/.openclaw/workspace/longying-workspace bridge

Daemon (manual startup method from documentation):

python3 <Skill安装目录>/scripts/memory_daemon.py

Use Cases and Notes

Who it is for

  • Developers who need their Agents to remember decisions, task progress, and configuration changes across multiple sessions.
  • Teams hoping for memory retrieval to support Chinese word segmentation, with merging and archiving completed locally, without relying on cloud memory APIs.
  • Environments already using or planning to use the OpenClaw toolchain (session hooks, launchd daemons, cron merges); other Agents can still use the CLI + --workdir, but need to sort out the directory and startup rules themselves.

Limitations and Notes

  • Memory quality depends on whether the Agent follows the SKILL.md rules for persistence and “proactively bridging in new Sessions”; these rules are written within the Skill and will not automatically override every Agent’s configuration files.
  • Default paths and examples are heavily oriented towards ~/.openclaw/workspace/; in environments like Cursor, you must ensure that the --workdir for memory_cli.py matches the real project directory.
  • SkillHub page statistics (as of data capture): Rating 100000, approximately 986 downloads; installation counts vary by environment, refer to SkillHub for the latest.
  • Some documentation version numbers inside the package are still 1.1.0, which may differ slightly from the 1.1.1 displayed on SkillHub. Refer to the package you installed and the SkillHub version.

Conclusion

MemoryBridge turns persistent memory into an executable set of local commands and Agent operating procedures: writing logs, merging, searching, and bridge recovery are all done locally, with jieba integration for Chinese search. If you are looking to add a layer of “cross-Session context” for your Agent, you can install @user_6c78b4cc/memory-bridge from SkillHub, then run install.sh and bridge to verify the link.

  • SkillHub Page: https://www.skillhub.cn/skills/user_6c78b4cc/memory-bridge
  • API Coordinate Page: https://api.skillhub.cn/user_6c78b4cc/memory-bridge
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye