🔥 Memory Forge
Stop resetting. Start editing.
本地 AI 会话管理工具 — 改写 AI 记忆,精准操控对话历史
English · 中文
Note
🚀 A new version is available: memory-forge-rs
v3 is a full rewrite in Rust — no Python, no server, just open and use.
This repo (v2, Python backend) is kept for reference. New users should use memory-forge-rs.
🚀 新版本已发布:memory-forge-rs
v3 用 Rust 完全重写,无需 Python,无需服务器,打开即用。
本仓库(v2,Python 后端)保留作参考,新用户请使用 memory-forge-rs。
What is Memory Forge?
Stop resetting. Start editing.
AI went off track? Don't restart — edit the history directly.
Memory Forge lets you modify AI's "memory" in Claude Code / Codex / OpenCode: inject context, fix errors, remove noise, then seamlessly continue the conversation.
100% local, zero cloud dependency. Your data never leaves your machine.
📸 Screenshots
✨ Features
- 🧠 Memory Manipulation — Edit any message in AI conversation history. Inject context, remove noise, fix AI's wrong assumptions — then seamlessly continue the session.
- 📊 Dashboard — Session statistics + 7-day trend chart
- 💬 Multi-platform browsing — Claude Code / Codex CLI / OpenCode in one view
- 📝 Edit audit log — Read-only change tracking with diff view
- 🏷️ Session aliases — Give sessions memorable names
- 📋 Quick command copy — Resume / Fork commands one-click copy
- 🌗 Dark / Light theme — Follow system or manual toggle
- 📚 Prompt Library — Save, manage & one-click copy frequently used prompts
- 🔒 100% local — No data leaves your computer
🖥️ Supported Platforms
| Platform |
Resume Command |
Fork Command |
Data Path |
| Claude Code |
claude --resume <id> |
claude --resume <id> --fork-session |
~/.claude |
| Codex CLI |
codex resume <id> |
— |
~/.codex |
| OpenCode |
opencode -s <id> |
opencode -s <id> --fork |
~/.local/share/opencode/opencode.db |
📦 Installation
Desktop App (Recommended)
Download the latest release for your platform:
| Platform |
Format |
Notes |
| Windows |
.exe installer / .zip portable |
NSIS installer or unzip & run |
| macOS |
.dmg |
Drag to Applications |
| Linux |
.AppImage / .deb |
AppImage is portable, no install needed |
Check the Releases page for downloads.
From Source
Prerequisites
Option 1: One-Click Launch (Windows)
Double-click start.bat — it will automatically:
- Create Python virtual environment
- Install backend dependencies
- Build frontend (if not built)
- Start backend server (serves both API + frontend)
- Open browser at
http://localhost:8000
Option 2: Development Mode
# Terminal 1 — Backend
cd backend
python -m venv .venv
.venv\Scripts\activate # Windows | source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
# Terminal 2 — Frontend
npm install
npm run dev
# Open http://localhost:5173 (Vite proxies /api to backend)
Build Desktop App
# Full build (backend + frontend + Tauri app + portable)
python build.py
# Or step by step
python build.py --backend # Build Python backend with PyInstaller
python build.py --frontend # Build frontend with Vite
python build.py --tauri # Build Tauri desktop app (installer)
python build.py --portable # Build portable ZIP (no install needed)
🏗️ Project Structure
memory-forge/
├── backend/ # Python FastAPI backend
│ ├── app/
│ │ ├── main.py # Entry point, serves frontend + API
│ │ ├── config.py # Configuration & path resolution
│ │ ├── db.py # Database setup (SQLite + SQLModel)
│ │ ├── models.py # Data models
│ │ ├── routes/
│ │ │ └── api.py # REST API endpoints
│ │ └── services/
│ │ ├── commands.py # CLI command builder
│ │ ├── edit_log.py # Audit logging
│ │ ├── aliases.py # Session aliases
│ │ └── platforms/ # Platform adapters
│ │ ├── claude.py
│ │ ├── codex.py
│ │ └── opencode.py
│ ├── memoryforge-backend.spec # PyInstaller spec
│ └── requirements.txt
├── src/ # React frontend
│ ├── components/ # UI components
│ ├── pages/ # Page views (Dashboard, About)
│ ├── stores/ # Zustand state management
│ └── lib/ # Utilities & API client
├── src-tauri/ # Tauri v2 desktop shell
├── build.py # Build script (backend + frontend + desktop)
├── start.bat # One-click launcher (Windows)
└── package.json
🛠️ Tech Stack
| Layer |
Technologies |
| Backend |
Python · FastAPI · SQLModel · SQLite |
| Frontend |
React 19 · TypeScript · Vite · Tailwind CSS · Zustand |
| Desktop |
Tauri v2 · Rust |
🤝 Contributing
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
📄 License
This project is licensed under the MIT License.
🌍 Community
Thank you to the LINUX DO community for your support!
感谢 LINUX DO 社区的支持!
Tech discussions, AI frontiers, AI experience sharing — all at LINUX DO!
👤 Author
VoidCraft — GitHub
Full-stack developer | AI tools & automation | Building things from the void ✦
什么是记忆锻造?
停止重开,直接编辑。
AI 对话走偏了?别重新开始 — 直接改掉历史记录。
记忆锻造让你在 Claude Code / Codex / OpenCode 中直接编辑 AI 的"记忆":注入上下文、纠正错误、删除废话,然后无缝继续对话。
100% 本地运行,零云端依赖。 你的数据不会离开你的电脑。
📸 应用截图
✨ 功能特性
- 🧠 记忆操控 — 编辑 AI 对话历史中的任意消息。注入上下文、删除噪音、纠正 AI 的错误假设 — 然后无缝继续会话。
- 📊 仪表盘统计 — 会话数量 + 7 天趋势图
- 💬 多平台会话浏览 — Claude Code / Codex CLI / OpenCode 统一视图
- 📝 修改记录追溯 — 只读审计日志,支持 diff 对比
- 🏷️ 会话别名 — 给会话起一个容易记的名字
- 📋 快捷命令复制 — Resume / Fork 命令一键复制
- 🌗 暗色 / 亮色主题 — 跟随系统或手动切换
- 📚 提示词库 — 保存、管理常用提示词,支持一键复制
- 🔒 纯本地运行 — 数据不离开你的电脑
🖥️ 支持平台
| 平台 |
恢复命令 |
分支命令 |
数据路径 |
| Claude Code |
claude --resume <id> |
claude --resume <id> --fork-session |
~/.claude |
| Codex CLI |
codex resume <id> |
— |
~/.codex |
| OpenCode |
opencode -s <id> |
opencode -s <id> --fork |
~/.local/share/opencode/opencode.db |
📦 安装方式
桌面应用(推荐)
下载对应平台的最新版本:
| 平台 |
格式 |
说明 |
| Windows |
.exe 安装包 / .zip 便携版 |
NSIS 安装包或解压即用 |
| macOS |
.dmg |
拖入 Applications 即可 |
| Linux |
.AppImage / .deb |
AppImage 免安装,双击运行 |
前往 Releases 页面下载。
从源码运行
前置要求
方式一:一键启动(Windows)
双击 start.bat,自动完成: