-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Project: add Windows USB portable kit for in-tree deployment #1088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Runtime (do not push) | ||
| portable/node/ | ||
| portable/npm-cache/ | ||
| portable/iii.exe | ||
| downloads/ | ||
| data/* | ||
| !data/README.txt | ||
| home/ | ||
| repo/ | ||
|
|
||
| *.log |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # agentmemory-portable — kit USB (vive dentro il repo agentmemory) | ||
|
|
||
| Avvia agentmemory da pen drive / cartella locale **senza patchare** i sorgenti | ||
| upstream. Questa cartella fa parte del progetto e si puo pushare su git. | ||
|
|
||
| ## Posizione | ||
|
|
||
| ``` | ||
| agentmemory/ | ||
| agentmemory-portable/ <-- questo kit | ||
| src/ ... | ||
| package.json | ||
| ``` | ||
|
|
||
| In layout **in-tree** (default qui) il codice e la cartella padre del kit: | ||
| non serve un secondo clone in `repo\`. | ||
|
|
||
| ## Layout | ||
|
|
||
| ``` | ||
| agentmemory-portable\ | ||
| setup.cmd / start.cmd / start-clean.cmd / stop.cmd / status.cmd / update.cmd | ||
| mcp-launch.cmd | ||
| mcp-cursor.example.json | ||
| kit.config.ps1 | ||
| iii-config.yaml # SQLite -> .\data (cwd = kit root) | ||
| data\ # state_store.db + stream_store (DATI) | ||
| scripts\ | ||
| portable\node\ # Node portatile (non in git) | ||
| portable\iii.exe # backup (non in git) | ||
| home\.agentmemory\ # .env, pid, preferences (runtime, non in git) | ||
| home\cache\ | ||
| downloads\ # zip temporanei (non in git) | ||
| ``` | ||
|
|
||
| ## Prerequisiti | ||
|
|
||
| - Windows 10/11 x64 | ||
| - `git` sul PATH (setup/update) | ||
| - Porte libere: **3111**, **3112**, **3113**, **49134** | ||
| - USB 3.x consigliata se usi una pen drive | ||
|
|
||
| ## Prima installazione | ||
|
|
||
| 1. Dal clone del progetto: entra in `agentmemory-portable\` | ||
| 2. Doppio-click **`setup.cmd`** (serve rete: Node + iii.exe + npm install/build) | ||
| 3. Avvia con **`start.cmd`** | ||
|
|
||
| Su pen drive: copia l'intero repo `agentmemory` (o almeno questa cartella + build), | ||
| poi `setup.cmd` / `start.cmd`. | ||
|
|
||
| ## Uso quotidiano | ||
|
|
||
| | Comando | Effetto | | ||
| |--------|---------| | ||
| | `start.cmd` | Remappa home su `home\`, avvia daemon (dati in `data\`). Se trova Docker chiede A/B/C | | ||
| | `start-clean.cmd` | Opzione C automatica: ferma Docker agentmemory, ripulisce pid, avvia USB | | ||
| | `stop.cmd` | Ferma worker + iii-engine | | ||
| | `status.cmd` | `agentmemory status` | | ||
| | `update.cmd` | `git pull` sul repo padre + `npm install` + build | | ||
|
|
||
| ## Dati sulla pen drive / kit | ||
|
|
||
| | Dato | Dove | | ||
| |------|------| | ||
| | SQLite + stream | `agentmemory-portable\data\` | | ||
| | Config / pid / snapshot / export | `home\.agentmemory\` | | ||
| | Cache embedding | `home\cache\` | | ||
| | Codice | repo padre (`..`) | | ||
|
|
||
| ## Docker in conflitto | ||
|
|
||
| `start.cmd` offre: | ||
| - **A** istruzioni manuali | ||
| - **B** resta su Docker | ||
| - **C** pulizia auto (stop container, no delete volumi) + avvio kit | ||
|
|
||
| ## MCP Cursor | ||
|
|
||
| Vedi `mcp-cursor.example.json`. Con daemon avviato: | ||
|
|
||
| ```json | ||
| "agentmemory": { | ||
| "command": "npx", | ||
| "args": ["-y", "@agentmemory/mcp"], | ||
| "env": { "AGENTMEMORY_URL": "http://127.0.0.1:3111" } | ||
| } | ||
| ``` | ||
|
|
||
| ## Cosa viene committato | ||
|
|
||
| Si pushano script, `iii-config.yaml`, `*.cmd`, README, esempi MCP. | ||
|
|
||
| **Non** finiscono in git (vedi `.gitignore`): `portable/node`, `downloads`, | ||
| `data/*`, `home/**` runtime, `.env`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Portable kit iii-config: SQLite lives in this kit's ./data (cwd = kit root). | ||
| # Do not edit the upstream repo iii-config.yaml — this file is owned by the kit. | ||
| workers: | ||
| - name: iii-http | ||
| config: | ||
| port: 3111 | ||
| host: 127.0.0.1 | ||
| default_timeout: 180000 | ||
| cors: | ||
| allowed_origins: ["http://localhost:3111", "http://localhost:3113", "http://127.0.0.1:3111", "http://127.0.0.1:3113"] | ||
| allowed_methods: [GET, POST, PUT, DELETE, OPTIONS] | ||
| - name: iii-state | ||
| config: | ||
| adapter: | ||
| name: kv | ||
| config: | ||
| store_method: file_based | ||
| file_path: ./data/state_store.db | ||
| - name: iii-queue | ||
| config: | ||
| adapter: | ||
| name: builtin | ||
| - name: iii-pubsub | ||
| config: | ||
| adapter: | ||
| name: local | ||
| - name: iii-cron | ||
| config: | ||
| adapter: | ||
| name: kv | ||
| - name: iii-stream | ||
| config: | ||
| port: 3112 | ||
| host: 127.0.0.1 | ||
| adapter: | ||
| name: kv | ||
| config: | ||
| store_method: file_based | ||
| file_path: ./data/stream_store | ||
| - name: iii-observability | ||
| config: | ||
| enabled: true | ||
| service_name: agentmemory | ||
| exporter: memory | ||
| sampling_ratio: 0.1 | ||
| metrics_enabled: true | ||
| logs_enabled: true | ||
| logs_console_output: false | ||
| - name: iii-exec | ||
| config: | ||
| watch: | ||
| - ../src/**/*.ts | ||
| exec: | ||
| - node ../dist/index.mjs | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Optional overrides for the portable kit. | ||
| # Copy values as needed; unset variables keep the defaults from scripts\_env.ps1. | ||
|
|
||
| # $RepoUrl = "https://github.com/rohitg00/agentmemory.git" | ||
| # $IiiVersion = "0.11.2" | ||
| # $NodeVersion = "22.16.0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "mcpServers": { | ||
| "agentmemory": { | ||
| "command": "npx", | ||
| "args": ["-y", "@agentmemory/mcp"], | ||
| "env": { | ||
| "AGENTMEMORY_URL": "http://127.0.0.1:3111" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Launcher MCP stdio che usa Node portatile + shim del clone (senza npx sul host). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # In Cursor mcp.json punta a questo .cmd con path assoluto aggiornato alla lettera unita. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @echo off | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setlocal | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd /d "%~dp0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set "KIT=%~dp0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set "KIT=%KIT:~0,-1%" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set "PATH=%KIT%\portable\node;%PATH%" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set "AGENTMEMORY_URL=http://127.0.0.1:3111" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set "USERPROFILE=%KIT%\home" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set "HOME=%KIT%\home" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if exist "%KIT%\repo\dist\standalone.mjs" ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "%KIT%\portable\node\node.exe" "%KIT%\repo\dist\standalone.mjs" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit /b %ERRORLEVEL% | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if exist "%KIT%\repo\dist\cli.mjs" ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "%KIT%\portable\node\node.exe" "%KIT%\repo\dist\cli.mjs" mcp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit /b %ERRORLEVEL% | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if exist "%KIT%\repo\packages\mcp\bin.mjs" ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "%KIT%\portable\node\node.exe" "%KIT%\repo\packages\mcp\bin.mjs" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit /b %ERRORLEVEL% | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win Fix missing support for the default "in-tree" layout. The script hardcodes Detect the 🐛 Proposed fix-if exist "%KIT%\repo\dist\standalone.mjs" (
- "%KIT%\portable\node\node.exe" "%KIT%\repo\dist\standalone.mjs"
+set "REPO=%KIT%\repo"
+if not exist "%REPO%" (
+ set "REPO=%KIT%\.."
+)
+
+if exist "%REPO%\dist\standalone.mjs" (
+ "%KIT%\portable\node\node.exe" "%REPO%\dist\standalone.mjs"
exit /b %ERRORLEVEL%
)
-if exist "%KIT%\repo\dist\cli.mjs" (
- "%KIT%\portable\node\node.exe" "%KIT%\repo\dist\cli.mjs" mcp
+if exist "%REPO%\dist\cli.mjs" (
+ "%KIT%\portable\node\node.exe" "%REPO%\dist\cli.mjs" mcp
exit /b %ERRORLEVEL%
)
-if exist "%KIT%\repo\packages\mcp\bin.mjs" (
- "%KIT%\portable\node\node.exe" "%KIT%\repo\packages\mcp\bin.mjs"
+if exist "%REPO%\packages\mcp\bin.mjs" (
+ "%KIT%\portable\node\node.exe" "%REPO%\packages\mcp\bin.mjs"
exit /b %ERRORLEVEL%
)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo [agentmemory-portable] MCP entry non trovata. Esegui setup.cmd / update.cmd 1>&2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit /b 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Use
mcp-launch.cmdinstead ofnpxfor the portable MCP server.The current example uses
npx, which relies on the host having Node.js installed globally and downloads the package from npm. This defeats the purpose of a portable kit. Sincemcp-launch.cmdis provided to run the MCP server using the bundled portable Node and local repository, the example should instruct users to invoke it instead.💡 Proposed fix
"agentmemory": { - "command": "npx", - "args": ["-y", "`@agentmemory/mcp`"], + "command": "<DRIVE>:\\path\\to\\agentmemory-portable\\mcp-launch.cmd", + "args": [], "env": {(You may also want to update the README.md line 84 to reflect this change).
📝 Committable suggestion
🤖 Prompt for AI Agents