本地开发与打包
一键启动
三步即可跑起来:
git clone https://github.com/MemTensor/memmy-agent.git && cd memmy-agent
cp .env.example .env # 已预填云服务地址,开箱即用
bash scripts/dev-start.sh # 装依赖 → 构建 → 起全套服务scripts/dev-start.sh 会安装依赖,构建 memmy-agent 和 Memory CLI,并把 memmy / memmy-memory 链到 ~/.local/bin。它直接拉起的是 Agent API、前端和 Electron。Memory 与 Gateway 由 Electron 管理。Agent API 会等到账号或 BYOK 的模型配置写好后再启动。
.env中MEMMY_CLOUD_SERVICE默认指向https://api.memmy.cn(只填写域名,不要追加/api,客户端会自动拼接接口路径),复制即连官方云服务——无需自建后端、无需自备 API Key。Windows 请在 Git Bash 中运行;脚本会把~/.local/bin加入 PATH。
环境要求
本地开发使用 Node.js 22 或更高版本,加上 npm。App/memmy-agent 的 engines 要求 >=22。根目录 package.json 的 engines 仍写着 >=20,本地开发以 22 为准。
Linux CLI 安装器另有门槛:只接受 Node.js 22.23.4 及以上的 22.x、24.22.1 及以上的 24.x,或 26.12.1 及以上的 26.x。其他主版本会被拒绝。这个检查只在 scripts/install.sh 里,不改变上面的本地开发要求。
根目录 workspace 包括 Migrations、AgentSourceCore、Knowledge、Memory、App/backend/local-api-contracts、App/backend、App/frontend/*、App/shell/desktop/interface、App/shell/*。
常用命令
npm install # 根目录安装依赖
npm run dev:desktop # 同时启动桌面前端 Vite 和 Electron 壳
npm run build # 构建 Memory 和所有 workspace
npm run lint
npm run typecheck
npm run test
npm run db:migrate # 后端数据库迁移
npm run package:mac # 打包 macOS DMG
npm run package:win:x64Memory 单独开发
npm run memory:serve:dev -- \
--host 127.0.0.1 \
--port 18960 \
--db ~/.memmy/memory-service/memory.sqlite \
--config ~/.memmy/config.yamlmemmy-agent 源码态
cd App/memmy-agent
npm install && npm run build
node dist/main.js onboard
node dist/main.js agent --message "你好,介绍一下当前工作区"
node dist/main.js serve
Memmy