跳转至

OpenMemory Self-Hosted — Chrome Extension

Fork of mem0ai/mem0-chrome-extension, customized for self-hosted Mem0 instances.

What's Different

This is a self-hosted version — no Mem0 Cloud, no Google login required. All data stays on your own infrastructure.

Key Changes from Upstream

Feature Upstream This Fork
Backend Mem0 Cloud (api.mem0.ai) Self-hosted Mem0 API (configurable URL)
Auth Google OAuth None needed (self-hosted)
Default endpoint https://api.mem0.ai https://mm.lalayunssl.xyz
Extension popup Popup with connect form ❌ Removed — click icon opens Sidebar directly
Memory Style N/A Formats <relevant-memories> blocks in OpenClaw Webchat with collapsible sections
Sidebar Basic memory list Full sidebar with memories, delete, settings, and Memory Style toggle
Platforms ChatGPT, Claude, Gemini, etc. All upstream + OpenClaw Webchat (bot.lalayunssl.xyz)

Memory Formatter (memory-formatter.ts)

Styles <relevant-memories> blocks injected by the openclaw-mem0 plugin:

  • Purple border card with 🧠 Recalled Memories badge
  • Collapsible sections: Long-term / Session — click to expand/collapse
  • Smart validation: Only styles real memory injections, ignores code discussions
  • Lit-compatible: Works with OpenClaw's closed Shadow DOM (scans light DOM .chat-text)
  • Toggle on/off in Sidebar → Settings → 记忆样式

Installation

Prerequisites

Build & Install

git clone https://github.com/visense/mem0-chrome-extension.git
cd mem0-chrome-extension
npm install
npm run build

Load in Chrome

  1. Open chrome://extensions/
  2. Enable Developer mode (top right)
  3. Click Load unpacked → select the dist/ directory
  4. The 🧠 icon appears in your toolbar

Configure

  1. Click the 🧠 icon → Sidebar opens
  2. Go to Settings tab
  3. Set your API URL (default: https://mm.lalayunssl.xyz)
  4. Set your User ID (default: cocodex)
  5. Toggle 记忆样式 to style <relevant-memories> blocks

Features

  • Sidebar — View, search, copy, and delete memories
  • Right-click — Save selected text as memory
  • Auto-capture — ChatGPT, Claude, Gemini, Perplexity, Grok, DeepSeek, Replit, OpenClaw conversations
  • Memory Style — Format injected memory blocks for readability (OpenClaw Webchat)
  • Multi-user — Switch between users in sidebar

Architecture

src/
├── memory-formatter.ts  # Styles <relevant-memories> in OpenClaw Webchat
├── background.ts        # Service worker: API proxy, context menu, side panel
├── sidebar.ts           # Injected sidebar (all pages)
├── sidepanel.html/ts    # Chrome native Side Panel (memories + settings)
├── popup.html/ts        # Legacy popup (not used, icon opens sidebar)
├── config.ts            # Self-hosted API config
├── openclaw/content.ts  # OpenClaw Webchat auto-capture
├── chatgpt/content.ts   # ChatGPT auto-capture
├── claude/content.ts    # Claude auto-capture
└── ...                  # Other platform content scripts

Troubleshooting

Memory Style not working? - Ensure 记忆样式 is enabled in Sidebar → Settings - Check DevTools Console for [mem0-formatter] logs - The formatter needs <relevant-memories> text to start with "The following memories may be relevant"

Sidebar shows "Error loading memories"? - Verify your Mem0 API is running and accessible - Check the API URL in Settings - Try disabling then re-enabling the extension

Upstream

Based on mem0ai/mem0-chrome-extension (MIT License).

License

MIT


中文说明

基于 mem0ai/mem0-chrome-extension 的二次开发版本,专为自建 Mem0 定制。

与上游的区别

功能 上游 本 Fork
后端 Mem0 云服务 (api.mem0.ai) 自建 Mem0 API(可配置 URL)
登录 Google OAuth 无需登录
默认端点 https://api.mem0.ai https://mm.lalayunssl.xyz
点击图标 弹出 Popup ❌ 已移除 — 直接打开 Sidebar
记忆样式 格式化 OpenClaw Webchat 中的 <relevant-memories> 为可折叠卡片
侧边栏 基础记忆列表 完整侧边栏:记忆列表、删除、设置、记忆样式开关
平台支持 ChatGPT、Claude、Gemini 等 全部上游平台 + OpenClaw Webchat

记忆样式功能 (memory-formatter.ts)

openclaw-mem0 插件注入的 <relevant-memories> 块进行样式美化:

  • 🟣 紫色边框卡片 + 🧠 Recalled Memories 标签
  • 可折叠分组:Long-term / Session — 点击展开/收起
  • 智能验证:只对插件注入的真实记忆生效,忽略代码讨论中提到的标签
  • Lit 兼容:适配 OpenClaw 的 closed Shadow DOM(扫描 light DOM .chat-text
  • 在 Sidebar → Settings → 记忆样式 开关控制

安装

环境要求

构建

git clone https://github.com/visense/mem0-chrome-extension.git
cd mem0-chrome-extension
npm install
npm run build

加载到 Chrome

  1. 打开 chrome://extensions/
  2. 右上角开启开发者模式
  3. 点击加载已解压的扩展程序 → 选择 dist/ 目录
  4. 工具栏出现 🧠 图标

配置

  1. 点击 🧠 图标 → 打开侧边栏
  2. 切换到 Settings 标签
  3. 设置 API URL(默认:https://mm.lalayunssl.xyz
  4. 设置 User ID(默认:cocodex
  5. 开启记忆样式以美化 <relevant-memories> 显示

功能一览

  • 侧边栏 — 查看、搜索、复制、删除记忆
  • 右键菜单 — 选中文本存为记忆
  • 自动捕获 — ChatGPT、Claude、Gemini、Perplexity、Grok、DeepSeek、Replit、OpenClaw 对话
  • 记忆样式 — 格式化注入的记忆块(OpenClaw Webchat)
  • 多用户 — 侧边栏切换用户

常见问题

记忆样式不生效? - 确认 Sidebar → Settings → 记忆样式已开启 - 打开 DevTools Console 查看 [mem0-formatter] 日志 - 格式化器要求 <relevant-memories> 内容以 "The following memories may be relevant" 开头

侧边栏显示 "Error loading memories"? - 确认 Mem0 API 正在运行且可访问 - 检查 Settings 中的 API URL - 尝试禁用再重新启用扩展

许可证

MIT