{"_id":"@arwiesner/agent-mem","_rev":"2-5aedf89bf3fe603ec0afca102253ff6d","name":"@arwiesner/agent-mem","dist-tags":{"latest":"2.11.5"},"versions":{"2.11.4":{"name":"@arwiesner/agent-mem","version":"2.11.4","keywords":["agent-mem","opencode","plugin","memory","vector-database","ai","coding-agent","local","standalone"],"author":{"name":"Alex Wiesner"},"license":"MIT","_id":"@arwiesner/agent-mem@2.11.4","maintainers":[{"name":"arwiesner","email":"misc@wiesner.com.br"}],"homepage":"https://github.com/Alex-Wiesner/agent-mem#readme","bugs":{"url":"https://github.com/Alex-Wiesner/agent-mem/issues"},"bin":{"agent-mem":"dist/cli/index.js"},"dist":{"shasum":"9ff06e92490fa480b2bd99139b7e4f06c4e40f26","tarball":"https://registry.npmjs.org/@arwiesner/agent-mem/-/agent-mem-2.11.4.tgz","fileCount":180,"integrity":"sha512-W/2gUJ1qttsloW60naBwyiAfIKSDW+CHRDlh7xl5CCBsARHKzvJJCC9J0oBZig6Zr54C/D6KOYzTHkP3R1LAvA==","signatures":[{"sig":"MEUCIFEkp+V7z2JrjDK2eW5sIfG/fhHfhs3FD4360jjjZd2gAiEArt4jIdxyVAU15l6NByCHdjnzK21iD+76hruZZneSZnA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":667529},"main":"dist/plugin.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/plugin.js"},"./cli":{"types":"./dist/cli/index.d.ts","default":"./dist/cli/index.js"},"./hub":{"types":"./dist/hub/index.d.ts","default":"./dist/hub/index.js"},"./core":{"types":"./dist/core/index.d.ts","default":"./dist/core/index.js"},"./adapters/opencode":{"types":"./dist/adapters/opencode/plugin.d.ts","default":"./dist/adapters/opencode/plugin.js"}},"gitHead":"96706cd30a860d666158d38715b46566685c2840","scripts":{"dev":"tsc --watch","build":"bunx tsc && mkdir -p dist/web && cp -r src/web/* dist/web/","format":"prettier --write \"src/**/*.{ts,js,css,html}\"","server":"bun dist/server.js","prepare":"husky","typecheck":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,js,css,html}\""},"_npmUser":{"name":"arwiesner","email":"misc@wiesner.com.br"},"opencode":{"type":"plugin","hooks":["chat.message","event"]},"repository":{"url":"git+https://github.com/Alex-Wiesner/agent-mem.git","type":"git"},"_npmVersion":"11.10.0","description":"Agent memory system with persistent storage and local vector search","directories":{},"lint-staged":{"*.{ts,tsx,js,jsx,css,html,json,md}":["prettier --write"]},"_nodeVersion":"25.6.1","dependencies":{"franc-min":"^6.2.0","iso-639-3":"^3.0.1","hnswlib-node":"^3.0.0","@opencode-ai/plugin":"^1.0.162","@xenova/transformers":"^2.17.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","prettier":"^3.4.2","@types/bun":"^1.3.8","typescript":"^5.7.3","lint-staged":"^16.2.7"},"_npmOperationalInternal":{"tmp":"tmp/agent-mem_2.11.4_1771886964928_0.9328448600064243","host":"s3://npm-registry-packages-npm-production"}},"2.11.5":{"name":"@arwiesner/agent-mem","version":"2.11.5","description":"Agent memory system with persistent storage and local vector search","type":"module","main":"dist/plugin.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/plugin.js"},"./core":{"types":"./dist/core/index.d.ts","default":"./dist/core/index.js"},"./hub":{"types":"./dist/hub/index.d.ts","default":"./dist/hub/index.js"},"./adapters/opencode":{"types":"./dist/adapters/opencode/plugin.d.ts","default":"./dist/adapters/opencode/plugin.js"},"./cli":{"types":"./dist/cli/index.d.ts","default":"./dist/cli/index.js"}},"bin":{"agent-mem":"dist/cli/index.js"},"scripts":{"build":"bunx tsc && mkdir -p dist/web && cp -r src/web/* dist/web/","dev":"tsc --watch","server":"bun dist/server.js","typecheck":"tsc --noEmit","format":"prettier --write \"src/**/*.{ts,js,css,html}\"","format:check":"prettier --check \"src/**/*.{ts,js,css,html}\"","prepare":"husky"},"keywords":["agent-mem","opencode","plugin","memory","vector-database","ai","coding-agent","local","standalone"],"author":{"name":"Alex Wiesner"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Alex-Wiesner/agent-mem.git"},"publishConfig":{"access":"public"},"dependencies":{"@opencode-ai/plugin":"^1.0.162","@xenova/transformers":"^2.17.2","franc-min":"^6.2.0","hnswlib-node":"^3.0.0","iso-639-3":"^3.0.1"},"devDependencies":{"@types/bun":"^1.3.8","husky":"^9.1.7","lint-staged":"^16.2.7","prettier":"^3.4.2","typescript":"^5.7.3"},"opencode":{"type":"plugin","hooks":["chat.message","event"]},"lint-staged":{"*.{ts,tsx,js,jsx,css,html,json,md}":["prettier --write"]},"gitHead":"96706cd30a860d666158d38715b46566685c2840","_id":"@arwiesner/agent-mem@2.11.5","bugs":{"url":"https://github.com/Alex-Wiesner/agent-mem/issues"},"homepage":"https://github.com/Alex-Wiesner/agent-mem#readme","_nodeVersion":"25.6.1","_npmVersion":"11.10.0","dist":{"integrity":"sha512-ETo+5h8xngkmpeZKu4v2hWYqk770VSjdFC7lzb3PefaF6tI8qHDDwGHt0qmE+781g8BoYRzO5TVpuRlx6XoenQ==","shasum":"86cdaad78bc1440d446d493311b71887b8bc20bc","tarball":"https://registry.npmjs.org/@arwiesner/agent-mem/-/agent-mem-2.11.5.tgz","fileCount":180,"unpackedSize":667529,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAIqyyUud0neN6tpu61nDM7J24KdEZhqSAPMurMQGCu7AiBisymyFzydHHpaFnoGIiaoyrgDcFFMrGVM7sFnMLcCxw=="}]},"_npmUser":{"name":"arwiesner","email":"misc@wiesner.com.br"},"directories":{},"maintainers":[{"name":"arwiesner","email":"misc@wiesner.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-mem_2.11.5_1771887251557_0.9702276782342163"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-23T22:49:24.833Z","modified":"2026-02-23T22:54:11.949Z","2.11.4":"2026-02-23T22:49:25.105Z","2.11.5":"2026-02-23T22:54:11.821Z"},"bugs":{"url":"https://github.com/Alex-Wiesner/agent-mem/issues"},"author":{"name":"Alex Wiesner"},"license":"MIT","homepage":"https://github.com/Alex-Wiesner/agent-mem#readme","keywords":["agent-mem","opencode","plugin","memory","vector-database","ai","coding-agent","local","standalone"],"repository":{"type":"git","url":"git+https://github.com/Alex-Wiesner/agent-mem.git"},"description":"Agent memory system with persistent storage and local vector search","maintainers":[{"name":"arwiesner","email":"misc@wiesner.com.br"}],"readme":"# Agent Memory\n\n[![GitHub last commit](https://img.shields.io/github/last-commit/Alex-Wiesner/agent-mem)](https://github.com/Alex-Wiesner/agent-mem)\n[![GitHub stars](https://img.shields.io/github/stars/Alex-Wiesner/agent-mem)](https://github.com/Alex-Wiesner/agent-mem)\n[![License](https://img.shields.io/github/license/Alex-Wiesner/agent-mem)](https://github.com/Alex-Wiesner/agent-mem/blob/main/LICENSE)\n\n![Agent Memory Banner](.github/banner.png)\n\nA standalone memory platform for AI coding agents with a hub server, OpenCode adapter plugin, and CLI for sysadmin workflows.\n\n## Visual Overview\n\n**Project Memory Timeline:**\n\n![Project Memory Timeline](.github/screenshot-project-memory.png)\n\n**User Profile Viewer:**\n\n![User Profile Viewer](.github/screenshot-user-profile.png)\n\n## Core Features\n\nLocal vector database with SQLite + HNSW (hnswlib-wasm), persistent project memories, automatic user profile learning, unified memory-prompt timeline, full-featured web UI, intelligent prompt-based memory extraction, multi-provider AI support (OpenAI, Anthropic), 12+ local embedding models, smart deduplication, and built-in privacy protection.\n\n## Prerequisites\n\nThis plugin uses `hnswlib-node` for fast vector similarity search, which requires native compilation. Ensure you have:\n\n**All platforms:**\n\n- Python 3.x\n- A C++ compiler (gcc, clang, or MSVC)\n- `make` or CMake\n\n**Platform-specific setup:**\n\n| Platform    | Requirements                                                                                                              |\n| ----------- | ------------------------------------------------------------------------------------------------------------------------- |\n| **macOS**   | Xcode Command Line Tools: `xcode-select --install`                                                                        |\n| **Linux**   | Build essentials: `sudo apt install build-essential python3` (Debian/Ubuntu) or `sudo pacman -S base-devel python` (Arch) |\n| **Windows** | Visual Studio Build Tools with C++ workload, or Windows Build Tools: `npm install -g windows-build-tools`                 |\n\n## Getting Started\n\n### OpenCode Adapter (Plugin)\n\nAdd to your OpenCode configuration at `~/.config/opencode/opencode.json`:\n\n```jsonc\n{\n  \"plugin\": [\"@arwiesner/agent-mem\"],\n}\n```\n\nThe plugin downloads automatically on next startup.\n\nFor legacy installs, `@arwiesner/opencode-mem` and `~/.config/opencode/opencode-mem.jsonc` remain supported.\n\n### Usage Examples (OpenCode tool)\n\n```typescript\nmemory({ mode: \"add\", content: \"Project uses microservices architecture\" });\nmemory({ mode: \"search\", query: \"architecture decisions\" });\nmemory({ mode: \"profile\" });\nmemory({ mode: \"list\", limit: 10 });\n```\n\nAccess the web interface at `http://127.0.0.1:4747` for visual memory browsing and management.\n\n### Standalone CLI\n\nThe CLI supports local or remote (hub) operation:\n\n```bash\n# Local (uses local config + storage)\nagent-mem status\nagent-mem list --limit 5\nagent-mem search \"vector search\"\nagent-mem add \"Store architecture notes\" --tags \"architecture,search\"\nagent-mem forget mem_123\nagent-mem profile\n\n# Remote (hub)\nagent-mem status --server http://127.0.0.1:4747 --token <token>\nagent-mem search \"sqlite\" --server http://127.0.0.1:4747 --token <token>\n```\n\n### Hub Server\n\nRun the hub with the existing server entrypoint:\n\n```bash\nbun run build\nbun run server\n```\n\n## Configuration Essentials\n\nConfigure at `~/.config/agent-mem/agent-mem.jsonc` (legacy `~/.config/opencode/opencode-mem.jsonc` still supported):\n\n```jsonc\n{\n  \"storagePath\": \"~/.agent-mem/data\",\n  \"userEmailOverride\": \"user@example.com\",\n  \"userNameOverride\": \"John Doe\",\n  \"embeddingModel\": \"Xenova/nomic-embed-text-v1\",\n  \"webServerEnabled\": true,\n  \"webServerPort\": 4747,\n\n  \"autoCaptureEnabled\": true,\n  \"autoCaptureLanguage\": \"auto\",\n  \"memoryProvider\": \"openai-chat\",\n  \"memoryModel\": \"gpt-4o-mini\",\n  \"memoryApiUrl\": \"https://api.openai.com/v1\",\n  \"memoryApiKey\": \"sk-...\",\n  \"memoryTemperature\": 0.3,\n\n  \"showAutoCaptureToasts\": true,\n  \"showUserProfileToasts\": true,\n  \"showErrorToasts\": true,\n\n  \"syncEnabled\": false,\n  \"syncMode\": \"server\",\n  \"syncServerUrl\": \"http://127.0.0.1:4747\",\n  \"syncToken\": \"\",\n  \"syncIntervalMs\": 60000,\n  \"syncBatchSize\": 500,\n  \"syncSkewMs\": 10000,\n\n  \"userProfileAnalysisInterval\": 10,\n  \"maxMemories\": 10,\n\n  \"compaction\": {\n    \"enabled\": true,\n    \"memoryLimit\": 10,\n  },\n  \"chatMessage\": {\n    \"enabled\": true,\n    \"maxMemories\": 3,\n    \"excludeCurrentSession\": true,\n    \"maxAgeDays\": undefined,\n    \"injectOn\": \"first\",\n  },\n}\n```\n\n**API Key Formats:**\n\n```jsonc\n\"memoryApiKey\": \"sk-...\"\n\"memoryApiKey\": \"file://~/.config/agent-mem/api-key.txt\"\n\"memoryApiKey\": \"env://OPENAI_API_KEY\"\n```\n\nFull documentation available in this README.\n\n## Hub Sync (Docker)\n\nRun the hub server in Docker using `docker-compose.yml`:\n\n```yaml\nservices:\n  agent-mem-hub:\n    build: .\n    ports:\n      - \"4747:4747\"\n    volumes:\n      - ~/.agent-mem:/data\n      - ~/.config/agent-mem/agent-mem.jsonc:/home/bun/.config/agent-mem/agent-mem.jsonc:ro\n    healthcheck:\n      test: [\"CMD\", \"wget\", \"-qO-\", \"http://localhost:4747/api/sync/status\"]\n      interval: 30s\n      timeout: 10s\n      retries: 3\n    restart: unless-stopped\n```\n\nSet these values in `~/.config/agent-mem/agent-mem.jsonc` for the hub:\n\n```jsonc\n{\n  \"storagePath\": \"/data\",\n  \"webServerHost\": \"0.0.0.0\",\n  \"webServerPort\": 4747,\n  \"syncEnabled\": true,\n  \"syncMode\": \"server\",\n  \"syncToken\": \"<shared-token>\",\n}\n```\n\nClients should use:\n\n```jsonc\n{\n  \"syncEnabled\": true,\n  \"syncMode\": \"client\",\n  \"syncServerUrl\": \"http://<hub-ip>:4747\",\n  \"syncToken\": \"<shared-token>\",\n}\n```\n\nSecurity note: token auth is required. If exposing beyond LAN, put the hub behind a reverse proxy with TLS.\n\n### Sync troubleshooting\n\nCommon checks:\n\n- **401 Unauthorized**: confirm `syncToken` matches on hub + client and is resolved correctly.\n- **No changes syncing**: confirm `syncEnabled: true`, `syncMode` matches hub/client roles, and the client can reach `syncServerUrl`.\n- **Clock skew**: if clients are far off in time, increase `syncSkewMs` temporarily.\n- **Docker health**: `docker compose ps` should show the hub as healthy; the healthcheck calls `/api/sync/status`.\n\nToken guidance:\n\n- Generate a long random token (e.g., `openssl rand -hex 32`).\n- Store it using `env://` or `file://` to avoid committing secrets.\n\n## Development & Contribution\n\nBuild and test locally:\n\n```bash\nbun install\nbun run build\nbun run typecheck\nbun run format\n```\n\nThis project is actively seeking contributions to become the definitive memory plugin for AI coding agents. Whether you are fixing bugs, adding features, improving documentation, or expanding embedding model support, your contributions are critical. The codebase is well-structured and ready for enhancement. If you hit a blocker or have improvement ideas, submit a pull request - we review and merge contributions quickly.\n\n## License & Links\n\nMIT License - see LICENSE file\n\n- **Repository**: https://github.com/Alex-Wiesner/agent-mem\n- **Issues**: https://github.com/Alex-Wiesner/agent-mem/issues\n- **OpenCode Platform**: https://opencode.ai\n\nInspired by [opencode-supermemory](https://github.com/supermemoryai/opencode-supermemory)\n","readmeFilename":"README.md"}