Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ integrations/hermes/__pycache__/
eval/reports/
# LongMemEval download is 278MB; fetched on demand
eval/data/longmemeval/

# USB portable kit runtime (scripts/config are tracked)
agentmemory-portable/portable/
agentmemory-portable/downloads/
agentmemory-portable/home/
agentmemory-portable/data/*
!agentmemory-portable/data/README.txt
agentmemory-portable/repo/
11 changes: 11 additions & 0 deletions agentmemory-portable/.gitignore
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
95 changes: 95 additions & 0 deletions agentmemory-portable/README.md
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`.
60 changes: 60 additions & 0 deletions agentmemory-portable/iii-config.yaml
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






6 changes: 6 additions & 0 deletions agentmemory-portable/kit.config.ps1
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"
11 changes: 11 additions & 0 deletions agentmemory-portable/mcp-cursor.example.json
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"
}
Comment on lines +3 to +8

Copy link
Copy Markdown
Contributor

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.cmd instead of npx for 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. Since mcp-launch.cmd is 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"agentmemory": {
"command": "npx",
"args": ["-y", "@agentmemory/mcp"],
"env": {
"AGENTMEMORY_URL": "http://127.0.0.1:3111"
}
"agentmemory": {
"command": "<DRIVE>:\\path\\to\\agentmemory-portable\\mcp-launch.cmd",
"args": [],
"env": {
"AGENTMEMORY_URL": "http://127.0.0.1:3111"
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agentmemory-portable/mcp-cursor.example.json` around lines 3 - 8, Update the
agentmemory MCP configuration to invoke the bundled mcp-launch.cmd through the
command/args fields instead of npx and the npm package, preserving the existing
AGENTMEMORY_URL environment setting. Also update the related README usage
example to show the same portable launcher.

}
}
}
29 changes: 29 additions & 0 deletions agentmemory-portable/mcp-launch.cmd
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 "%KIT%\repo\..." for locating the source. According to the README.md and _env.ps1, the kit supports an "in-tree" layout where the code is located at the parent directory ("%KIT%\.."), not in a nested repo folder. This hardcoded path will cause mcp-launch.cmd to fail in the default in-tree setup because it will not find any of the target files.

Detect the repo directory or default to the parent directory to ensure compatibility with both layouts.

🐛 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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%
)
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 "%REPO%\dist\cli.mjs" (
"%KIT%\portable\node\node.exe" "%REPO%\dist\cli.mjs" mcp
exit /b %ERRORLEVEL%
)
if exist "%REPO%\packages\mcp\bin.mjs" (
"%KIT%\portable\node\node.exe" "%REPO%\packages\mcp\bin.mjs"
exit /b %ERRORLEVEL%
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agentmemory-portable/mcp-launch.cmd` around lines 13 - 26, Update the
source-root resolution in mcp-launch.cmd to support both layouts: use
"%KIT%\repo" when that directory exists, otherwise default to "%KIT%\..". Apply
the resolved root consistently when checking and launching standalone.mjs,
cli.mjs, and packages\mcp\bin.mjs.


echo [agentmemory-portable] MCP entry non trovata. Esegui setup.cmd / update.cmd 1>&2
exit /b 1
Loading