@agentmemory/agentmemory 0.9.28 → 0.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +98 -28
- package/AGENTS.md +19 -26
- package/README.md +619 -274
- package/dist/.env.example +98 -28
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +1328 -244
- package/dist/cli.mjs.map +1 -1
- package/dist/{connect-JnsJXc68.mjs → connect-B4_ca6BD.mjs} +619 -70
- package/dist/connect-B4_ca6BD.mjs.map +1 -0
- package/dist/docker-compose.yml +42 -16
- package/dist/hooks/_capture.d.mts +22 -0
- package/dist/hooks/_capture.d.mts.map +1 -0
- package/dist/hooks/_capture.mjs +908 -0
- package/dist/hooks/_capture.mjs.map +1 -0
- package/dist/hooks/antigravity-bridge.d.mts +8 -0
- package/dist/hooks/antigravity-bridge.d.mts.map +1 -0
- package/dist/hooks/antigravity-bridge.mjs +123 -0
- package/dist/hooks/antigravity-bridge.mjs.map +1 -0
- package/dist/hooks/notification.mjs +34 -27
- package/dist/hooks/notification.mjs.map +1 -1
- package/dist/hooks/post-commit.mjs +84 -2
- package/dist/hooks/post-commit.mjs.map +1 -1
- package/dist/hooks/post-tool-failure.mjs +71 -26
- package/dist/hooks/post-tool-failure.mjs.map +1 -1
- package/dist/hooks/post-tool-use.mjs +99 -36
- package/dist/hooks/post-tool-use.mjs.map +1 -1
- package/dist/hooks/pre-compact.mjs +95 -5
- package/dist/hooks/pre-compact.mjs.map +1 -1
- package/dist/hooks/pre-tool-use.mjs +72 -2
- package/dist/hooks/pre-tool-use.mjs.map +1 -1
- package/dist/hooks/prompt-submit.mjs +25 -22
- package/dist/hooks/prompt-submit.mjs.map +1 -1
- package/dist/hooks/session-end.mjs +93 -24
- package/dist/hooks/session-end.mjs.map +1 -1
- package/dist/hooks/session-start.mjs +101 -6
- package/dist/hooks/session-start.mjs.map +1 -1
- package/dist/hooks/stop.mjs +72 -8
- package/dist/hooks/stop.mjs.map +1 -1
- package/dist/hooks/subagent-start.mjs +28 -26
- package/dist/hooks/subagent-start.mjs.map +1 -1
- package/dist/hooks/subagent-stop.mjs +29 -26
- package/dist/hooks/subagent-stop.mjs.map +1 -1
- package/dist/hooks/task-completed.mjs +31 -28
- package/dist/hooks/task-completed.mjs.map +1 -1
- package/dist/iii-config.docker.yaml +10 -10
- package/dist/iii-config.yaml +3 -1
- package/dist/{image-refs-BKLmp_sD.mjs → image-refs-BaT-9oMU.mjs} +2 -2
- package/dist/image-refs-BaT-9oMU.mjs.map +1 -0
- package/dist/{image-refs-C2YU7BIm.mjs → image-refs-T_urbwHM.mjs} +3 -3
- package/dist/image-refs-T_urbwHM.mjs.map +1 -0
- package/dist/{keyed-mutex-DTHtcZrt.mjs → image-store-BsN4vyjr.mjs} +2 -14
- package/dist/image-store-BsN4vyjr.mjs.map +1 -0
- package/dist/index.mjs +14021 -6494
- package/dist/index.mjs.map +1 -1
- package/dist/keyed-mutex-DchXsyfP.mjs +221 -0
- package/dist/keyed-mutex-DchXsyfP.mjs.map +1 -0
- package/dist/secret-store-BnY3A50C.mjs +2348 -0
- package/dist/secret-store-BnY3A50C.mjs.map +1 -0
- package/dist/{src-CzgoepGU.mjs → src-Jsq9LCeH.mjs} +7349 -2940
- package/dist/src-Jsq9LCeH.mjs.map +1 -0
- package/dist/{standalone-YsZFFQBM.mjs → standalone-DKCdrf1d.mjs} +62 -24
- package/dist/standalone-DKCdrf1d.mjs.map +1 -0
- package/dist/standalone.d.mts.map +1 -1
- package/dist/standalone.mjs +298 -27
- package/dist/standalone.mjs.map +1 -1
- package/dist/status-IRz7ta8-.mjs +2344 -0
- package/dist/status-IRz7ta8-.mjs.map +1 -0
- package/dist/viewer/favicon.svg +35 -1
- package/dist/viewer/index.html +7428 -2608
- package/docker-compose.yml +42 -16
- package/iii-config.docker.yaml +10 -10
- package/iii-config.yaml +3 -1
- package/integrations/pi/README.md +77 -0
- package/integrations/pi/index.ts +402 -0
- package/integrations/pi/package.json +32 -0
- package/integrations/pi/security.ts +87 -0
- package/package.json +15 -7
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/.codex-plugin/plugin.json +26 -4
- package/plugin/.devin-plugin/plugin.json +32 -0
- package/plugin/.mcp.codex.json +12 -0
- package/plugin/.mcp.copilot.json +2 -7
- package/plugin/.mcp.json +2 -7
- package/plugin/assets/icon.svg +35 -0
- package/plugin/cursor/hooks.json +41 -0
- package/plugin/cursor/mcp.json +12 -0
- package/plugin/hooks/hooks.antigravity.json +43 -0
- package/plugin/hooks/hooks.copilot.json +11 -11
- package/plugin/hooks/hooks.devin.json +67 -0
- package/plugin/hooks/hooks.droid.json +55 -0
- package/plugin/opencode/README.md +267 -31
- package/plugin/opencode/agentmemory-capture.ts +644 -15
- package/plugin/opencode/plugin.json +1 -1
- package/plugin/plugin.json +2 -2
- package/plugin/scripts/_capture.d.mts +22 -0
- package/plugin/scripts/_capture.d.mts.map +1 -0
- package/plugin/scripts/_capture.mjs +908 -0
- package/plugin/scripts/_capture.mjs.map +1 -0
- package/plugin/scripts/antigravity-bridge.d.mts +8 -0
- package/plugin/scripts/antigravity-bridge.d.mts.map +1 -0
- package/plugin/scripts/antigravity-bridge.mjs +123 -0
- package/plugin/scripts/antigravity-bridge.mjs.map +1 -0
- package/plugin/scripts/notification.mjs +34 -27
- package/plugin/scripts/notification.mjs.map +1 -1
- package/plugin/scripts/plugin-bridge.mjs +378 -0
- package/plugin/scripts/post-commit.mjs +84 -2
- package/plugin/scripts/post-commit.mjs.map +1 -1
- package/plugin/scripts/post-tool-failure.mjs +71 -26
- package/plugin/scripts/post-tool-failure.mjs.map +1 -1
- package/plugin/scripts/post-tool-use.mjs +99 -36
- package/plugin/scripts/post-tool-use.mjs.map +1 -1
- package/plugin/scripts/pre-compact.mjs +95 -5
- package/plugin/scripts/pre-compact.mjs.map +1 -1
- package/plugin/scripts/pre-tool-use.mjs +72 -2
- package/plugin/scripts/pre-tool-use.mjs.map +1 -1
- package/plugin/scripts/prompt-submit.mjs +25 -22
- package/plugin/scripts/prompt-submit.mjs.map +1 -1
- package/plugin/scripts/session-end.mjs +93 -24
- package/plugin/scripts/session-end.mjs.map +1 -1
- package/plugin/scripts/session-start.mjs +101 -6
- package/plugin/scripts/session-start.mjs.map +1 -1
- package/plugin/scripts/stop.mjs +72 -8
- package/plugin/scripts/stop.mjs.map +1 -1
- package/plugin/scripts/subagent-start.mjs +28 -26
- package/plugin/scripts/subagent-start.mjs.map +1 -1
- package/plugin/scripts/subagent-stop.mjs +29 -26
- package/plugin/scripts/subagent-stop.mjs.map +1 -1
- package/plugin/scripts/task-completed.mjs +31 -28
- package/plugin/scripts/task-completed.mjs.map +1 -1
- package/plugin/skills/_shared/TROUBLESHOOTING.md +22 -6
- package/plugin/skills/agentmemory-agents/REFERENCE.md +8 -5
- package/plugin/skills/agentmemory-config/REFERENCE.md +52 -1
- package/plugin/skills/agentmemory-config/SKILL.md +44 -7
- package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +4 -3
- package/plugin/skills/agentmemory-rest-api/REFERENCE.md +23 -2
- package/plugin/skills/forget/SKILL.md +4 -1
- package/plugin/skills/handoff/SKILL.md +4 -2
- package/plugin/skills/lesson/SKILL.md +64 -0
- package/plugin/skills/memory-discipline/SKILL.md +65 -0
- package/plugin/skills/recall/SKILL.md +4 -1
- package/plugin/skills/remember/SKILL.md +6 -1
- package/dist/config-ChC9EtgV.mjs +0 -259
- package/dist/config-ChC9EtgV.mjs.map +0 -1
- package/dist/connect-JnsJXc68.mjs.map +0 -1
- package/dist/image-refs-BKLmp_sD.mjs.map +0 -1
- package/dist/image-refs-C2YU7BIm.mjs.map +0 -1
- package/dist/keyed-mutex-DTHtcZrt.mjs.map +0 -1
- package/dist/logger-BEB7pCI9.mjs +0 -43
- package/dist/logger-BEB7pCI9.mjs.map +0 -1
- package/dist/schema-CNiCWzV9.mjs +0 -78
- package/dist/schema-CNiCWzV9.mjs.map +0 -1
- package/dist/src-CzgoepGU.mjs.map +0 -1
- package/dist/standalone-YsZFFQBM.mjs.map +0 -1
- package/dist/tools-registry-D3NEoe5m.mjs +0 -1115
- package/dist/tools-registry-D3NEoe5m.mjs.map +0 -1
- package/plugin/scripts/diagnostics.d.mts +0 -17
- package/plugin/scripts/diagnostics.d.mts.map +0 -1
- package/plugin/scripts/diagnostics.mjs.map +0 -1
package/.env.example
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
# LLM key, no embedding key, and no API auth. Set keys here only when you
|
|
10
10
|
# want to enable the corresponding feature.
|
|
11
11
|
#
|
|
12
|
-
# Run `npx @agentmemory/agentmemory init` to copy this file into
|
|
13
|
-
# automatically. Run `npx @agentmemory/agentmemory doctor`
|
|
14
|
-
# the daemon reads the env you expect.
|
|
12
|
+
# Run `npx -y @agentmemory/agentmemory@latest init` to copy this file into
|
|
13
|
+
# place automatically. Run `npx -y @agentmemory/agentmemory@latest doctor`
|
|
14
|
+
# to verify that the daemon reads the env you expect.
|
|
15
15
|
#
|
|
16
16
|
# Defaults shown in comments. Listed in priority order — the first key
|
|
17
17
|
# present wins on the LLM detection path (see src/config.ts::detectProvider).
|
|
@@ -21,27 +21,45 @@
|
|
|
21
21
|
# -----------------------------------------------------------------------------
|
|
22
22
|
#
|
|
23
23
|
# Without a provider key, agentmemory runs in noop mode: observations are
|
|
24
|
-
# indexed via zero-LLM synthetic compression
|
|
24
|
+
# indexed via zero-LLM synthetic compression and BM25 recall still works,
|
|
25
25
|
# but LLM-backed summarisation / reflection / consolidation are disabled.
|
|
26
|
+
# A provider key alone does not enable LLM-written observation compression;
|
|
27
|
+
# that path also requires AGENTMEMORY_AUTO_COMPRESS=true.
|
|
28
|
+
# AGENTMEMORY_CAPTURE_ALLOW= # Comma/space list of tool names or globs to capture; when set, only these are captured
|
|
29
|
+
# AGENTMEMORY_CAPTURE_DENY= # Extra tool names or globs to skip, added to the defaults (memory_*, toolsearch, listmcpresources, fetchmcpresource)
|
|
30
|
+
# AGENTMEMORY_CAPTURE_OUTPUT_MAX=8000 # Max characters of tool output stored per captured observation
|
|
31
|
+
# AGENTMEMORY_PRE_COMPACT_BUDGET=1500 # Token budget for context injected by the PreCompact hook; 0 disables it
|
|
32
|
+
# AGENTMEMORY_CAPTURE_MAX_ATTEMPTS=5 # Attempts before a capture becomes a dead letter
|
|
33
|
+
# AGENTMEMORY_CAPTURE_RETRY_INTERVAL_MS=10000 # Retry sweep interval and backoff base
|
|
34
|
+
# AGENTMEMORY_CAPTURE_DEDUP_HOURS=168 # How long stored event ids block replays
|
|
35
|
+
# AGENTMEMORY_CAPTURE_EVENTS_MAX=100000 # Max stored event ids
|
|
36
|
+
# AGENTMEMORY_CAPTURE_INBOX_MAX=10000 # Max unprocessed events before 503
|
|
37
|
+
# AGENTMEMORY_CAPTURE_DEAD_MAX=1000 # Max dead letters kept
|
|
38
|
+
# AGENTMEMORY_CAPTURE_SPOOL=false # Turn off the hook offline spool
|
|
39
|
+
# AGENTMEMORY_CAPTURE_SPOOL_DIR= # Spool folder (default <data dir>/capture-spool)
|
|
40
|
+
# AGENTMEMORY_CAPTURE_SPOOL_MAX_BYTES=5242880 # Spool size limit
|
|
41
|
+
# AGENTMEMORY_CAPTURE_SPOOL_MAX_AGE_HOURS=168 # Spooled records older than this are dropped
|
|
26
42
|
# The detection order is OPENAI_API_KEY → MINIMAX_API_KEY → ANTHROPIC_API_KEY
|
|
27
43
|
# → GEMINI_API_KEY → OPENROUTER_API_KEY → noop.
|
|
28
44
|
|
|
29
|
-
# OPENAI_API_KEY=sk-... #
|
|
45
|
+
# OPENAI_API_KEY=sk-... # Activates both the OpenAI-compatible LLM provider (DeepSeek, SiliconFlow, vLLM, LM Studio, Ollama via `/v1`) and OpenAI embeddings. Set OPENAI_API_KEY_FOR_LLM=false to scope it to embeddings only.
|
|
30
46
|
# OPENAI_BASE_URL=https://api.openai.com # Override for OpenAI-compatible providers
|
|
47
|
+
# OPENAI_MODEL=gpt-5.6-luna # Default OpenAI-compatible chat model
|
|
48
|
+
# OPENAI_API_KEY_FOR_LLM=false # Skip OpenAI auto-detection for LLM; key stays active for embeddings
|
|
31
49
|
|
|
32
50
|
# ANTHROPIC_API_KEY=sk-ant-...
|
|
33
|
-
# ANTHROPIC_MODEL=claude-sonnet-
|
|
51
|
+
# ANTHROPIC_MODEL=claude-sonnet-5 # Default Anthropic model
|
|
34
52
|
# ANTHROPIC_BASE_URL=https://api.anthropic.com # Override for Anthropic-compatible proxies / Azure AI Foundry
|
|
35
53
|
|
|
36
54
|
# GEMINI_API_KEY=... # Either env name works; GEMINI_API_KEY takes precedence
|
|
37
55
|
# GOOGLE_API_KEY=... # Alias for GEMINI_API_KEY when set alone (emits a one-time stderr hint)
|
|
38
|
-
# GEMINI_MODEL=gemini-
|
|
56
|
+
# GEMINI_MODEL=gemini-3.7-flash # Default Gemini model (current stable Flash)
|
|
39
57
|
|
|
40
58
|
# OPENROUTER_API_KEY=sk-or-...
|
|
41
|
-
# OPENROUTER_MODEL=anthropic/claude-sonnet-
|
|
59
|
+
# OPENROUTER_MODEL=anthropic/claude-sonnet-5
|
|
42
60
|
|
|
43
61
|
# MINIMAX_API_KEY=...
|
|
44
|
-
# MINIMAX_MODEL=MiniMax-
|
|
62
|
+
# MINIMAX_MODEL=MiniMax-M3
|
|
45
63
|
|
|
46
64
|
# MAX_TOKENS=4096 # Cap LLM completion tokens for compression / summarise calls
|
|
47
65
|
|
|
@@ -53,7 +71,7 @@
|
|
|
53
71
|
|
|
54
72
|
# Opt-in Claude-subscription fallback (spawns @anthropic-ai/claude-agent-sdk
|
|
55
73
|
# child sessions). Off by default — the agent-sdk fallback can trigger
|
|
56
|
-
# Stop-hook recursion
|
|
74
|
+
# Stop-hook recursion when invoked from inside Claude Code.
|
|
57
75
|
# AGENTMEMORY_ALLOW_AGENT_SDK=true
|
|
58
76
|
|
|
59
77
|
# FALLBACK_PROVIDERS=anthropic,gemini # Comma-separated chain tried after the primary provider returns an error (e.g. rate limit)
|
|
@@ -62,10 +80,14 @@
|
|
|
62
80
|
# 2. Embedding provider — auto-detected, override via EMBEDDING_PROVIDER
|
|
63
81
|
# -----------------------------------------------------------------------------
|
|
64
82
|
#
|
|
65
|
-
# Without an embedding
|
|
66
|
-
# search
|
|
83
|
+
# Without an embedding provider, vector embeddings are disabled. `mem::search`
|
|
84
|
+
# uses BM25; `mem::smart-search` can also fuse structural graph matches when
|
|
85
|
+
# graph data exists. Remote
|
|
86
|
+
# provider detection order: EMBEDDING_PROVIDER override → GEMINI_API_KEY →
|
|
67
87
|
# OPENAI_API_KEY → VOYAGE_API_KEY → COHERE_API_KEY → OPENROUTER_API_KEY →
|
|
68
|
-
#
|
|
88
|
+
# BM25-only. Local embeddings are an explicit opt-in, not the keyless default.
|
|
89
|
+
# `EMBEDDING_PROVIDER=local` uses Xenova/all-MiniLM-L6-v2 (384-dim) on-device;
|
|
90
|
+
# the first embedding request downloads the model and needs network access.
|
|
69
91
|
|
|
70
92
|
# EMBEDDING_PROVIDER=local # local | openai | voyage | cohere | gemini | openrouter
|
|
71
93
|
|
|
@@ -74,6 +96,8 @@
|
|
|
74
96
|
# COHERE_API_KEY=... # General-purpose embeddings
|
|
75
97
|
|
|
76
98
|
# Reuses OPENAI_API_KEY / OPENAI_BASE_URL above when EMBEDDING_PROVIDER=openai.
|
|
99
|
+
# OPENAI_EMBEDDING_BASE_URL=https://... # Embeddings only; falls back to OPENAI_BASE_URL
|
|
100
|
+
# OPENAI_EMBEDDING_API_KEY=sk-... # Embeddings only; wins over OPENAI_API_KEY when set
|
|
77
101
|
# OPENAI_EMBEDDING_MODEL=text-embedding-3-small # Embedding model when EMBEDDING_PROVIDER=openai
|
|
78
102
|
# OPENAI_EMBEDDING_DIMENSIONS=1536 # Required when the model is not in the known-models table
|
|
79
103
|
|
|
@@ -87,7 +111,9 @@
|
|
|
87
111
|
# Without a secret, REST endpoints are open on loopback. Set this when
|
|
88
112
|
# you expose the daemon beyond loopback or run behind a reverse proxy.
|
|
89
113
|
|
|
90
|
-
# AGENTMEMORY_SECRET=your-secret
|
|
114
|
+
# AGENTMEMORY_SECRET=your-secret # generated into ~/.agentmemory/secret on first start when unset
|
|
115
|
+
# VIEWER_ALLOWED_ORIGINS=https://memory.example.com
|
|
116
|
+
# AGENTMEMORY_IMPORT_ROOT=~/projects
|
|
91
117
|
|
|
92
118
|
# -----------------------------------------------------------------------------
|
|
93
119
|
# 4. Search tuning
|
|
@@ -96,6 +122,7 @@
|
|
|
96
122
|
# BM25_WEIGHT=0.4 # Hybrid search weight for BM25 leg
|
|
97
123
|
# VECTOR_WEIGHT=0.6 # Hybrid search weight for vector leg
|
|
98
124
|
# AGENTMEMORY_GRAPH_WEIGHT=0.2 # Graph traversal bonus on smart-search ranking
|
|
125
|
+
# AGENTMEMORY_GRAPH_COMPACT_ON_BOOT=false # Skip the one-time background trim of oversized graph provenance at startup
|
|
99
126
|
# TOKEN_BUDGET=2000 # Max tokens injected via mem::context per session
|
|
100
127
|
# MAX_OBS_PER_SESSION=500 # Per-session observation cap before consolidation kicks in
|
|
101
128
|
# SUMMARIZE_CHUNK_SIZE=400 # When mem::summarize sees a session larger than this, it chunks observations and map-reduces (chunk-summarize → reduce-merge) to stay within the LLM's context window. Default 400 ≈ 50k tokens per chunk at ~110 tok/obs. Native sessions are capped by MAX_OBS_PER_SESSION; chunking primarily matters for bulk-imported jsonl sessions, which bypass that cap.
|
|
@@ -105,29 +132,56 @@
|
|
|
105
132
|
# 5. Behaviour flags
|
|
106
133
|
# -----------------------------------------------------------------------------
|
|
107
134
|
|
|
108
|
-
# AGENTMEMORY_AUTO_COMPRESS=true # Run LLM compression on every observation batch
|
|
109
|
-
# AGENTMEMORY_INJECT_CONTEXT=true # Inject recalled memories back into agent prompts
|
|
135
|
+
# AGENTMEMORY_AUTO_COMPRESS=true # Run LLM-written compression on every observation batch. Requires BOTH this flag and a configured provider; a provider alone leaves synthetic compression active.
|
|
136
|
+
# AGENTMEMORY_INJECT_CONTEXT=true # Inject recalled memories back into agent prompts. Default off — hooks capture observations but do not modify conversation.
|
|
110
137
|
# CONSOLIDATION_ENABLED=true # Run the 4-tier consolidation pipeline (memories → semantic → procedural). Default off — opt in once you've measured the LLM cost.
|
|
111
138
|
# CONSOLIDATION_DECAY_DAYS=30 # Age (days) after which non-reinforced memories decay during consolidation
|
|
112
139
|
# GRAPH_EXTRACTION_ENABLED=true # Extract concept-graph edges on remember; powers the graph-traversal recall path
|
|
113
140
|
# GRAPH_EXTRACTION_BATCH_SIZE=8 # Memories per graph-extraction batch
|
|
141
|
+
|
|
142
|
+
# Local reasoning models only: set to 1 to ask the model to skip its
|
|
143
|
+
# hidden thinking pass during graph extraction. Extraction runs several
|
|
144
|
+
# times faster; relation quality can drop slightly. Leave unset to let
|
|
145
|
+
# the model think (default).
|
|
146
|
+
# AGENTMEMORY_LLM_NOTHINK=1
|
|
147
|
+
|
|
114
148
|
# AGENTMEMORY_REFLECT=true # Periodically auto-synthesize lessons from memories
|
|
115
|
-
# AGENTMEMORY_DROP_STALE_INDEX=true # Drop on-disk BM25 / vector index on startup if dim guard fires
|
|
149
|
+
# AGENTMEMORY_DROP_STALE_INDEX=true # Drop on-disk BM25 / vector index on startup if dim guard fires. Recovery toggle for stuck-state debugging.
|
|
116
150
|
# AGENTMEMORY_IMAGE_EMBEDDINGS=true # Enable image embeddings when an image provider is present (experimental).
|
|
151
|
+
# AGENTMEMORY_AUDIT_RETENTION_MONTHS=6 # Drop whole audit-log month scopes older than N months on a daily sweep. Default 0 = keep audit history forever.
|
|
152
|
+
# AGENTMEMORY_AUDIT_MIGRATE_MAX_BYTES=33554432 # Largest legacy mem:audit scope file the one-time migration will read locally. Default 32 MiB; bigger or unreadable stores are left frozen.
|
|
153
|
+
# AGENTMEMORY_AUDIT_INDEX_PERSIST=false # Set to 1 or true to audit index migration and cleanup writes (debugging only)
|
|
154
|
+
# AGENTMEMORY_INDEX_SAVE_INTERVAL_MS=600000 # Minimum time between search index saves; shutdown and deletes still save immediately.
|
|
155
|
+
# AGENTMEMORY_VECTOR_BUCKET_SIZE=500 # Vectors held per storage bucket before a new bucket opens; a save only rewrites buckets it changed.
|
|
156
|
+
# AGENTMEMORY_VECTOR_BACKFILL_MAX=500 # Batch size for re-embedding vectors missing since the last save (continues across restarts); also caps the whole-store opt-in per boot.
|
|
157
|
+
# AGENTMEMORY_VECTOR_BACKFILL=all # Required to backfill an entire store's vectors at once (no prior vector save, or a stale legacy manifest); unset means that case waits for an explicit opt-in.
|
|
158
|
+
# AGENTMEMORY_VIEWER_STREAM_MAX=500 # Max items kept in the persisted "viewer" live-stream group; older entries are pruned in batches. Floored at 200 (the viewer's reload window); negative values fall back to the default
|
|
117
159
|
|
|
118
160
|
# -----------------------------------------------------------------------------
|
|
119
161
|
# 6. CLI / runtime knobs
|
|
120
162
|
# -----------------------------------------------------------------------------
|
|
121
163
|
|
|
122
|
-
# AGENTMEMORY_TOOLS=
|
|
164
|
+
# AGENTMEMORY_TOOLS=core # all (54 tools, default) | core (8 tools): surface exposed to MCP clients
|
|
123
165
|
# AGENTMEMORY_SLOTS=memory # Comma-separated plugin slot names the CLI should claim
|
|
124
166
|
# AGENTMEMORY_DEBUG=1 # Trace MCP shim probe + standalone fallback decisions to stderr
|
|
125
167
|
# AGENTMEMORY_FORCE_PROXY=1 # Skip the MCP shim livez probe and trust AGENTMEMORY_URL (for sandboxed MCP clients that can't reach localhost)
|
|
126
168
|
# AGENTMEMORY_PROBE_TIMEOUT_MS=2000 # MCP shim livez probe timeout
|
|
127
169
|
# AGENTMEMORY_URL=http://localhost:3111 # REST base URL — honored by status, doctor, MCP shim
|
|
128
170
|
# AGENTMEMORY_VIEWER_URL=http://localhost:3113 # Override the viewer URL printed by `agentmemory status`
|
|
171
|
+
# Persistent iii state; same override as `--data-dir`, used by native and
|
|
172
|
+
# Docker starts. Explicit flag/env wins. Otherwise instance 0 reuses an
|
|
173
|
+
# existing ./data/state_store.db or ./data/iii-config.yaml before defaults: macOS
|
|
174
|
+
# ~/Library/Application Support/agentmemory; Linux $XDG_DATA_HOME/agentmemory
|
|
175
|
+
# or ~/.local/share/agentmemory; Windows %APPDATA%\agentmemory.
|
|
176
|
+
# AGENTMEMORY_DATA_DIR=/absolute/path
|
|
177
|
+
# AGENTMEMORY_III_CONFIG=/path/to/iii-config.yaml # Engine config the CLI starts from; the bundled default binds 127.0.0.1
|
|
178
|
+
# AGENTMEMORY_STATE_SAVE_INTERVAL_MS=2000 # How often the engine writes state to disk; a crash loses at most this much
|
|
179
|
+
# AGENTMEMORY_USE_DOCKER=1 # Prefer bundled Docker even when a compatible native iii binary exists
|
|
129
180
|
# AGENTMEMORY_EXPORT_ROOT=~/agentmemory-backup # Default destination for `agentmemory export`
|
|
130
181
|
|
|
182
|
+
# AGENTMEMORY_STATE_BACKEND=redis # file (default) | redis — storage adapter for iii-state and iii-stream, see README "Storage backend"
|
|
183
|
+
# AGENTMEMORY_REDIS_URL=redis://localhost:6379 # Required when AGENTMEMORY_STATE_BACKEND=redis
|
|
184
|
+
|
|
131
185
|
# STANDALONE_MCP=1 # MCP shim only — bypass the worker and run @agentmemory/mcp in-process
|
|
132
186
|
# STANDALONE_PERSIST_PATH=~/.agentmemory/local.db # Path used by the standalone MCP shim's local fallback store
|
|
133
187
|
|
|
@@ -145,23 +199,39 @@
|
|
|
145
199
|
# 7. Ports
|
|
146
200
|
# -----------------------------------------------------------------------------
|
|
147
201
|
|
|
148
|
-
# III_REST_PORT=3111 # REST API
|
|
149
|
-
#
|
|
150
|
-
#
|
|
202
|
+
# III_REST_PORT=3111 # REST API + MCP HTTP anchor
|
|
203
|
+
# III_STREAM_PORT=3112 # Preferred streams override; defaults to REST + 1
|
|
204
|
+
# III_STREAMS_PORT=3112 # Legacy alias for III_STREAM_PORT
|
|
205
|
+
# III_VIEWER_PORT=3113 # Viewer bind port; defaults to REST + 2
|
|
206
|
+
# III_ENGINE_PORT=49134 # Engine bind port; defaults to REST + 46023
|
|
207
|
+
# III_ENGINE_URL=ws://localhost:49134 # Explicit/remote worker WebSocket URL; takes precedence over derived engine port
|
|
208
|
+
# Derivation applies only while the corresponding explicit port/URL is unset.
|
|
209
|
+
# `--instance 1` selects 3211/3212/3213/49234 and an instance-1 data subdir.
|
|
151
210
|
|
|
152
211
|
# -----------------------------------------------------------------------------
|
|
153
212
|
# 8. iii engine pin
|
|
154
213
|
# -----------------------------------------------------------------------------
|
|
155
214
|
#
|
|
156
|
-
# agentmemory
|
|
157
|
-
#
|
|
158
|
-
#
|
|
159
|
-
#
|
|
215
|
+
# agentmemory pins iii-engine to the same release as its iii-sdk dependency
|
|
216
|
+
# (v0.22.1). The worker speaks the wire protocol of that engine, so the two move
|
|
217
|
+
# together in agentmemory releases. Override with AGENTMEMORY_III_VERSION only
|
|
218
|
+
# if you run your own engine and know it matches.
|
|
219
|
+
|
|
220
|
+
# AGENTMEMORY_III_VERSION=0.22.1
|
|
221
|
+
|
|
222
|
+
# Engine usage telemetry (iii). Off unless you set it; true opts in.
|
|
223
|
+
# III_TELEMETRY_ENABLED=false
|
|
224
|
+
|
|
225
|
+
# -----------------------------------------------------------------------------
|
|
226
|
+
# 9. Session sweep
|
|
227
|
+
# -----------------------------------------------------------------------------
|
|
160
228
|
|
|
161
|
-
#
|
|
229
|
+
# Hourly backstop that marks stale active sessions as abandoned.
|
|
230
|
+
# AGENTMEMORY_SESSION_SWEEP_ENABLED=false # Disable the hourly sweep
|
|
231
|
+
# AGENTMEMORY_SESSION_SWEEP_STALE_HOURS=24 # Inactivity hours before a session is abandoned
|
|
162
232
|
|
|
163
233
|
# -----------------------------------------------------------------------------
|
|
164
|
-
#
|
|
234
|
+
# 10. Claude Code bridge (opt-in)
|
|
165
235
|
# -----------------------------------------------------------------------------
|
|
166
236
|
|
|
167
237
|
# CLAUDE_MEMORY_BRIDGE=true # Mirror compressed memories into Claude Code's CLAUDE.md
|
|
@@ -169,7 +239,7 @@
|
|
|
169
239
|
# CLAUDE_MEMORY_LINE_BUDGET=200 # Lines of memory CLAUDE.md should hold
|
|
170
240
|
|
|
171
241
|
# -----------------------------------------------------------------------------
|
|
172
|
-
#
|
|
242
|
+
# 11. Obsidian export (opt-in)
|
|
173
243
|
# -----------------------------------------------------------------------------
|
|
174
244
|
|
|
175
245
|
# OBSIDIAN_AUTO_EXPORT=true # Auto-export memories to an Obsidian vault on every consolidation
|
package/AGENTS.md
CHANGED
|
@@ -4,36 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
agentmemory is a persistent memory system for AI coding agents, built on iii-engine's three primitives (Worker/Function/Trigger). Everything goes through `registerFunction`/`registerTrigger`/`sdk.trigger()` — never bypass iii-engine with standalone SQLite or in-process alternatives.
|
|
6
6
|
|
|
7
|
-
- **Engine**: iii-sdk (WebSocket to iii-engine on port 49134)
|
|
7
|
+
- **Engine**: iii-sdk 0.22.1 with @iii-dev/helpers 0.22.1 (WebSocket to iii-engine 0.22.1 on port 49134; the client type is `IIIClient`, HTTP requests are `HttpRequest` from `@iii-dev/helpers/http`)
|
|
8
8
|
- **State**: File-based SQLite via iii-engine's StateModule (`./data/state_store.db`)
|
|
9
9
|
- **Build**: TypeScript → ESM via tsdown, output to `dist/`
|
|
10
10
|
- **Test**: vitest (`npm test` excludes integration tests)
|
|
11
11
|
|
|
12
12
|
## Consistency Rules
|
|
13
13
|
|
|
14
|
-
**
|
|
14
|
+
**Before every commit, run `npm run docs:sync` and commit what it changes.** It computes MCP tool counts (all, core, local fallback), REST endpoints, skills, hooks, tests, iii functions, source files, lines of code and KV scopes from the source, and rewrites them in README.md, the translated READMEs, AGENTS.md, INSTALL_FOR_AGENTS.md, plugin manifests, integration READMEs, the stat badges and the `src/index.ts` banner. The last synced values live in `scripts/docs-sync.state.json`; commit that file with the rest. `npm run docs:check` exits non-zero when anything is out of date. When the sync prints `check <fact> <old> left in <file>`, open that line: either fix it by hand or add its noun to the fact in `scripts/docs-sync.ts` so the next sync catches it. Never hand-edit these numbers or versions in the docs; change the source and sync.
|
|
15
|
+
|
|
16
|
+
**When adding or removing MCP tools, update:**
|
|
15
17
|
1. `src/mcp/tools-registry.ts` — tool definition + `getAllTools()` array
|
|
16
18
|
2. `src/mcp/server.ts` — handler case in the `mcp::tools::call` switch
|
|
17
19
|
3. `src/triggers/api.ts` — REST endpoint registration
|
|
18
|
-
4. `src/index.ts` — function registration
|
|
20
|
+
4. `src/index.ts` — function registration
|
|
19
21
|
5. `test/mcp-standalone.test.ts` — tool count assertion
|
|
20
|
-
6. `README.md` — tool counts (search for "MCP tools")
|
|
21
|
-
7. `plugin/.claude-plugin/plugin.json` — tool count in description
|
|
22
|
-
8. `plugin/plugin.json` and `plugin/.mcp.copilot.json` (when present) — tool count or MCP exposure
|
|
23
22
|
|
|
24
|
-
**When adding REST endpoints,
|
|
23
|
+
**When adding REST endpoints, update:**
|
|
25
24
|
1. `src/triggers/api.ts` — endpoint registration
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
**When bumping version, you MUST update ALL of the following:**
|
|
30
|
-
1. `package.json` — version field
|
|
31
|
-
2. `src/version.ts` — VERSION constant and type union
|
|
32
|
-
3. `src/types.ts` — ExportData version union
|
|
33
|
-
4. `src/functions/export-import.ts` — supportedVersions set
|
|
34
|
-
5. `test/export-import.test.ts` — version assertion
|
|
35
|
-
6. `plugin/.claude-plugin/plugin.json` — version field
|
|
36
|
-
7. `plugin/plugin.json` (when present) — version field
|
|
25
|
+
|
|
26
|
+
**When bumping version, change only `package.json`.** `npm run docs:sync` carries the new version into `src/version.ts`, the `src/types.ts` ExportData union, the `supportedVersions` set in `src/functions/export-import.ts`, every plugin and package manifest that shared the old version, the deploy templates, the AGENTS.md stats heading, and CHANGELOG.md (the Unreleased section becomes the new version with today's date, plus its compare link).
|
|
37
27
|
|
|
38
28
|
**When adding new KV scopes:**
|
|
39
29
|
1. `src/state/schema.ts` — add to the KV object
|
|
@@ -59,7 +49,9 @@ sdk.registerFunction(
|
|
|
59
49
|
|
|
60
50
|
### REST Endpoint Registration
|
|
61
51
|
```typescript
|
|
62
|
-
|
|
52
|
+
import type { HttpRequest } from "@iii-dev/helpers/http";
|
|
53
|
+
|
|
54
|
+
sdk.registerFunction("api::your-endpoint", async (req: HttpRequest) => {
|
|
63
55
|
const denied = checkAuth(req, secret);
|
|
64
56
|
if (denied) return denied;
|
|
65
57
|
const body = req.body as Record<string, unknown>;
|
|
@@ -109,16 +101,17 @@ Hook scripts in `src/hooks/` are standalone Node.js scripts (no iii-sdk import).
|
|
|
109
101
|
|
|
110
102
|
## Testing
|
|
111
103
|
|
|
112
|
-
-
|
|
104
|
+
- Before every commit run, in order: `npm run build`, `npm run skills:gen`, `npm run docs:sync`, `npm run skills:check`, `npm test` (2,500+ tests). Commit anything the generators changed. CI runs the same build, skills check and tests.
|
|
105
|
+
- Before any npm publish: `npm run release:gate` must pass. It installs the packed tarballs into a clean home and runs capture, recovery, restart, export/import, MCP and status checks against the installed CLI (see CONTRIBUTING.md, Release process)
|
|
113
106
|
- Mock pattern: `vi.mock("iii-sdk")` with mock `sdk.trigger`, `kv.get/set/list`
|
|
114
107
|
- Test files go in `test/` with `.test.ts` extension
|
|
115
108
|
- Follow existing patterns in `test/crystallize.test.ts` for function tests
|
|
116
109
|
|
|
117
|
-
## Current Stats (v0.9.
|
|
110
|
+
## Current Stats (v0.9.30)
|
|
118
111
|
|
|
119
|
-
-
|
|
120
|
-
-
|
|
112
|
+
- 54 MCP tools (8 visible by default, `AGENTMEMORY_TOOLS=all` for all)
|
|
113
|
+
- 138 REST endpoints
|
|
121
114
|
- 6 MCP resources, 3 MCP prompts
|
|
122
|
-
- 12 hooks,
|
|
123
|
-
-
|
|
124
|
-
-
|
|
115
|
+
- 12 hooks, 17 skills
|
|
116
|
+
- 311+ iii functions
|
|
117
|
+
- 2,500+ tests
|