agent-working-memory 0.8.5 → 0.8.6
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/dist/adapters/common.d.ts.map +1 -1
- package/dist/adapters/common.js +95 -8
- package/dist/adapters/common.js.map +1 -1
- package/dist/api/routes.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/mcp.js +2 -2
- package/package.json +1 -1
- package/src/adapters/common.ts +95 -8
- package/src/api/routes.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/mcp.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/adapters/common.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,gEAAgE;AAChE,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAOnF;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAkBA;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GA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MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,YAAY,CA6Bf;AAED,sBAAsB;AACtB,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAID;;;GAGG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACrD,MAAM,CA8CR;AAED,eAAO,MAAM,uBAAuB,QAiSvB,CAAC"}
|
package/dist/adapters/common.js
CHANGED
|
@@ -310,6 +310,33 @@ When it isn't:
|
|
|
310
310
|
return nothing, the memory probably isn't there — read the code instead of
|
|
311
311
|
burning more recalls.
|
|
312
312
|
|
|
313
|
+
### Recall tuning (0.8.x — opt-in parameters for higher-quality recall)
|
|
314
|
+
Default \`memory_recall\` is tuned for the common case. The 0.8.x recall pipeline
|
|
315
|
+
exposes four opt-in parameters that change the cost/quality tradeoff. Use them
|
|
316
|
+
when the default doesn't match what you actually need.
|
|
317
|
+
|
|
318
|
+
- **\`granularity: 'compact'\`** — every result carries a 200-char \`summary\`
|
|
319
|
+
field with a query-aware snippet (the densest window of query terms in the
|
|
320
|
+
content). Use this when you expect to scan 5+ results to find one — saves
|
|
321
|
+
~70% of recall output tokens. The full content stays available in
|
|
322
|
+
\`engram.content\` if you want to drill into a specific result.
|
|
323
|
+
- **\`granularity: 'auto'\`** — confidence-adaptive. If the top result is a clear
|
|
324
|
+
winner, it gets a longer summary while the rest are compact. If confidence
|
|
325
|
+
is uniform across results, everything is compact. Use when you don't know
|
|
326
|
+
in advance whether one result will dominate.
|
|
327
|
+
- **\`require_confidence: 0.10 | 0.25 | 0.40\`** — opt-in abstention. AWM
|
|
328
|
+
returns \`[]\` instead of low-confidence noise. Use when you're about to ACT
|
|
329
|
+
on the recalled fact (grounding a decision, citing the memory verbatim,
|
|
330
|
+
contradicting a prior assumption). Thresholds: \`0.10\` strict — only abstain
|
|
331
|
+
on garbage; \`0.25\` balanced; \`0.40\` aggressive — prefer "I don't know"
|
|
332
|
+
over "best of bad." When abstention fires (empty result), treat it as a
|
|
333
|
+
signal — either the memory genuinely isn't there (read the code) or your
|
|
334
|
+
query missed (reformulate). Don't retry without the threshold.
|
|
335
|
+
- **\`workspace: "<name>"\`** — hive-mode recall across all agents in the
|
|
336
|
+
workspace. Use when other agents may have written canonical knowledge you
|
|
337
|
+
need. Default is agent-scoped (your own memories only). Can also be set
|
|
338
|
+
globally via the \`AWM_WORKSPACE\` env var.
|
|
339
|
+
|
|
313
340
|
### Keep memory fresh
|
|
314
341
|
- After recalling a memory, if you observe the real state is different → call
|
|
315
342
|
\`memory_supersede\` immediately with the corrected version.
|
|
@@ -320,6 +347,24 @@ When it isn't:
|
|
|
320
347
|
drifts out of date. The system relies on you to keep it current. This is the #1
|
|
321
348
|
failure mode.**
|
|
322
349
|
|
|
350
|
+
### Content fade — write-and-forget is safe (0.8.x)
|
|
351
|
+
Un-recalled engrams gradually fade their content while preserving cue pathways
|
|
352
|
+
(concept + tags + embedding stay intact). This is Paper 1 — storage
|
|
353
|
+
degradation. Practical implications:
|
|
354
|
+
|
|
355
|
+
- **Don't manually purge memories** to "save space." The system already
|
|
356
|
+
compresses unused content. Old memories stay findable via cue match even
|
|
357
|
+
when their body has decayed.
|
|
358
|
+
- **Don't over-pin with \`memory_class: canonical\`** to fight fade. Canonical
|
|
359
|
+
only changes salience gating at write time, not fade behavior. Fade
|
|
360
|
+
affects un-recalled engrams of any class.
|
|
361
|
+
- **Recall keeps content alive.** Every recall touches the engram and resets
|
|
362
|
+
its fade clock. Frequently-recalled memories stay full-fidelity automatically.
|
|
363
|
+
- **Supersede is the right tool for stale facts.** When you observe a memory
|
|
364
|
+
is outdated, call \`memory_supersede\` — the new version inherits the old
|
|
365
|
+
one's coherent associations (counter-narrative replacement, 0.8.x) so cue
|
|
366
|
+
pathways carry forward to the replacement.
|
|
367
|
+
|
|
323
368
|
### Example — good vs bad memory_write
|
|
324
369
|
|
|
325
370
|
**BAD** (no prefix tags, vague concept, can't be recalled by future queries):
|
|
@@ -350,19 +395,61 @@ memory_write(
|
|
|
350
395
|
- AWM is shared across all agents in real time. When any agent writes or supersedes a
|
|
351
396
|
memory, every other agent can recall it immediately.
|
|
352
397
|
|
|
398
|
+
### Backend (SQLite vs PGlite, 0.8.x)
|
|
399
|
+
AWM ships two storage backends. The installer picks SQLite by default; both
|
|
400
|
+
are functionally equivalent for cognitive workloads, but differ in operational
|
|
401
|
+
guarantees:
|
|
402
|
+
|
|
403
|
+
- **SQLite** (default) — embedded, **multi-process safe** via WAL mode. Best
|
|
404
|
+
for single-machine setups and MCP scenarios where multiple Claude Code
|
|
405
|
+
sessions may open the same database concurrently.
|
|
406
|
+
- **PGlite** — embedded Postgres (WASM) with pgvector. **Single-process only**
|
|
407
|
+
— two MCP processes against the same \`memory-pglite/\` directory will
|
|
408
|
+
abort the second. Pick via \`AWM_STORE_BACKEND=pglite\` and
|
|
409
|
+
\`AWM_DB_PATH=path/to/memory-pglite\`.
|
|
410
|
+
- **Auto-detect** — if \`AWM_DB_PATH\` points to a directory that already
|
|
411
|
+
exists, AWM detects PGlite; a file → SQLite. No explicit
|
|
412
|
+
\`AWM_STORE_BACKEND\` needed when an existing DB is present.
|
|
413
|
+
|
|
414
|
+
For the comparison table (recall quality parity, BM25 vs \`ts_rank_cd\`,
|
|
415
|
+
multi-process guarantees), see \`docs/pglite-feature-parity.md\`.
|
|
416
|
+
|
|
353
417
|
### Diagnostics / escape hatches (env vars, only if you know why)
|
|
354
|
-
The 0.7.6→0.7.14 work cut recall latency from 11s to ~300ms.
|
|
355
|
-
|
|
356
|
-
|
|
418
|
+
The 0.7.6→0.7.14 work cut recall latency from 11s to ~300ms. The 0.8.x work
|
|
419
|
+
added the write-path rewrite (per-write 300+ ms → under 10ms) and PGlite
|
|
420
|
+
parity tuning. Each optimization is gated by an env-var so it can be disabled
|
|
421
|
+
for A/B testing if a regression appears in your workload:
|
|
357
422
|
|
|
358
|
-
|
|
423
|
+
Recall pipeline (0.7.x):
|
|
424
|
+
- \`AWM_DISABLE_POOL_FILTER=1\` — disables the candidate pool reduction
|
|
359
425
|
pre-filter in recall. Reverts to scoring all active candidates.
|
|
360
|
-
- \`AWM_DISABLE_SLIM_CACHE=1\`
|
|
426
|
+
- \`AWM_DISABLE_SLIM_CACHE=1\` — disables the in-memory slim cache.
|
|
361
427
|
Reverts to per-recall SQL fetch + Buffer→Float32Array conversion.
|
|
362
|
-
- \`AWM_DISABLE_RERANK_SKIP=1\`
|
|
428
|
+
- \`AWM_DISABLE_RERANK_SKIP=1\` — disables the cross-encoder skip on
|
|
363
429
|
clear-winner queries. Forces every recall through the reranker.
|
|
364
|
-
- \`AWM_DISABLE_EXPANSION_CACHE=1\`
|
|
365
|
-
|
|
430
|
+
- \`AWM_DISABLE_EXPANSION_CACHE=1\` — disables the query expansion skip
|
|
431
|
+
heuristic + LRU cache. Forces every recall through flan-t5-small.
|
|
432
|
+
|
|
433
|
+
Write pipeline + lifecycle (0.8.x):
|
|
434
|
+
- \`AWM_REINFORCE_MAX_CONTENT_LEN=1500\` — max chars an engram's content
|
|
435
|
+
can grow to via merge-on-reinforce (drop-oldest on overflow). Higher =
|
|
436
|
+
preserves more reinforced detail; lower = leaner recall output.
|
|
437
|
+
- \`AWM_REINFORCE_MERGE_CONTENT=0\` — disable content merge on reinforce.
|
|
438
|
+
Reverts to pre-0.8.5 behavior (discard new content, only bump confidence).
|
|
439
|
+
- \`AWM_NOVELTY_EMBED=0\` — disable the cosine channel in novelty
|
|
440
|
+
computation. BM25-only fallback. Reverts to pre-0.8.5 novelty.
|
|
441
|
+
- \`AWM_GRANULARITY_COMPACT_LEN=200\` — char budget for query-aware snippet
|
|
442
|
+
in \`granularity: 'compact'\` mode.
|
|
443
|
+
- \`AWM_GRANULARITY_FULL_LEN=1000\` — char budget for the top result in
|
|
444
|
+
\`granularity: 'auto'\` mode when there's a clear winner.
|
|
445
|
+
|
|
446
|
+
PGlite backend (0.8.x):
|
|
447
|
+
- \`AWM_PGLITE_BM25_M=1\` — multiplier on PGlite \`ts_rank_cd\` to calibrate
|
|
448
|
+
against SQLite FTS5 BM25 distribution. M=1 (default) is passthrough;
|
|
449
|
+
higher M boosts PGlite scores at the cost of recall-ranking precision
|
|
450
|
+
(see CHANGELOG 0.8.5 follow-up).
|
|
451
|
+
- \`AWM_IVFFLAT_PROBES=5\` — pgvector ivfflat probes per query. Higher =
|
|
452
|
+
more accurate, slower.
|
|
366
453
|
|
|
367
454
|
In production, leave these all unset. Use only when diagnosing a suspected
|
|
368
455
|
recall-quality regression.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/adapters/common.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,sCAAsC;AAEtC;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,gEAAgE;AAChE,MAAM,UAAU,kBAAkB;IAChC,uEAAuE;IACvE,OAAO,OAAO,CAAC,SAAS,EAAE,IAAI,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AC;IAEvD,IAAI,cAAc,KAAK,cAAc,EAAE,CAAC;QACtC,OAAO,GAAG,KAAK,4CAA4C,CAAC;IAC9D,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,OAAO,GACX,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,cAAc;QACd,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAClC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,GAAG,KAAK,uDAAuD,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiStC,CAAC,SAAS,EAAE,CAAC"}
|
package/dist/api/routes.js
CHANGED
|
@@ -694,7 +694,7 @@ export function registerRoutes(app, deps) {
|
|
|
694
694
|
const base = {
|
|
695
695
|
status: 'ok',
|
|
696
696
|
timestamp: new Date().toISOString(),
|
|
697
|
-
version: '0.8.
|
|
697
|
+
version: '0.8.6',
|
|
698
698
|
coordination: coordEnabled,
|
|
699
699
|
};
|
|
700
700
|
if (coordEnabled && typeof deps.store.getDb === 'function') {
|
package/dist/cli.js
CHANGED
|
@@ -309,7 +309,7 @@ async function exportMemories() {
|
|
|
309
309
|
// Collect unique agents
|
|
310
310
|
const agents = [...new Set(memories.map((m) => m.agent_id))];
|
|
311
311
|
const exportData = {
|
|
312
|
-
version: '0.8.
|
|
312
|
+
version: '0.8.6',
|
|
313
313
|
exported_at: new Date().toISOString(),
|
|
314
314
|
source_db: dbPath,
|
|
315
315
|
agent_filter: agentFilter,
|
package/dist/mcp.js
CHANGED
|
@@ -72,7 +72,7 @@ import { queryPeerDecisions, formatPeerDecisions } from './coordination/peer-dec
|
|
|
72
72
|
const INCOGNITO = process.env.AWM_INCOGNITO === '1' || process.env.AWM_INCOGNITO === 'true';
|
|
73
73
|
if (INCOGNITO) {
|
|
74
74
|
console.error('AWM: incognito mode — all memory tools disabled, nothing will be recorded');
|
|
75
|
-
const server = new McpServer({ name: 'agent-working-memory', version: '0.8.
|
|
75
|
+
const server = new McpServer({ name: 'agent-working-memory', version: '0.8.6' });
|
|
76
76
|
const transport = new StdioServerTransport();
|
|
77
77
|
server.connect(transport).catch(err => {
|
|
78
78
|
console.error('MCP server failed:', err);
|
|
@@ -108,7 +108,7 @@ else {
|
|
|
108
108
|
let coordDb = null;
|
|
109
109
|
const server = new McpServer({
|
|
110
110
|
name: 'agent-working-memory',
|
|
111
|
-
version: '0.8.
|
|
111
|
+
version: '0.8.6',
|
|
112
112
|
});
|
|
113
113
|
server.registerResource('awm-overview', 'awm://server/overview', {
|
|
114
114
|
title: 'AWM Overview',
|
package/package.json
CHANGED
package/src/adapters/common.ts
CHANGED
|
@@ -352,6 +352,33 @@ When it isn't:
|
|
|
352
352
|
return nothing, the memory probably isn't there — read the code instead of
|
|
353
353
|
burning more recalls.
|
|
354
354
|
|
|
355
|
+
### Recall tuning (0.8.x — opt-in parameters for higher-quality recall)
|
|
356
|
+
Default \`memory_recall\` is tuned for the common case. The 0.8.x recall pipeline
|
|
357
|
+
exposes four opt-in parameters that change the cost/quality tradeoff. Use them
|
|
358
|
+
when the default doesn't match what you actually need.
|
|
359
|
+
|
|
360
|
+
- **\`granularity: 'compact'\`** — every result carries a 200-char \`summary\`
|
|
361
|
+
field with a query-aware snippet (the densest window of query terms in the
|
|
362
|
+
content). Use this when you expect to scan 5+ results to find one — saves
|
|
363
|
+
~70% of recall output tokens. The full content stays available in
|
|
364
|
+
\`engram.content\` if you want to drill into a specific result.
|
|
365
|
+
- **\`granularity: 'auto'\`** — confidence-adaptive. If the top result is a clear
|
|
366
|
+
winner, it gets a longer summary while the rest are compact. If confidence
|
|
367
|
+
is uniform across results, everything is compact. Use when you don't know
|
|
368
|
+
in advance whether one result will dominate.
|
|
369
|
+
- **\`require_confidence: 0.10 | 0.25 | 0.40\`** — opt-in abstention. AWM
|
|
370
|
+
returns \`[]\` instead of low-confidence noise. Use when you're about to ACT
|
|
371
|
+
on the recalled fact (grounding a decision, citing the memory verbatim,
|
|
372
|
+
contradicting a prior assumption). Thresholds: \`0.10\` strict — only abstain
|
|
373
|
+
on garbage; \`0.25\` balanced; \`0.40\` aggressive — prefer "I don't know"
|
|
374
|
+
over "best of bad." When abstention fires (empty result), treat it as a
|
|
375
|
+
signal — either the memory genuinely isn't there (read the code) or your
|
|
376
|
+
query missed (reformulate). Don't retry without the threshold.
|
|
377
|
+
- **\`workspace: "<name>"\`** — hive-mode recall across all agents in the
|
|
378
|
+
workspace. Use when other agents may have written canonical knowledge you
|
|
379
|
+
need. Default is agent-scoped (your own memories only). Can also be set
|
|
380
|
+
globally via the \`AWM_WORKSPACE\` env var.
|
|
381
|
+
|
|
355
382
|
### Keep memory fresh
|
|
356
383
|
- After recalling a memory, if you observe the real state is different → call
|
|
357
384
|
\`memory_supersede\` immediately with the corrected version.
|
|
@@ -362,6 +389,24 @@ When it isn't:
|
|
|
362
389
|
drifts out of date. The system relies on you to keep it current. This is the #1
|
|
363
390
|
failure mode.**
|
|
364
391
|
|
|
392
|
+
### Content fade — write-and-forget is safe (0.8.x)
|
|
393
|
+
Un-recalled engrams gradually fade their content while preserving cue pathways
|
|
394
|
+
(concept + tags + embedding stay intact). This is Paper 1 — storage
|
|
395
|
+
degradation. Practical implications:
|
|
396
|
+
|
|
397
|
+
- **Don't manually purge memories** to "save space." The system already
|
|
398
|
+
compresses unused content. Old memories stay findable via cue match even
|
|
399
|
+
when their body has decayed.
|
|
400
|
+
- **Don't over-pin with \`memory_class: canonical\`** to fight fade. Canonical
|
|
401
|
+
only changes salience gating at write time, not fade behavior. Fade
|
|
402
|
+
affects un-recalled engrams of any class.
|
|
403
|
+
- **Recall keeps content alive.** Every recall touches the engram and resets
|
|
404
|
+
its fade clock. Frequently-recalled memories stay full-fidelity automatically.
|
|
405
|
+
- **Supersede is the right tool for stale facts.** When you observe a memory
|
|
406
|
+
is outdated, call \`memory_supersede\` — the new version inherits the old
|
|
407
|
+
one's coherent associations (counter-narrative replacement, 0.8.x) so cue
|
|
408
|
+
pathways carry forward to the replacement.
|
|
409
|
+
|
|
365
410
|
### Example — good vs bad memory_write
|
|
366
411
|
|
|
367
412
|
**BAD** (no prefix tags, vague concept, can't be recalled by future queries):
|
|
@@ -392,19 +437,61 @@ memory_write(
|
|
|
392
437
|
- AWM is shared across all agents in real time. When any agent writes or supersedes a
|
|
393
438
|
memory, every other agent can recall it immediately.
|
|
394
439
|
|
|
440
|
+
### Backend (SQLite vs PGlite, 0.8.x)
|
|
441
|
+
AWM ships two storage backends. The installer picks SQLite by default; both
|
|
442
|
+
are functionally equivalent for cognitive workloads, but differ in operational
|
|
443
|
+
guarantees:
|
|
444
|
+
|
|
445
|
+
- **SQLite** (default) — embedded, **multi-process safe** via WAL mode. Best
|
|
446
|
+
for single-machine setups and MCP scenarios where multiple Claude Code
|
|
447
|
+
sessions may open the same database concurrently.
|
|
448
|
+
- **PGlite** — embedded Postgres (WASM) with pgvector. **Single-process only**
|
|
449
|
+
— two MCP processes against the same \`memory-pglite/\` directory will
|
|
450
|
+
abort the second. Pick via \`AWM_STORE_BACKEND=pglite\` and
|
|
451
|
+
\`AWM_DB_PATH=path/to/memory-pglite\`.
|
|
452
|
+
- **Auto-detect** — if \`AWM_DB_PATH\` points to a directory that already
|
|
453
|
+
exists, AWM detects PGlite; a file → SQLite. No explicit
|
|
454
|
+
\`AWM_STORE_BACKEND\` needed when an existing DB is present.
|
|
455
|
+
|
|
456
|
+
For the comparison table (recall quality parity, BM25 vs \`ts_rank_cd\`,
|
|
457
|
+
multi-process guarantees), see \`docs/pglite-feature-parity.md\`.
|
|
458
|
+
|
|
395
459
|
### Diagnostics / escape hatches (env vars, only if you know why)
|
|
396
|
-
The 0.7.6→0.7.14 work cut recall latency from 11s to ~300ms.
|
|
397
|
-
|
|
398
|
-
|
|
460
|
+
The 0.7.6→0.7.14 work cut recall latency from 11s to ~300ms. The 0.8.x work
|
|
461
|
+
added the write-path rewrite (per-write 300+ ms → under 10ms) and PGlite
|
|
462
|
+
parity tuning. Each optimization is gated by an env-var so it can be disabled
|
|
463
|
+
for A/B testing if a regression appears in your workload:
|
|
399
464
|
|
|
400
|
-
|
|
465
|
+
Recall pipeline (0.7.x):
|
|
466
|
+
- \`AWM_DISABLE_POOL_FILTER=1\` — disables the candidate pool reduction
|
|
401
467
|
pre-filter in recall. Reverts to scoring all active candidates.
|
|
402
|
-
- \`AWM_DISABLE_SLIM_CACHE=1\`
|
|
468
|
+
- \`AWM_DISABLE_SLIM_CACHE=1\` — disables the in-memory slim cache.
|
|
403
469
|
Reverts to per-recall SQL fetch + Buffer→Float32Array conversion.
|
|
404
|
-
- \`AWM_DISABLE_RERANK_SKIP=1\`
|
|
470
|
+
- \`AWM_DISABLE_RERANK_SKIP=1\` — disables the cross-encoder skip on
|
|
405
471
|
clear-winner queries. Forces every recall through the reranker.
|
|
406
|
-
- \`AWM_DISABLE_EXPANSION_CACHE=1\`
|
|
407
|
-
|
|
472
|
+
- \`AWM_DISABLE_EXPANSION_CACHE=1\` — disables the query expansion skip
|
|
473
|
+
heuristic + LRU cache. Forces every recall through flan-t5-small.
|
|
474
|
+
|
|
475
|
+
Write pipeline + lifecycle (0.8.x):
|
|
476
|
+
- \`AWM_REINFORCE_MAX_CONTENT_LEN=1500\` — max chars an engram's content
|
|
477
|
+
can grow to via merge-on-reinforce (drop-oldest on overflow). Higher =
|
|
478
|
+
preserves more reinforced detail; lower = leaner recall output.
|
|
479
|
+
- \`AWM_REINFORCE_MERGE_CONTENT=0\` — disable content merge on reinforce.
|
|
480
|
+
Reverts to pre-0.8.5 behavior (discard new content, only bump confidence).
|
|
481
|
+
- \`AWM_NOVELTY_EMBED=0\` — disable the cosine channel in novelty
|
|
482
|
+
computation. BM25-only fallback. Reverts to pre-0.8.5 novelty.
|
|
483
|
+
- \`AWM_GRANULARITY_COMPACT_LEN=200\` — char budget for query-aware snippet
|
|
484
|
+
in \`granularity: 'compact'\` mode.
|
|
485
|
+
- \`AWM_GRANULARITY_FULL_LEN=1000\` — char budget for the top result in
|
|
486
|
+
\`granularity: 'auto'\` mode when there's a clear winner.
|
|
487
|
+
|
|
488
|
+
PGlite backend (0.8.x):
|
|
489
|
+
- \`AWM_PGLITE_BM25_M=1\` — multiplier on PGlite \`ts_rank_cd\` to calibrate
|
|
490
|
+
against SQLite FTS5 BM25 distribution. M=1 (default) is passthrough;
|
|
491
|
+
higher M boosts PGlite scores at the cost of recall-ranking precision
|
|
492
|
+
(see CHANGELOG 0.8.5 follow-up).
|
|
493
|
+
- \`AWM_IVFFLAT_PROBES=5\` — pgvector ivfflat probes per query. Higher =
|
|
494
|
+
more accurate, slower.
|
|
408
495
|
|
|
409
496
|
In production, leave these all unset. Use only when diagnosing a suspected
|
|
410
497
|
recall-quality regression.
|
package/src/api/routes.ts
CHANGED
|
@@ -952,7 +952,7 @@ export function registerRoutes(app: FastifyInstance, deps: MemoryDeps): void {
|
|
|
952
952
|
const base: Record<string, unknown> = {
|
|
953
953
|
status: 'ok',
|
|
954
954
|
timestamp: new Date().toISOString(),
|
|
955
|
-
version: '0.8.
|
|
955
|
+
version: '0.8.6',
|
|
956
956
|
coordination: coordEnabled,
|
|
957
957
|
};
|
|
958
958
|
if (coordEnabled && typeof (deps.store as any).getDb === 'function') {
|
package/src/cli.ts
CHANGED
|
@@ -336,7 +336,7 @@ async function exportMemories() {
|
|
|
336
336
|
const agents = [...new Set(memories.map((m: any) => m.agent_id))];
|
|
337
337
|
|
|
338
338
|
const exportData = {
|
|
339
|
-
version: '0.8.
|
|
339
|
+
version: '0.8.6',
|
|
340
340
|
exported_at: new Date().toISOString(),
|
|
341
341
|
source_db: dbPath,
|
|
342
342
|
agent_filter: agentFilter,
|
package/src/mcp.ts
CHANGED
|
@@ -81,7 +81,7 @@ const INCOGNITO = process.env.AWM_INCOGNITO === '1' || process.env.AWM_INCOGNITO
|
|
|
81
81
|
|
|
82
82
|
if (INCOGNITO) {
|
|
83
83
|
console.error('AWM: incognito mode — all memory tools disabled, nothing will be recorded');
|
|
84
|
-
const server = new McpServer({ name: 'agent-working-memory', version: '0.8.
|
|
84
|
+
const server = new McpServer({ name: 'agent-working-memory', version: '0.8.6' });
|
|
85
85
|
const transport = new StdioServerTransport();
|
|
86
86
|
server.connect(transport).catch(err => {
|
|
87
87
|
console.error('MCP server failed:', err);
|
|
@@ -123,7 +123,7 @@ let coordDb: import('better-sqlite3').Database | null = null;
|
|
|
123
123
|
|
|
124
124
|
const server = new McpServer({
|
|
125
125
|
name: 'agent-working-memory',
|
|
126
|
-
version: '0.8.
|
|
126
|
+
version: '0.8.6',
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
server.registerResource(
|