logo
0
0
WeChat Login
crispyberry<ssslvky@gmail.com>
chore: pics in readme

MemoV - AI 编程的记忆层

English | Deutsch | Español | Français | 日本語 | 한국어 | Português | Русский | 中文

VibeGit🤌:自动管理你的提示词、上下文和代码变化

License: MIT Discord DeepWiki Twitter Follow

MemoV 是 AI 编程代理的记忆层,提供可追溯Git 驱动的提示词、上下文和代码差异版本控制。它实现了 VibeGit - AI 编程会话的自动版本化,支持分支探索、回滚功能,且对标准 .git 仓库零污染

MemoVCheckpoints
分支探索线性时间线
跨会话绑定会话
回滚保留所有历史回滚清除历史
跳转轨迹可追踪无轨迹记录

MemoV Time

功能特性

  • 一键安装 MCP — 适配任何 AI 编程助手
  • VibeGit for Agents — 自动追踪提示词、上下文和代码差异,无需手动提交
  • 版本控制 — 分支、回滚、重放任何交互
  • 保持 Git 干净 — 影子 .mem 时间线,零污染 .git
  • 可视化界面 — 在对话中说 "mem ui",访问 http://localhost:38888 查看
  • 隐私优先 — 本地存储,无数据库,零开销。使用 .memignore 排除文件

MemoV Time

快速开始(MCP 安装)

前置条件

先安装 uv

# macOS / Linux curl -LsSf https://astral.sh/uv/install.sh | sh # Windows powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # 安装 Git(如果未安装) winget install --id Git.Git -e --source winget

Claude Code

在项目根目录运行:

claude mcp add mem-mcp --scope project -- uvx --from git+https://github.com/memovai/memov.git mem-mcp-launcher stdio $(pwd)

Codex

在项目根目录运行:

codex mcp add mem-mcp -- uvx --from git+https://github.com/memovai/memov.git mem-mcp-launcher stdio $(pwd)
VS Code

在项目根目录创建 .vscode/mcp.json

{ "servers": { "mem-mcp": { "type": "stdio", "command": "uvx", "args": [ "--from", "git+https://github.com/memovai/memov.git", "mem-mcp-launcher", "stdio", "${workspaceFolder}" ] } } }
Cursor

进入 Files > Preferences > Cursor Settings > MCP,添加:

{ "mcpServers": { "mem-mcp": { "command": "uvx", "args": [ "--from", "git+https://github.com/memovai/memov.git", "mem-mcp-launcher", "stdio", "${workspaceFolder}" ] } } }
Antigravity

注意: Antigravity 不支持 "${workspaceFolder}" 变量,请手动填写项目目录的绝对路径。

前往 Settings > MCP,然后添加:

{ "mcpServers": { "mem-mcp": { "command": "uvx", "args": [ "--from", "git+https://github.com/memovai/memov.git", "mem-mcp-launcher", "stdio", "/absolute/path/to/your/project" ] } } }

/absolute/path/to/your/project 替换为项目目录的实际绝对路径(例如 macOS/Linux 上 /Users/username/projects/my-project 或 Windows 上 C:\Users\username\projects\my-project)。

启用向量数据库(RAG 模式) 🚧 WIP

要启用语义搜索、验证和调试工具,使用 [rag] 扩展安装:

Claude Code:

claude mcp add mem-mcp --scope project -- uvx --from "git+https://github.com/memovai/memov.git[rag]" mem-mcp-launcher stdio $(pwd)

VS Code / Cursor:--from 参数改为:

"git+https://github.com/memovai/memov.git[rag]"

重要提示

添加规则 — 要在每次交互后自动保存快照,请在你的编程代理中添加规则:

  • Cursor: Cursor Settings > Rules
  • Claude Code: CLAUDE.md
  • 或你的 MCP 客户端中的等效设置

示例规则:

After completing any interaction, always call `use mem snap` to save the snapshot.

Web 界面,就说 Use mem ui🤌

在对话中说 "use mem ui" — 在 http://localhost:38888 打开,包含时间线视图、分支过滤、差异查看器和一键跳转到任意快照。

CLI 安装(可选)

如果你想直接使用 mem 命令行工具(用于手动追踪、查看历史等):

一键安装

curl -fsSL https://raw.githubusercontent.com/memovai/memov/main/install.sh | bash

或使用 wget:

wget -qO- https://raw.githubusercontent.com/memovai/memov/main/install.sh | bash

包管理器

Homebrew (macOS/Linux)
brew tap memovai/mem brew install memov
APT (Debian/Ubuntu)
echo "deb [trusted=yes] https://memovai.github.io/memov/apt stable main" | sudo tee /etc/apt/sources.list.d/mem.list sudo apt update sudo apt install mem
YUM/DNF (Fedora/RHEL/CentOS)
sudo curl -o /etc/yum.repos.d/mem.repo https://memovai.github.io/memov/yum/mem.repo sudo dnf install mem
直接下载

下载适合你平台的最新版本:

平台下载
Linux x86_64mem-linux-x86_64.tar.gz
macOS Intelmem-macos-x86_64.tar.gz
macOS Apple Siliconmem-macos-arm64.tar.gz
Windows x86_64mem-windows-x86_64.exe.zip
从源码安装

需要 Python 3.10+ 和 uv

git clone https://github.com/memovai/memov.git cd memov uv sync uv pip install -e . mem --help

贡献者安装指南

请参阅 docs/installation_for_dev.md 获取详细安装说明。

架构

MemoV 采用三层架构,以 MemovManager 为核心协调器,MCP Server 作为 AI 代理的适配层,以及可选的 RAG 系统用于语义搜索。

MemoV 架构

MCP 工具

核心操作

  • snap(user_prompt: str, original_response: str, agent_plan: list[str], files_changed: str)

    • 记录每次用户交互,自动追踪文件。智能处理未追踪和已修改的文件。
  • mem_ui(port: int = 38888)

    • http://localhost:38888 启动 Web 界面,可视化浏览历史、查看差异和跳转到任意快照。
  • mem_history(limit: int = 20, commit_hash: str = "")

    • 查看 memov 历史,包括提示词、响应和文件更改。
  • mem_jump(commit_hash: str)

    • 跳转到指定快照,恢复所有追踪的文件并创建新分支。

RAG 工具(需要 [rag] 扩展)

这些工具仅在使用 [rag] 扩展安装时可用。

  • mem_sync()

    • 将所有待处理操作同步到向量数据库,启用语义搜索功能。
  • validate_commit(commit_hash: str, detailed: bool = True)

    • 通过比较提示词/响应与实际代码更改来验证特定提交。检测上下文漂移和对齐问题。
  • validate_recent(n: int = 5)

    • 验证最近 N 次提交的对齐模式。适用于会话审查和质量保证。
  • vibe_debug(query: str, error_message: str = "", stack_trace: str = "", user_logs: str = "", models: str = "", n_results: int = 5)

    • 使用 RAG 搜索 + 多模型 LLM 比较进行调试。搜索代码历史获取相关上下文,并行查询多个 AI 模型(GPT-4、Claude、Gemini)获取多样化的调试见解。
  • vibe_search(query: str, n_results: int = 5, content_type: str = "")

    • 快速语义搜索代码历史(提示词、响应、代理计划、代码更改),无需 LLM 分析。适合快速上下文查找。

健康检查

  • GET /health
    • 返回 "OK"。用于 IDE/代理就绪检查。

开源协议

MIT License。详见 LICENSE