audrey 1.1.3 → 1.2.1

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.
Files changed (285) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/README.md +39 -12
  3. package/dist/mcp-server/codex-hooks-probe.d.ts +22 -0
  4. package/dist/mcp-server/codex-hooks-probe.d.ts.map +1 -0
  5. package/dist/mcp-server/codex-hooks-probe.js +160 -0
  6. package/dist/mcp-server/codex-hooks-probe.js.map +1 -0
  7. package/dist/mcp-server/config.d.ts +26 -2
  8. package/dist/mcp-server/config.d.ts.map +1 -1
  9. package/dist/mcp-server/config.js +54 -22
  10. package/dist/mcp-server/config.js.map +1 -1
  11. package/dist/mcp-server/hooks.d.ts +28 -0
  12. package/dist/mcp-server/hooks.d.ts.map +1 -1
  13. package/dist/mcp-server/hooks.js +91 -2
  14. package/dist/mcp-server/hooks.js.map +1 -1
  15. package/dist/mcp-server/index.d.ts +242 -2
  16. package/dist/mcp-server/index.d.ts.map +1 -1
  17. package/dist/mcp-server/index.js +806 -240
  18. package/dist/mcp-server/index.js.map +1 -1
  19. package/dist/mcp-server/tool-schemas.d.ts +32 -2
  20. package/dist/mcp-server/tool-schemas.d.ts.map +1 -1
  21. package/dist/mcp-server/tool-schemas.js +55 -0
  22. package/dist/mcp-server/tool-schemas.js.map +1 -1
  23. package/dist/src/audrey.d.ts +14 -2
  24. package/dist/src/audrey.d.ts.map +1 -1
  25. package/dist/src/audrey.js +152 -28
  26. package/dist/src/audrey.js.map +1 -1
  27. package/dist/src/autopilot.d.ts +22 -0
  28. package/dist/src/autopilot.d.ts.map +1 -1
  29. package/dist/src/autopilot.js +271 -50
  30. package/dist/src/autopilot.js.map +1 -1
  31. package/dist/src/capsule.d.ts +23 -0
  32. package/dist/src/capsule.d.ts.map +1 -1
  33. package/dist/src/capsule.js +56 -11
  34. package/dist/src/capsule.js.map +1 -1
  35. package/dist/src/confidence.d.ts +9 -1
  36. package/dist/src/confidence.d.ts.map +1 -1
  37. package/dist/src/confidence.js +16 -2
  38. package/dist/src/confidence.js.map +1 -1
  39. package/dist/src/consolidate.d.ts +4 -0
  40. package/dist/src/consolidate.d.ts.map +1 -1
  41. package/dist/src/consolidate.js +206 -34
  42. package/dist/src/consolidate.js.map +1 -1
  43. package/dist/src/controller.d.ts +17 -1
  44. package/dist/src/controller.d.ts.map +1 -1
  45. package/dist/src/controller.js +244 -128
  46. package/dist/src/controller.js.map +1 -1
  47. package/dist/src/db.d.ts.map +1 -1
  48. package/dist/src/db.js +233 -56
  49. package/dist/src/db.js.map +1 -1
  50. package/dist/src/encode.d.ts +2 -1
  51. package/dist/src/encode.d.ts.map +1 -1
  52. package/dist/src/encode.js +41 -4
  53. package/dist/src/encode.js.map +1 -1
  54. package/dist/src/events.d.ts +48 -1
  55. package/dist/src/events.d.ts.map +1 -1
  56. package/dist/src/events.js +160 -62
  57. package/dist/src/events.js.map +1 -1
  58. package/dist/src/export.d.ts.map +1 -1
  59. package/dist/src/export.js +4 -4
  60. package/dist/src/export.js.map +1 -1
  61. package/dist/src/grounding.d.ts +111 -0
  62. package/dist/src/grounding.d.ts.map +1 -0
  63. package/dist/src/grounding.js +259 -0
  64. package/dist/src/grounding.js.map +1 -0
  65. package/dist/src/hybrid-recall.d.ts +16 -7
  66. package/dist/src/hybrid-recall.d.ts.map +1 -1
  67. package/dist/src/hybrid-recall.js +22 -11
  68. package/dist/src/hybrid-recall.js.map +1 -1
  69. package/dist/src/import.d.ts +10 -0
  70. package/dist/src/import.d.ts.map +1 -1
  71. package/dist/src/import.js +122 -22
  72. package/dist/src/import.js.map +1 -1
  73. package/dist/src/llm.d.ts.map +1 -1
  74. package/dist/src/llm.js +16 -0
  75. package/dist/src/llm.js.map +1 -1
  76. package/dist/src/preflight.d.ts.map +1 -1
  77. package/dist/src/preflight.js +89 -47
  78. package/dist/src/preflight.js.map +1 -1
  79. package/dist/src/project.d.ts +4 -1
  80. package/dist/src/project.d.ts.map +1 -1
  81. package/dist/src/project.js +65 -5
  82. package/dist/src/project.js.map +1 -1
  83. package/dist/src/recall.d.ts.map +1 -1
  84. package/dist/src/recall.js +138 -13
  85. package/dist/src/recall.js.map +1 -1
  86. package/dist/src/redact.d.ts +1 -1
  87. package/dist/src/redact.d.ts.map +1 -1
  88. package/dist/src/redact.js +185 -5
  89. package/dist/src/redact.js.map +1 -1
  90. package/dist/src/routes.d.ts.map +1 -1
  91. package/dist/src/routes.js +91 -18
  92. package/dist/src/routes.js.map +1 -1
  93. package/dist/src/trust.d.ts +35 -0
  94. package/dist/src/trust.d.ts.map +1 -0
  95. package/dist/src/trust.js +77 -0
  96. package/dist/src/trust.js.map +1 -0
  97. package/dist/src/types.d.ts +24 -0
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/package.json +3 -37
  100. package/benchmarks/adapter-kit.mjs +0 -20
  101. package/benchmarks/adapter-self-test.mjs +0 -170
  102. package/benchmarks/adapters/example-allow.mjs +0 -31
  103. package/benchmarks/adapters/mem0-platform.mjs +0 -274
  104. package/benchmarks/adapters/registry.json +0 -51
  105. package/benchmarks/adapters/zep-cloud.mjs +0 -304
  106. package/benchmarks/baselines.js +0 -174
  107. package/benchmarks/build-leaderboard.mjs +0 -183
  108. package/benchmarks/cases.js +0 -549
  109. package/benchmarks/create-conformance-card.mjs +0 -148
  110. package/benchmarks/create-submission-bundle.mjs +0 -190
  111. package/benchmarks/dry-run-external-adapters.mjs +0 -177
  112. package/benchmarks/guardbench.js +0 -1265
  113. package/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +0 -50
  114. package/benchmarks/output/external/guardbench-external-dry-run.json +0 -69
  115. package/benchmarks/output/external/guardbench-external-evidence.json +0 -56
  116. package/benchmarks/output/guardbench-conformance-card.json +0 -63
  117. package/benchmarks/output/guardbench-manifest.json +0 -414
  118. package/benchmarks/output/guardbench-raw.json +0 -1279
  119. package/benchmarks/output/guardbench-summary.json +0 -2123
  120. package/benchmarks/output/leaderboard/guardbench-leaderboard.json +0 -93
  121. package/benchmarks/output/leaderboard/guardbench-leaderboard.md +0 -7
  122. package/benchmarks/output/submission-bundle/guardbench-conformance-card.json +0 -63
  123. package/benchmarks/output/submission-bundle/guardbench-manifest.json +0 -414
  124. package/benchmarks/output/submission-bundle/guardbench-raw.json +0 -1279
  125. package/benchmarks/output/submission-bundle/guardbench-summary.json +0 -2123
  126. package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-registry.schema.json +0 -69
  127. package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-self-test.schema.json +0 -156
  128. package/benchmarks/output/submission-bundle/schemas/guardbench-conformance-card.schema.json +0 -184
  129. package/benchmarks/output/submission-bundle/schemas/guardbench-external-dry-run.schema.json +0 -74
  130. package/benchmarks/output/submission-bundle/schemas/guardbench-external-evidence.schema.json +0 -108
  131. package/benchmarks/output/submission-bundle/schemas/guardbench-external-run.schema.json +0 -160
  132. package/benchmarks/output/submission-bundle/schemas/guardbench-leaderboard.schema.json +0 -179
  133. package/benchmarks/output/submission-bundle/schemas/guardbench-manifest.schema.json +0 -213
  134. package/benchmarks/output/submission-bundle/schemas/guardbench-publication-verification.schema.json +0 -47
  135. package/benchmarks/output/submission-bundle/schemas/guardbench-raw.schema.json +0 -184
  136. package/benchmarks/output/submission-bundle/schemas/guardbench-submission-manifest.schema.json +0 -151
  137. package/benchmarks/output/submission-bundle/schemas/guardbench-summary.schema.json +0 -249
  138. package/benchmarks/output/submission-bundle/submission-manifest.json +0 -131
  139. package/benchmarks/output/submission-bundle/validation-report.json +0 -31
  140. package/benchmarks/output/summary.json +0 -2354
  141. package/benchmarks/perf-snapshot.js +0 -307
  142. package/benchmarks/perf.bench.js +0 -169
  143. package/benchmarks/public-paths.mjs +0 -97
  144. package/benchmarks/reference-results.js +0 -75
  145. package/benchmarks/report.js +0 -280
  146. package/benchmarks/run-external-guardbench.mjs +0 -303
  147. package/benchmarks/run.js +0 -735
  148. package/benchmarks/schemas/guardbench-adapter-registry.schema.json +0 -69
  149. package/benchmarks/schemas/guardbench-adapter-self-test.schema.json +0 -156
  150. package/benchmarks/schemas/guardbench-conformance-card.schema.json +0 -184
  151. package/benchmarks/schemas/guardbench-external-dry-run.schema.json +0 -74
  152. package/benchmarks/schemas/guardbench-external-evidence.schema.json +0 -108
  153. package/benchmarks/schemas/guardbench-external-run.schema.json +0 -160
  154. package/benchmarks/schemas/guardbench-leaderboard.schema.json +0 -179
  155. package/benchmarks/schemas/guardbench-manifest.schema.json +0 -213
  156. package/benchmarks/schemas/guardbench-publication-verification.schema.json +0 -47
  157. package/benchmarks/schemas/guardbench-raw.schema.json +0 -184
  158. package/benchmarks/schemas/guardbench-submission-manifest.schema.json +0 -151
  159. package/benchmarks/schemas/guardbench-summary.schema.json +0 -249
  160. package/benchmarks/snapshots/perf-0.22.2.json +0 -123
  161. package/benchmarks/snapshots/perf-0.23.0.json +0 -123
  162. package/benchmarks/validate-adapter-module.mjs +0 -107
  163. package/benchmarks/validate-adapter-registry.mjs +0 -145
  164. package/benchmarks/validate-adapter-self-test.mjs +0 -96
  165. package/benchmarks/validate-guardbench-artifacts.mjs +0 -400
  166. package/benchmarks/verify-external-evidence.mjs +0 -351
  167. package/benchmarks/verify-publication-artifacts.mjs +0 -309
  168. package/benchmarks/verify-submission-bundle.mjs +0 -172
  169. package/docs/AUDREY_PAPER_OUTLINE.md +0 -178
  170. package/docs/MEMORY_BENCHMARKING.md +0 -59
  171. package/docs/PRODUCTION_BACKLOG.md +0 -321
  172. package/docs/assets/audrey-feature-grid.jpg +0 -0
  173. package/docs/assets/audrey-logo.svg +0 -45
  174. package/docs/assets/audrey-wordmark.png +0 -0
  175. package/docs/paper/00-master.md +0 -48
  176. package/docs/paper/01-introduction.md +0 -27
  177. package/docs/paper/02-related-work.md +0 -47
  178. package/docs/paper/03-problem-definition.md +0 -108
  179. package/docs/paper/04-design.md +0 -164
  180. package/docs/paper/05-guardbench-spec.md +0 -412
  181. package/docs/paper/06-implementation.md +0 -115
  182. package/docs/paper/07-evaluation.md +0 -168
  183. package/docs/paper/08-discussion-limitations.md +0 -61
  184. package/docs/paper/09-conclusion.md +0 -11
  185. package/docs/paper/SUBMISSION_README.md +0 -162
  186. package/docs/paper/appendix-a-demo-transcript.md +0 -114
  187. package/docs/paper/arxiv-compile-report.schema.json +0 -116
  188. package/docs/paper/arxiv-source.schema.json +0 -61
  189. package/docs/paper/audrey-paper-v1.md +0 -1108
  190. package/docs/paper/browser-launch-plan.json +0 -209
  191. package/docs/paper/browser-launch-plan.schema.json +0 -100
  192. package/docs/paper/browser-launch-results.json +0 -86
  193. package/docs/paper/browser-launch-results.schema.json +0 -66
  194. package/docs/paper/claim-register.json +0 -138
  195. package/docs/paper/claim-register.schema.json +0 -81
  196. package/docs/paper/evidence-ledger.md +0 -103
  197. package/docs/paper/output/arxiv/README-arxiv.txt +0 -8
  198. package/docs/paper/output/arxiv/arxiv-manifest.json +0 -41
  199. package/docs/paper/output/arxiv/main.tex +0 -951
  200. package/docs/paper/output/arxiv/references.bib +0 -222
  201. package/docs/paper/output/arxiv-compile-report.json +0 -24
  202. package/docs/paper/output/submission-bundle/LICENSE +0 -21
  203. package/docs/paper/output/submission-bundle/README.md +0 -440
  204. package/docs/paper/output/submission-bundle/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +0 -50
  205. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-dry-run.json +0 -69
  206. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-evidence.json +0 -56
  207. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-conformance-card.json +0 -63
  208. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-manifest.json +0 -414
  209. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-raw.json +0 -1279
  210. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-summary.json +0 -2123
  211. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.json +0 -93
  212. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.md +0 -7
  213. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/submission-manifest.json +0 -131
  214. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/validation-report.json +0 -31
  215. package/docs/paper/output/submission-bundle/benchmarks/output/summary.json +0 -2354
  216. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-registry.schema.json +0 -69
  217. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-self-test.schema.json +0 -156
  218. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-conformance-card.schema.json +0 -184
  219. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-dry-run.schema.json +0 -74
  220. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-evidence.schema.json +0 -108
  221. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-run.schema.json +0 -160
  222. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-leaderboard.schema.json +0 -179
  223. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-manifest.schema.json +0 -213
  224. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-publication-verification.schema.json +0 -47
  225. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-raw.schema.json +0 -184
  226. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-submission-manifest.schema.json +0 -151
  227. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-summary.schema.json +0 -249
  228. package/docs/paper/output/submission-bundle/docs/AUDREY_PAPER_OUTLINE.md +0 -178
  229. package/docs/paper/output/submission-bundle/docs/paper/00-master.md +0 -48
  230. package/docs/paper/output/submission-bundle/docs/paper/01-introduction.md +0 -27
  231. package/docs/paper/output/submission-bundle/docs/paper/02-related-work.md +0 -47
  232. package/docs/paper/output/submission-bundle/docs/paper/03-problem-definition.md +0 -108
  233. package/docs/paper/output/submission-bundle/docs/paper/04-design.md +0 -164
  234. package/docs/paper/output/submission-bundle/docs/paper/05-guardbench-spec.md +0 -412
  235. package/docs/paper/output/submission-bundle/docs/paper/06-implementation.md +0 -115
  236. package/docs/paper/output/submission-bundle/docs/paper/07-evaluation.md +0 -168
  237. package/docs/paper/output/submission-bundle/docs/paper/08-discussion-limitations.md +0 -61
  238. package/docs/paper/output/submission-bundle/docs/paper/09-conclusion.md +0 -11
  239. package/docs/paper/output/submission-bundle/docs/paper/SUBMISSION_README.md +0 -162
  240. package/docs/paper/output/submission-bundle/docs/paper/appendix-a-demo-transcript.md +0 -114
  241. package/docs/paper/output/submission-bundle/docs/paper/arxiv-compile-report.schema.json +0 -116
  242. package/docs/paper/output/submission-bundle/docs/paper/arxiv-source.schema.json +0 -61
  243. package/docs/paper/output/submission-bundle/docs/paper/audrey-paper-v1.md +0 -1108
  244. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.json +0 -209
  245. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.schema.json +0 -100
  246. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.json +0 -86
  247. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.schema.json +0 -66
  248. package/docs/paper/output/submission-bundle/docs/paper/claim-register.json +0 -138
  249. package/docs/paper/output/submission-bundle/docs/paper/claim-register.schema.json +0 -81
  250. package/docs/paper/output/submission-bundle/docs/paper/evidence-ledger.md +0 -103
  251. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/README-arxiv.txt +0 -8
  252. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/arxiv-manifest.json +0 -41
  253. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/main.tex +0 -951
  254. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/references.bib +0 -222
  255. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv-compile-report.json +0 -24
  256. package/docs/paper/output/submission-bundle/docs/paper/paper-submission-bundle.schema.json +0 -70
  257. package/docs/paper/output/submission-bundle/docs/paper/publication-pack.json +0 -81
  258. package/docs/paper/output/submission-bundle/docs/paper/publication-pack.schema.json +0 -60
  259. package/docs/paper/output/submission-bundle/docs/paper/references.bib +0 -222
  260. package/docs/paper/output/submission-bundle/package.json +0 -235
  261. package/docs/paper/output/submission-bundle/paper-submission-manifest.json +0 -379
  262. package/docs/paper/paper-submission-bundle.schema.json +0 -70
  263. package/docs/paper/publication-pack.json +0 -81
  264. package/docs/paper/publication-pack.schema.json +0 -60
  265. package/docs/paper/references.bib +0 -222
  266. package/scripts/audit-release-completion.mjs +0 -440
  267. package/scripts/create-arxiv-source.mjs +0 -368
  268. package/scripts/create-paper-submission-bundle.mjs +0 -214
  269. package/scripts/finalize-release.mjs +0 -601
  270. package/scripts/prepare-release-cut.mjs +0 -277
  271. package/scripts/publish-release-bundle.mjs +0 -252
  272. package/scripts/publish-release-github-api.mjs +0 -494
  273. package/scripts/run-vitest.mjs +0 -34
  274. package/scripts/smoke-cli.js +0 -92
  275. package/scripts/sync-paper-artifacts.mjs +0 -112
  276. package/scripts/verify-arxiv-compile.mjs +0 -476
  277. package/scripts/verify-arxiv-source.mjs +0 -224
  278. package/scripts/verify-browser-launch-plan.mjs +0 -254
  279. package/scripts/verify-browser-launch-results.mjs +0 -303
  280. package/scripts/verify-paper-artifacts.mjs +0 -798
  281. package/scripts/verify-paper-claims.mjs +0 -254
  282. package/scripts/verify-paper-submission-bundle.mjs +0 -218
  283. package/scripts/verify-publication-pack.mjs +0 -210
  284. package/scripts/verify-python-package.py +0 -201
  285. package/scripts/verify-release-readiness.mjs +0 -920
@@ -1,321 +0,0 @@
1
- # Audrey Production Backlog
2
-
3
- Updated: 2026-07-10 for the Audrey 1.1 Autopilot release candidate.
4
-
5
- This file tracks release posture and remaining product work. It is intentionally
6
- public-safe: it avoids exploit recipes, stale line references, and private
7
- planning notes.
8
-
9
- ## Current Release Posture
10
-
11
- Audrey 1.0.0 and 1.0.1 remain the published historical baseline. The 1.1.0
12
- working tree adds automatic Claude Code and Codex lifecycle integration and is
13
- released only after it passes the full gate:
14
-
15
- ```bash
16
- npm run release:gate
17
- npm run release:gate:paper
18
- npm run release:cut:plan
19
- npm run release:readiness
20
- npm run python:release:check
21
- npm run smoke:cli
22
- npm run pack:check
23
- npm run security:audit
24
- npx audrey doctor
25
- npx audrey status --fail-on-unhealthy
26
- python -m unittest discover -s python/tests -v
27
- python -m build --no-isolation python
28
- ```
29
-
30
- `npm run release:readiness` is intentionally pending-aware. It exits cleanly
31
- when local code and paper artifacts verify but the final 1.1 release is still
32
- blocked on source-control release state, GitHub Release object readiness, npm
33
- registry/auth readiness, PyPI publish readiness, authenticated browser
34
- publication URLs, live Mem0/Zep evidence, or npm/PyPI account steps. Use
35
- `npm run release:readiness:strict` only when cutting the actual 1.1 release;
36
- strict mode must fail until those publish blockers are resolved.
37
- `npm run release:cut:plan` is the dry-run version/changelog cut. It previews
38
- the edits that `npm run release:cut:apply -- --target-version 1.1.0` would
39
- write to `package.json`, `package-lock.json`, `mcp-server/config.ts`,
40
- `python/audrey_memory/_version.py`, and `CHANGELOG.md`. The changelog plan is
41
- publishable release-note copy rather than TODO scaffolding, and strict
42
- readiness rejects placeholder markers if a manual edit reintroduces them.
43
-
44
- `npm test` now routes through `scripts/run-vitest.mjs`, which sets `TEMP`,
45
- `TMP`, and `TMPDIR` to `.tmp-vitest` before Vitest starts. That removes the
46
- previous locked-down Windows temp-directory startup failure while keeping
47
- `npm run release:gate:sandbox` available for hosts that block child-process
48
- spawning entirely.
49
-
50
- ## Guard Chassis And 1.1 Autopilot
51
-
52
- The Guard chassis shipped across the 0.23 and 1.0 lines. Audrey 1.1 adds the
53
- automatic host loop:
54
-
55
- - `audrey install --host auto` discovers installed Claude Code and Codex CLIs,
56
- registers the MCP server, and applies host-specific hooks from stable Node
57
- and Audrey entrypoints. It preserves unrelated configuration, backs up
58
- non-empty files, replaces older Audrey-owned handlers, and is idempotent.
59
- - One host adapter normalizes session start, prompt submission, pre-tool,
60
- post-tool, post-compaction, and stop events. It injects bounded memory,
61
- creates Guard receipts, correlates outcomes by `session_id + tool_use_id`,
62
- forms sanitized failure memories, and runs maintenance only when due.
63
- - Codex project and user hooks require one-time review through `/hooks`;
64
- Claude Code supports local, project, and user scopes. Hook failures remain
65
- fail-open unless `AUDREY_HOOK_FAIL_CLOSED=1` is set.
66
-
67
- The underlying Guard chassis includes:
68
-
69
- - `src/controller.ts` adds `MemoryController.beforeAction()` and
70
- `afterAction()` over the existing tool-trace, reflex, preflight, capsule,
71
- validation, and impact primitives.
72
- - `npx audrey guard --tool <Tool> "<action>"` runs the controller from the
73
- terminal, prints a screenshot-friendly guard decision, emits nonzero on
74
- `block`, and supports `--json`, `--explain`, `--override`, and
75
- `--fail-on-warn`.
76
- - `npx audrey demo --scenario repeated-failure` is the deterministic
77
- no-network demo: a deploy fails once, Audrey records it, the next preflight
78
- blocks the repeat with evidence, and `impact` records the helpful validation.
79
- - `Audrey.encodeBatch()` now uses provider-level `embedBatch()` instead of
80
- issuing one embedding call per episode.
81
- - Guard exact-failure matching redacts before trimming, treats tool names
82
- case-insensitively, and includes file scope in the action hash so unrelated
83
- edits do not collide.
84
- - Validation feedback can now bind to the exact `preflight_event_id`, evidence
85
- id set, and Guard action fingerprint that surfaced a memory; Audrey rejects
86
- lineage claims when the validated memory was not preflight evidence.
87
- - `npx audrey guard --hook --fail-on-warn` consumes Claude Code `PreToolUse`
88
- JSON from stdin and emits the current `hookSpecificOutput.permissionDecision`
89
- shape; `npx audrey hook-config claude-code` generates PreToolUse and
90
- PostToolUse command hooks, with failed outcomes inferred from the
91
- PostToolUse hook payload.
92
- - `npx audrey hook-config claude-code --apply --scope project|user` now merges
93
- those hooks into Claude Code settings, preserves unrelated settings/hooks,
94
- dedupes Audrey handlers, and writes a timestamped backup before changing an
95
- existing settings file.
96
- - `npm run bench:guard:check` now publishes local GuardBench comparative
97
- numbers for ten pre-action scenarios across Audrey Guard, no-memory,
98
- recent-window, vector-only, and FTS-only adapters, including repeated failure
99
- prevention, recovered-path suppression, recall degradation, redaction safety,
100
- and noisy memory-store control recall.
101
- - GuardBench now accepts external ESM adapters with `--adapter`, withholds
102
- expected decisions/evidence during adapter execution, and emits manifest,
103
- raw-output, and machine-provenance artifacts.
104
- - `npm run bench:guard:adapter-smoke` exercises the external adapter loader
105
- through the real CLI path with a credential-free example adapter.
106
- - `benchmarks/adapters/mem0-platform.mjs` is the first concrete external-system
107
- adapter. It uses Mem0 Platform REST APIs with runtime-only `MEM0_API_KEY`,
108
- async add/event polling, V2 search, and user-entity cleanup.
109
- - `npm run bench:guard:mem0` wraps the live Mem0 run in a reproducible external
110
- GuardBench evidence bundle with runtime-env checks and
111
- `external-run-metadata.json`; `--dry-run` captures the exact command without
112
- needing credentials.
113
- - `npm run release:gate:paper` is the publication gate: it rebuilds, typechecks,
114
- refreshes performance and behavioral benchmark outputs, runs GuardBench,
115
- syncs README/paper/ledger metrics from JSON artifacts, verifies paper
116
- consistency and redaction hygiene, runs the pending-aware 1.1 readiness
117
- checklist, then runs the CLI smoke test and npm pack dry-run.
118
- - Preflight now performs a supplemental tagged control-memory sweep for
119
- trusted `must-follow` memories so high-salience rules survive irrelevant
120
- memory noise.
121
- - Recall partial-failure diagnostics now propagate into capsules and strict
122
- Guard preflights, so degraded vector/FTS paths become blocking memory-health
123
- warnings instead of silent empty context.
124
- - `/v1/status` and `memory_status` expose the latest recall degradation check
125
- with the failing path and error message.
126
- - `npm test` and `npm run test:watch` use the repo-local Vitest temp launcher,
127
- so full Vitest is no longer dependent on a writable user temp directory.
128
- - `docs/AUDREY_PAPER_OUTLINE.md` defines the publishable Audrey Guard thesis
129
- and the GuardBench evaluation plan.
130
-
131
- Still not production-complete Guard: hooks can inspect only the lifecycle
132
- events and tool paths emitted by each trusted host, each event starts a
133
- short-lived Audrey process rather than using a persistent local daemon, and
134
- validation feedback is recorded but does not yet tune risk scoring.
135
-
136
- ## Shipped In The 0.22.2 Correctness Pass
137
-
138
- - Two CodeRabbit review passes plus a CodeQL audit landed: see `CHANGELOG.md#0222---2026-05-01`.
139
- Net result: every critical and major finding from the first pass was
140
- eliminated; the second pass surfaced a duplicate of the `vec_*.state`
141
- stale-denormalization bug in `src/interference.ts` and an API-key auth
142
- length-leak in `src/routes.ts`, both fixed.
143
- - `GET /v1/impact` REST route + Python `impact()` on sync and async clients.
144
- `analytics()` is now an alias of `impact()`.
145
- - Python integration tests unskipped; they spin up the real TS REST sidecar
146
- and exercise encode → recall → mark_used → impact → snapshot → restore.
147
- - Legitimate performance benchmarks (`npm run bench:perf-snapshot`) replace
148
- the synthetic-baseline SVGs that previously shipped in README.
149
-
150
- ## Shipped In The 0.22.1 Hardening Pass
151
-
152
- - Agent-scoped encode, recall, greeting, capsule, preflight, reflex, and
153
- consolidation paths.
154
- - Admin export, import, and forget tools/routes fail closed unless
155
- `AUDREY_ENABLE_ADMIN_TOOLS=1` is set.
156
- - Snapshot import uses bounded schemas for memory rows, config, events,
157
- consolidation history, and content size.
158
- - Export/import now preserves `memory_events` and consolidated-memory agent
159
- ownership.
160
- - Stored memory content is wrapped as untrusted data before LLM extraction,
161
- contradiction, reflection, and rule-promotion prompts.
162
- - Local embeddings are the default. Cloud embedding providers require explicit
163
- `AUDREY_EMBEDDING_PROVIDER`.
164
- - MCP stdio now exposes memory tools, `audrey://status`, `audrey://recent`,
165
- `audrey://principles`, and briefing/recall/reflection prompt templates.
166
- - Python package metadata builds cleanly as `audrey-memory 0.22.1`.
167
- - Release scripts separate full CI (`release:gate`) from a reduced gate
168
- (`release:gate:sandbox`) for hosts that cannot start Vitest.
169
-
170
- ## Release Evidence To Keep Current
171
-
172
- Before publishing a new npm or Python package, capture:
173
-
174
- - `npm run release:gate` on a normal CI host.
175
- - `npm run release:gate:sandbox` on locked-down local hosts.
176
- - `npm run release:gate:paper` before publishing the paper, npm package, or
177
- public launch posts that quote benchmark numbers.
178
- - `npm run release:readiness -- --json` to capture the current 1.1 prompt-to-artifact checklist.
179
- - `npm run release:readiness:strict -- --json` immediately before npm publish, PyPI publish, and browser launch are claimed complete.
180
- - `npm run release:cut:plan -- --target-version 1.1.0 --json` before applying the final version/changelog bump.
181
- - `npm run python:release:check` to build wheel/sdist artifacts, inspect package metadata, check for local path leakage, and run `twine check`.
182
- - `npm run smoke:cli` and `npm run pack:check` to exercise the public CLI and inspect the npm tarball contents.
183
- - `npm run security:audit`.
184
- - `npm ci --dry-run`.
185
- - Direct stdio MCP smoke: initialize, `tools/list`, `resources/list`,
186
- `prompts/list`, `resources/read audrey://status`.
187
- - `npx audrey --version`, `npx audrey doctor --json`, and
188
- `npx audrey status --json --fail-on-unhealthy`.
189
- - Python unit tests and `npm run python:release:check`.
190
-
191
- ## P0: Next Release Blockers
192
-
193
- 1. Replace per-event process startup with a persistent local runtime, and add a
194
- real-host compatibility matrix that measures cold/warm latency and records
195
- which tool paths each supported Claude Code and Codex version emits.
196
- 2. Run the Mem0 Platform and Zep Cloud adapters with real runtime keys,
197
- publish their raw per-scenario outputs, then add Letta/Graphiti-style
198
- adapters.
199
- 3. Use validation feedback to tune warning priority, recommendation wording,
200
- and repeated-risk suppression without giving the model direct policy
201
- control.
202
- 4. Add MCP tool-risk policy inputs: descriptor fingerprints, annotation hints,
203
- trusted-server status, and descriptor drift warnings.
204
-
205
- ## Historical 1.0 / Paper Publish Snapshot
206
-
207
- The following rows preserve the publication state recorded during the 2026-05-13
208
- paper pass. They are evidence history, not the current 1.1 release checklist:
209
-
210
- - Source control is partially released remotely but not coherent yet: live
211
- GitHub refs now show `release/audrey-1.0.0` at `83eb0ad` while `v1.0.0` is
212
- still tag object `9a22dca` peeled to older commit `b3430fa`. Reconcile or
213
- recreate the tag on the final release commit before treating 1.0 as cut. This
214
- sandbox still cannot write `.git` metadata, the local `origin/master`
215
- tracking ref is stale versus live `53761da`, and the working tree still has
216
- uncommitted release/launch evidence changes. Fetch/reconcile from a
217
- credentialed host or a clean temporary clone before treating this checkout as
218
- source-control ready.
219
- - The GitHub tag exists, but the public GitHub Releases API currently returns
220
- `404` for `v1.0.0`, and this browser session is not signed into GitHub. Publish
221
- a stable GitHub Release from the verified tag and attach or link the paper and
222
- submission artifacts before strict readiness can pass.
223
- - npm publish readiness still needs CLI authentication: `audrey@1.0.0` is not
224
- published on the registry and `npm whoami` currently returns E401. The local
225
- tarball smoke now passes through `npm run npm:smoke`, including clean-consumer
226
- install, ESM import, encode/recall, and both CLI shims.
227
- - PyPI publish readiness still needs runtime credentials or trusted-publisher
228
- evidence for the final `audrey-memory` upload.
229
- - Browser launch results are still not complete: LinkedIn, Reddit, and Hacker
230
- News are submitted and verified, arXiv is account-authorization blocked under
231
- support ticket `AH-190018`, and X still needs a logged-in posting session. The
232
- first r/LocalLLaMA attempt was removed for insufficient subreddit karma, so
233
- the recorded Reddit launch URL is now the rule-checked r/ClaudeCode Showcase
234
- post. Audrey-specific Reddit replies in that thread now include the GitHub
235
- repo URL, including the PreToolUse/permissions.deny exchange and Moriarty's
236
- GuardBench feedback thread. The first Hacker News Show HN path was
237
- account-restricted, so the recorded Hacker News launch URL is the verified
238
- neutral link submission.
239
- - Mem0 and Zep GuardBench evidence is still dry-run/pending until
240
- `MEM0_API_KEY` and `ZEP_API_KEY` are provided at runtime and strict external
241
- evidence passes.
242
- - npm/PyPI publishing still needs account authentication and OTP handling.
243
- - Production `npm audit --omit=dev --audit-level=moderate` is clean after the
244
- latest transitive `protobufjs` lockfile refresh.
245
-
246
- ## P1: Product Quality
247
-
248
- 1. Add `memory_ask` / `recallAuto()` for callers that should not choose a
249
- retrieval strategy manually.
250
- 2. Add adaptive hybrid recall weighting behind an environment flag, then compare
251
- against the current benchmark output before making it default.
252
- 3. Benchmark `encodeBatch` across mock, OpenAI, and Gemini providers before
253
- claiming cloud-provider speedups.
254
- 4. Add a visible `audrey impact` or dashboard story that shows memories used,
255
- helpful, wrong, decayed, and promoted over time.
256
- 5. Add install smoke tests for generated Codex, Claude Code, VS Code, Cursor,
257
- and Windsurf MCP configs.
258
-
259
- ## P2: Hardening And Scale
260
-
261
- 1. Move large local embedding dependencies to optional install paths if package
262
- size becomes a distribution blocker.
263
- 2. Add event-log retention controls for long-running tool-trace stores.
264
- 3. Add signed import/export bundles for cross-machine memory transfer.
265
- 4. Cache prepared statements on hot recall paths if production profiling shows
266
- SQLite prepare overhead above budget.
267
- 5. Add bitemporal belief fields for facts that change over time.
268
-
269
- ## Commercial Wedge
270
-
271
- The product wedge remains "memory before action": Audrey should prevent agents
272
- from repeating known bad actions, ignoring known workflows, or acting without
273
- the context they already earned. The strongest paid surface is likely team
274
- memory operations: policy editor, memory diff/rollback, audit log, shared
275
- encrypted stores, hosted relay, CI gates, and support.
276
-
277
- ## Historical v0.23 Product Direction
278
-
279
- A 2026-05-01 audit recommends repositioning Audrey from a generic local
280
- memory framework to **Audrey Guard** — a local-first memory firewall whose
281
- single job is to stop AI coding agents from repeating expensive mistakes
282
- before they touch tools. The core loop already exists in pieces in this
283
- repo (`observeTool`, `preflight`, `reflexes`, `validate`, `impact`,
284
- `promote`); the v0.23 work would be making them feel like one product
285
- loop instead of separate primitives.
286
-
287
- Open questions before committing to the rename:
288
-
289
- - Is the marketing surface ("memory firewall for coding agents") narrower
290
- than the actual product can support across non-coding agents?
291
- - Does keeping the current "local memory runtime" framing for the OSS core
292
- while branding the guard CLI separately give us the same wedge without
293
- abandoning existing positioning?
294
-
295
- Concrete v0.23 work the audit identified, with shipped items marked:
296
-
297
- 1. Shipped in 1.1: host hook wiring for Claude Code and Codex so Guard runs
298
- automatically before supported tool use and outcomes feed trace/validation
299
- surfaces.
300
- 2. Shipped: Memory Controller Layer (`src/controller.ts`) that owns
301
- `beforeAction(action) → GuardResult` and
302
- `afterAction(outcome) → void` over the existing primitives. This
303
- chassis also enables splitting `src/audrey.ts` (now ~1.2K lines) into
304
- focused services.
305
- 3. Benchmark the new batched `Audrey.encodeBatch()` path across mock, OpenAI,
306
- and Gemini providers before claiming cloud-provider speedups.
307
- 4. Hybrid-recall N+1: batch the FTS-only row loaders in
308
- `src/hybrid-recall.ts` by type instead of per-id SELECTs.
309
- 5. Persist recall-degradation history in the event log so status can show more
310
- than the latest in-process check.
311
- 6. Move the heavy local embedding dependency
312
- (`@huggingface/transformers` + ONNX) to `optionalDependencies` so
313
- non-local-provider users don't pay the install size.
314
- 7. Expand FTS-only confidence in hybrid recall through the same
315
- confidence/scoring pipeline used by vector candidates.
316
- 8. Add `AUDREY_STRICT_ISOLATION=1` and make strict agent scope the
317
- default before team scopes ship.
318
-
319
- The "first paid feature" line of work — encrypted blob sync of local
320
- Audrey stores ("Audrey Cloud Sync") — remains the smallest commercial
321
- primitive that doesn't require rebuilding the product around hosted Postgres.
Binary file
@@ -1,45 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="960" height="300" viewBox="0 0 960 300" role="img" aria-labelledby="title desc">
2
- <title id="title">Audrey logo</title>
3
- <desc id="desc">A luminous memory orb and Audrey wordmark for a local-first AI memory runtime.</desc>
4
- <defs>
5
- <radialGradient id="orb" cx="42%" cy="35%" r="70%">
6
- <stop offset="0%" stop-color="#f7dfad"/>
7
- <stop offset="42%" stop-color="#d08f61"/>
8
- <stop offset="78%" stop-color="#3b5f72"/>
9
- <stop offset="100%" stop-color="#172a31"/>
10
- </radialGradient>
11
- <linearGradient id="ring" x1="68" x2="242" y1="56" y2="238" gradientUnits="userSpaceOnUse">
12
- <stop offset="0%" stop-color="#f2c777"/>
13
- <stop offset="50%" stop-color="#78a6ad"/>
14
- <stop offset="100%" stop-color="#273d45"/>
15
- </linearGradient>
16
- <linearGradient id="word" x1="302" x2="814" y1="94" y2="218" gradientUnits="userSpaceOnUse">
17
- <stop offset="0%" stop-color="#f4d7a1"/>
18
- <stop offset="46%" stop-color="#d08f61"/>
19
- <stop offset="100%" stop-color="#85aeb2"/>
20
- </linearGradient>
21
- <filter id="softGlow" x="-30%" y="-30%" width="160%" height="160%">
22
- <feGaussianBlur stdDeviation="8" result="blur"/>
23
- <feMerge>
24
- <feMergeNode in="blur"/>
25
- <feMergeNode in="SourceGraphic"/>
26
- </feMerge>
27
- </filter>
28
- </defs>
29
-
30
- <rect width="960" height="300" rx="36" fill="#0f171a"/>
31
- <path d="M54 228C131 266 220 247 274 181C324 120 320 61 270 42C224 25 154 50 103 99C56 144 30 193 54 228Z" fill="#122126"/>
32
- <circle cx="158" cy="150" r="74" fill="url(#orb)" filter="url(#softGlow)"/>
33
- <path d="M105 163C126 138 151 128 180 134C204 139 219 154 222 177" fill="none" stroke="#f8e7c7" stroke-width="8" stroke-linecap="round"/>
34
- <path d="M98 132C123 106 153 98 188 108C214 115 233 132 244 159" fill="none" stroke="#1d3037" stroke-width="10" stroke-linecap="round"/>
35
- <path d="M84 190C113 207 145 212 180 205C217 197 247 176 269 142" fill="none" stroke="url(#ring)" stroke-width="5" stroke-linecap="round"/>
36
- <path d="M86 109C113 78 149 60 194 57C231 55 261 66 284 90" fill="none" stroke="url(#ring)" stroke-width="4" stroke-linecap="round" opacity="0.85"/>
37
- <circle cx="83" cy="190" r="7" fill="#f2c777"/>
38
- <circle cx="284" cy="90" r="6" fill="#85aeb2"/>
39
- <circle cx="269" cy="142" r="5" fill="#f8e7c7"/>
40
-
41
- <text x="320" y="150" fill="url(#word)" font-family="Georgia, 'Times New Roman', serif" font-size="88" font-weight="700" letter-spacing="-3">Audrey</text>
42
- <text x="326" y="198" fill="#c7d0cc" font-family="'Segoe UI', Candara, sans-serif" font-size="24" letter-spacing="4">LOCAL-FIRST MEMORY FOR AGENTS</text>
43
- <path d="M327 219H811" stroke="#30484d" stroke-width="2"/>
44
- <text x="326" y="250" fill="#8ea19b" font-family="'Segoe UI', Candara, sans-serif" font-size="20">recall / preflight / reflexes / consolidation / one SQLite brain</text>
45
- </svg>
Binary file
@@ -1,48 +0,0 @@
1
- # Agent Memory Should Control Tool Use: Audrey Guard and Pre-Action Memory Control
2
-
3
- ## Abstract
4
-
5
- Agent memory should be judged by whether it changes future tool actions, not only by whether it retrieves relevant text. Audrey implements a local-first pre-action memory controller that converts prior tool outcomes, procedures, contradictions, recall health, and redacted traces into auditable `allow`, `warn`, or `block` decisions before an agent acts. The system builds bounded memory capsules, scores preflight risk, generates evidence-linked reflexes, blocks exact repeated failures through deterministic action identity hashing, and closes the loop through post-action validation and impact reporting. This paper frames the scientific category as pre-action memory control and the artifact as Audrey Guard. The Stage-A version reports implemented Audrey evidence: the controller and CLI, redaction-first tool tracing, recall-degradation handling, the canonical 0.22.2 performance snapshot, the current behavioral regression gate output, the local comparative GuardBench run, and the deterministic repeated-failure demo. It also specifies GuardBench as the evaluation methodology for future cross-system comparison.
6
-
7
- ## Table of Contents and Authoring Status
8
-
9
- | Section | File | Status | Owner |
10
- |---|---|---|---|
11
- | 0. Master, abstract, status | `00-master.md` | Draft initialized | Codex |
12
- | 1. Introduction | `01-introduction.md` | Draft complete | Claude strategy, Codex draft |
13
- | 2. Related Work | `02-related-work.md` | Draft complete | Claude citation strategy, Codex draft |
14
- | 3. Problem Definition | `03-problem-definition.md` | Draft complete | Codex |
15
- | 4. Design | `04-design.md` | Draft complete | Codex |
16
- | 5. GuardBench Specification | `05-guardbench-spec.md` | Draft complete | Claude spec review, Codex draft |
17
- | 6. Implementation | `06-implementation.md` | Draft complete | Codex |
18
- | 7. Evaluation | `07-evaluation.md` | Draft complete | Codex with Claude anti-claim review |
19
- | 8. Discussion and Limitations | `08-discussion-limitations.md` | Draft complete | Claude review, Codex draft |
20
- | 9. Conclusion | `09-conclusion.md` | Draft complete | Codex |
21
- | Consolidated v1 master | `audrey-paper-v1.md` | Assembled | Codex |
22
- | Appendix A. Demo Transcript | `appendix-a-demo-transcript.md` | Draft complete | Codex |
23
- | Appendix B. Evidence Ledger | `evidence-ledger.md` | Initialized and populated | Codex |
24
- | References | `references.bib` | Initialized with primary URLs; benchmark citations added | Codex |
25
-
26
- ## Current Draft Constraints
27
-
28
- - Quote benchmark numbers from `benchmarks/snapshots/perf-0.22.2.json`, not the README sample table (Ledger: E28).
29
- - Treat GuardBench Stage A as a specification contribution plus local comparative result, not completed external-system results.
30
- - Cite external claims only from primary papers, official documentation, official repositories, or first-party project posts.
31
- - Keep claims about Audrey tied to evidence-ledger IDs.
32
- - Keep section-body ledger references while drafting; remove them during final submission polish after claims are stable.
33
-
34
- ## Assembled Draft Preview
35
-
36
- | Order | File | Lines |
37
- |---|---|---:|
38
- | Master | `audrey-paper-v1.md` | 921 |
39
- | 1 | `01-introduction.md` | 27 |
40
- | 2 | `02-related-work.md` | 47 |
41
- | 3 | `03-problem-definition.md` | 108 |
42
- | 4 | `04-design.md` | 162 |
43
- | 5 | `05-guardbench-spec.md` | 242 |
44
- | 6 | `06-implementation.md` | 113 |
45
- | 7 | `07-evaluation.md` | 124 |
46
- | 8 | `08-discussion-limitations.md` | 61 |
47
- | 9 | `09-conclusion.md` | 11 |
48
- | Appendix A | `appendix-a-demo-transcript.md` | 114 |
@@ -1,27 +0,0 @@
1
- # 1. Introduction
2
-
3
- Tool-using agents fail in ways that ordinary chat-memory evaluation does not measure. They repeat broken shell commands after a previous run already exposed the error. They ignore project-specific setup rules that were learned in an earlier session. They lose the causal link between a failed action and the fix that made a later action safe. They treat degraded retrieval as complete memory and act anyway. In Audrey's repeated-failure demo, an agent first runs `npm run deploy` and fails because the Prisma client was not generated. Audrey records the failed tool event, stores the operational rule, and blocks the same action when it is proposed again. The transcript ends with the intended behavior of pre-action memory control: "Audrey saw the agent fail once. Audrey stopped it from failing twice." (Ledger: E25, E42)
4
-
5
- Most memory evaluation frames do not test this behavior. MTEB evaluates text embeddings across retrieval and representation tasks [@muennighoff2023mteb]. LongMemEval evaluates chat assistants on information extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention over long interaction histories [@wu2025longmemeval]. LoCoMo evaluates very long-term conversational memory through question answering, summarization, and multimodal dialogue generation [@maharana2024locomo]. These benchmarks are valuable, but their output target is retrieved context or an answer. They do not ask whether memory changed a future tool action before the action reached the shell, file system, browser, API, or MCP server.
6
-
7
- This paper defines pre-action memory control as a distinct systems problem. A controller receives a proposed tool action and remembered state before execution, then returns an auditable `allow`, `warn`, or `block` decision with evidence. Section 3 gives the formal input and output contract, desired behavior properties, threat model, and scope boundaries. The key shift is the evaluation target: memory is judged by its effect on action selection, not only by the relevance of retrieved text.
8
-
9
- Audrey Guard is the artifact studied in this paper. It is a local-first memory controller for agents that observes tool outcomes, redacts traces, retrieves relevant memory, constructs a bounded capsule, scores preflight risk, generates reflexes, returns `allow`/`warn`/`block`, and validates whether memory helped after the action path completes (Ledger: E1-E17). The implementation is exposed through MCP, CLI, REST, and Python client surfaces, while the core guard path runs host-side before tool execution (Ledger: E18-E19, E26, E32-E36).
10
-
11
- This paper makes six contributions:
12
-
13
- 1. It formalizes pre-action memory control as a problem separate from chat recall, retrieval accuracy, and long-context question answering (Section 3).
14
-
15
- 2. It presents Audrey Guard, a local-first controller that converts remembered failures, procedures, contradictions, recall health, and redacted tool traces into `allow`, `warn`, or `block` decisions before tool use (Sections 4 and 6; Ledger: E1-E15, E29-E40).
16
-
17
- 3. It introduces deterministic action identity for repeated-failure prevention: tool, redacted command, normalized working directory, and sorted file scope are hashed and matched against prior failed tool events (Sections 4, 6, and 7; Ledger: E3, E25, E42).
18
-
19
- 4. It implements a redaction-first tool-trace path so guard evidence can reference prior tool input, output, and error summaries without storing raw secrets in durable memory (Sections 4 and 6; Ledger: E12-E13).
20
-
21
- 5. It treats recall degradation as a control signal: missing vector tables, KNN failures, and FTS failures propagate as `RecallError[]`, appear in capsules, and become high-severity preflight warnings under strict guard mode (Sections 4 and 6; Ledger: E7, E9-E10, E15, E40).
22
-
23
- 6. It specifies GuardBench, a reproducibility contract for measuring whether memory changes future tool actions, including scenarios, baselines, metrics, redaction sweeps, machine provenance, and raw per-scenario outputs (Section 5).
24
-
25
- The empirical scope is Stage A. This paper reports implemented Audrey evidence: the controller and CLI guard path, redaction-first tool tracing, recall-degradation handling, the canonical 0.22.2 performance snapshot, the current `bench:memory:check` regression output, the local comparative GuardBench run, and the deterministic repeated-failure demo transcript (Ledger: E20-E26, E41-E42, E46). It does not report external-system GuardBench comparisons, production-load measurements, or real-provider embedding latency. The external adapter contract, Mem0 adapter, and evidence-bundle runner now exist, but live external-system scores belong in a v2 paper after credentialed runs publish raw outputs under the contract in Section 5 (Ledger: E47-E50).
26
-
27
- Section 2 positions Audrey against memory systems, memory benchmarks, graph-memory systems, and MCP safety work. Section 3 defines the pre-action memory-control problem. Section 4 describes Audrey Guard's design. Section 5 specifies GuardBench. Section 6 documents the implementation. Section 7 reports Stage-A evaluation artifacts. Section 8 discusses limitations and open problems. Section 9 concludes.
@@ -1,47 +0,0 @@
1
- # 2. Related Work
2
-
3
- This section organizes prior work by the behavior each system optimizes. The point of comparison is not whether a system has memory. It is whether memory runs before tool use and produces an evidence-linked action decision.
4
-
5
- ## Conversational and Scalable Memory Systems
6
-
7
- Mem0 optimizes scalable long-term memory for multi-session agents. Its paper frames the problem as extracting, consolidating, and retrieving salient information from ongoing conversations, including a graph-memory variant for relational structure, and evaluates on LoCoMo-style conversational memory tasks [@chhikara2025mem0]. Its 2026 algorithm post emphasizes token-efficient retrieval through hierarchical memory, ADD-only extraction, entity linking, and multi-signal retrieval [@mem02026tokenefficient]. Audrey differs at the control boundary: Mem0 optimizes what context to retrieve for response generation, while Audrey evaluates whether remembered context changes a proposed tool action before execution.
8
-
9
- MemGPT, now associated with Letta, optimizes virtual context management. The MemGPT paper treats limited context windows as an operating-system-style memory hierarchy problem, moving information between memory tiers so an LLM can operate beyond its immediate context window [@packer2024memgpt]. This is an architectural framing for extended context and multi-session chat. Audrey borrows the systems instinct but changes the target: its controller is not a virtual-context manager for the model; it is a host-side guard that returns `allow`, `warn`, or `block` for a proposed action.
10
-
11
- LangMem optimizes memory as a reusable agent-runtime primitive. Its documentation describes tooling for extracting important information from conversations, optimizing agent behavior through prompt refinement, maintaining long-term memory, and providing hot-path memory tools agents can call during active conversations [@langchain2026langmem]. This is close to an agent developer's integration layer. Audrey differs because the guard path does not depend on the language model deciding to call a memory tool; the host asks memory before the tool call proceeds.
12
-
13
- Supermemory optimizes a developer memory API and context stack. Its documentation positions the service as long-term and short-term memory and context infrastructure, with ingestion, extraction, graph memory, user profiles, connectors, and managed RAG [@supermemory2026docs]. Its repository describes persistent memory for AI tools and an API that returns user profiles and relevant memories [@supermemory2026repo]. Audrey differs by keeping the pre-action controller local and by treating prior tool outcomes, redaction state, and recall degradation as enforceable control inputs rather than retrieved context alone.
14
-
15
- ## Memory as System Resource and Graph Systems
16
-
17
- MemOS optimizes memory as a system resource. The paper introduces a memory operating system that manages heterogeneous memory forms across temporal scales, with memory units carrying content and metadata such as provenance and versioning [@li2025memos]. This is the broadest systems framing among the related memory papers. Audrey's scope is narrower and more operational: it does not manage parameter-level memories or schedule heterogeneous memory resources; it inserts a local memory-derived decision layer before agent tool use.
18
-
19
- Zep optimizes temporal knowledge graphs for agent memory. Its paper presents Graphiti as a temporally aware knowledge-graph engine that synthesizes unstructured conversations and structured business data while maintaining historical relationships, then evaluates retrieval over Deep Memory Retrieval and LongMemEval-style tasks [@rasmussen2025zep]. Audrey uses contradictions, recent tool events, and typed memory, but it does not claim to be a temporal knowledge graph service. Its central output is a guard decision, not a retrieved graph context.
20
-
21
- Graphiti optimizes real-time temporal context graphs. Its repository describes context graphs that track how facts change over time, maintain provenance to source data, and support semantic, keyword, and graph traversal retrieval [@zep2026graphiti]. This is valuable for evolving facts and historical queries. Audrey's use of evidence is different: evidence is attached to an action decision and to recommendations that a host can enforce.
22
-
23
- Cognee optimizes knowledge infrastructure for agent memory. The Cognee repository describes an open-source memory control plane that ingests data, combines embeddings and graphs, supports local execution, and provides traceability and cross-agent knowledge sharing [@cognee2026repo]. The Cognee paper studies hyperparameter optimization for graph construction, retrieval, and prompting in multi-hop question answering [@markovic2025cognee]. Audrey does not optimize knowledge-graph retrieval quality. It uses local memory to decide whether an agent action should proceed.
24
-
25
- ## Memory Benchmarks and Evaluation
26
-
27
- MTEB optimizes broad evaluation of embedding models. It spans embedding tasks such as retrieval, clustering, reranking, and semantic textual similarity across many datasets and languages [@muennighoff2023mteb]. It is relevant because many memory systems rely on embeddings, but it evaluates representation quality rather than the behavioral effect of memory on a tool-using agent.
28
-
29
- LongMemEval optimizes long-term chat-assistant memory evaluation. It tests information extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention across sustained user-assistant histories [@wu2025longmemeval]. GuardBench is orthogonal. It starts after a system has some memory state and asks whether that state changes a future tool action.
30
-
31
- LoCoMo optimizes very long-term conversational memory. It provides long dialogues across many sessions and evaluates question answering, event summarization, and multimodal dialogue generation [@maharana2024locomo]. GuardBench does not replace LoCoMo. It tests a separate failure surface: repeated actions, missing procedures, degraded recall, secret redaction, and contradictions at the tool boundary.
32
-
33
- MemoryBench optimizes continual-learning evaluation from accumulated user feedback. Its paper argues that many memory benchmarks focus on homogeneous reading-comprehension tasks and introduces a user-feedback simulation framework across domains, languages, and task types [@ai2026memorybench]. Audrey's validation loop is smaller: it records whether a memory was used, helpful, or wrong, then updates salience and bookkeeping (Ledger: E16). GuardBench evaluates the control effect of those memories, not general continual-learning quality.
34
-
35
- ## MCP Tool Safety and Pre-Action Runtimes
36
-
37
- The Model Context Protocol standardizes how clients discover and call tools. The 2025-06-18 schema defines `tools/list`, tool metadata, `tools/call`, input and output schemas, and tool annotations [@mcp2025schema]. MCP creates an interoperable tool surface; it does not define a memory-derived policy for whether a call should happen. Audrey fits beside MCP as a local controller that runs before a host invokes a tool.
38
-
39
- MCP Security Bench optimizes evaluation of MCP-specific attacks. It introduces attack categories across task planning, tool invocation, and response handling, and evaluates LLM agents with real benign and malicious MCP tools [@zhang2026mcpsecuritybench]. Audrey is not an MCP attack benchmark and not a complete MCP defense system. It addresses one component inside a defensive host: memory-derived pre-action control with evidence and redaction.
40
-
41
- The tool-poisoning paper studies semantic attacks against MCP-integrated systems, including malicious tool descriptors, shadowing through contaminated context, and descriptor changes after approval [@jamshidi2025toolpoisoning]. Audrey's trusted-control-source gate responds to a related risk inside memory: untrusted memories tagged as must-follow are not promoted into control rules (Ledger: E6). This does not solve tool poisoning. It reduces one path by which remembered content becomes operational instruction.
42
-
43
- The MCP tool-annotations blog frames annotations as a risk vocabulary. It states that annotations such as read-only, destructive, idempotent, and open-world are hints, not guaranteed descriptions, and that clients should not base tool-use decisions on annotations from untrusted servers [@mcp2026toolannotations]. Audrey's decision layer is complementary: it uses remembered outcomes, procedures, contradictions, and recall health, not only static tool metadata.
44
-
45
- ## What Is Missing
46
-
47
- Across the primary sources reviewed here, memory systems optimize extraction, retrieval, persistence, graph structure, context assembly, personalization, or continual learning. Safety work around MCP optimizes attack detection, tool metadata, and protocol-level risk. The missing evaluation target is action effect: whether memory changes what an agent does next. Audrey implements a redaction-first, evidence-linked, host-side controller that runs before tool use and returns `allow`, `warn`, or `block`; GuardBench specifies how to evaluate that category.
@@ -1,108 +0,0 @@
1
- # 3. Problem Definition: Pre-Action Memory Control
2
-
3
- Long-term memory systems for agents are usually evaluated as retrieval systems: given prior interaction history and a current query, the system returns facts, summaries, graph neighborhoods, or memory-tool results that improve the next model response. Mem0 evaluates scalable conversational memory and token efficiency [@chhikara2025mem0; @mem02026tokenefficient]. MemGPT/Letta frames memory as virtual context management across tiers [@packer2024memgpt]. Zep and Graphiti model changing facts as temporal knowledge graphs [@rasmussen2025zep; @zep2026graphiti]. MemOS treats memory as a manageable system resource [@li2025memos]. LangMem, Supermemory, and Cognee expose memory management, search, and graph/context layers for agents [@langchain2026langmem; @supermemory2026docs; @markovic2025cognee; @cognee2026repo].
4
-
5
- Those systems make recall, memory formation, or memory organization the central artifact. This paper studies a different artifact: a controller that runs before an agent uses a tool. The relevant question is not only whether memory returns useful text. The relevant question is whether memory changes the next external action.
6
-
7
- ## Problem Statement
8
-
9
- A tool-using agent repeatedly converts model state into external actions: shell commands, file edits, API calls, browser operations, MCP tool calls, or domain-specific side effects. These actions are not only language outputs. They change local files, spend API budget, mutate remote systems, publish content, delete data, and expose credentials. MCP standardizes tool discovery and invocation through a JSON-RPC protocol surface [@mcp2025schema]. Claude Code hooks expose pre-tool and post-tool extension points around tool calls [@anthropic2026claudecodehooks]. These interfaces make tool use observable and interceptable; they do not by themselves decide whether prior failures, remembered constraints, stale recall, or contradictions should stop the next action.
10
-
11
- The pre-action memory control problem is:
12
-
13
- Given an intended agent action and a local memory state, return an auditable decision before tool execution: `allow`, `warn`, or `block`, with evidence and repair guidance.
14
-
15
- Audrey implements this decision as the `GuardResult` contract with `decision`, `riskScore`, `summary`, `evidenceIds`, `recommendedActions`, `capsule`, `reflexes`, and `preflightEventId` fields (Ledger: E1). Its current controller calls preflight/reflex generation before action, records a preflight event, and scopes recall to the current agent (Ledger: E2). It also records tool outcomes after execution and turns failures into future tool-result memories (Ledger: E4).
16
-
17
- ## Formal Interface
18
-
19
- Let an intended action at time `t` be:
20
-
21
- ```text
22
- a_t = (tool, action, command, cwd, files, session_id)
23
- ```
24
-
25
- where `tool` names the external capability, `action` is the human-readable intended operation, `command` is the concrete command when present, `cwd` is the execution directory, `files` is the known file scope, and `session_id` identifies the agent session. Audrey represents this shape in `AgentAction` (Ledger: E1).
26
-
27
- Let `M_t` be the memory store visible to the agent, `T_t` be the tool-trace event history, and `H_t` be the current recall-health state. A pre-action memory controller is a function:
28
-
29
- ```text
30
- G(M_t, T_t, H_t, a_t) -> (d_t, r_t, E_t, R_t, C_t)
31
- ```
32
-
33
- where:
34
-
35
- - `d_t in {allow, warn, block}` is the action decision.
36
- - `r_t in [0,1]` is the risk score.
37
- - `E_t` is a set of evidence identifiers.
38
- - `R_t` is a set of recommended repair or mitigation actions.
39
- - `C_t` is an optional memory capsule containing the evidence packet.
40
-
41
- The controller is useful only if `d_t` is consumed before the side effect occurs. If the decision is displayed after execution, the system is post-hoc logging, not pre-action control.
42
-
43
- After the tool executes, let the observed outcome be:
44
-
45
- ```text
46
- o_t = (outcome, output, error_summary, metadata)
47
- ```
48
-
49
- where `outcome` includes success, failure, or unknown status. A closed-loop memory controller also defines an update function:
50
-
51
- ```text
52
- U(M_t, T_t, a_t, o_t) -> (M_{t+1}, T_{t+1})
53
- ```
54
-
55
- Audrey implements this post-action update by recording redacted tool events and encoding failures as tool-result memories for later preflight use (Ledger: E4, E12).
56
-
57
- ## Desired Behavior Properties
58
-
59
- **Pre-action placement.** The controller runs after the agent proposes tool parameters and before the tool runs. Audrey's `beforeAction()` path calls reflex/preflight generation before execution (Ledger: E2). This placement separates memory control from answer generation.
60
-
61
- **Evidence-linked decisions.** Every warning or block is backed by memory IDs, failure IDs, recall diagnostics, or preflight event IDs. Audrey preflight returns warnings, evidence IDs, recommended actions, recent failures, and an optional capsule (Ledger: E8-E10). Reflex generation preserves evidence IDs and reasons (Ledger: E11).
62
-
63
- **Action identity.** A repeated-failure detector needs an action identity stricter than a natural-language similarity match and more robust than raw string equality. Audrey hashes tool name, redacted command/action text, normalized working directory, and sorted normalized files; it then compares the hash with prior failed tool events for the same agent and tool (Ledger: E3).
64
-
65
- **Conservative control-source handling.** A memory tagged as a rule is not automatically trusted. Audrey treats `must-follow` style tags as control signals only when the source is `direct-observation` or `told-by-user`; untrusted control-looking memories are routed to uncertain/disputed context (Ledger: E6).
66
-
67
- **Recall-degradation awareness.** If retrieval partially fails, a memory controller should not silently proceed as though recall were complete. Audrey represents recall errors, propagates partial failures, exposes recent recall degradation in status, carries recall errors into capsules, and turns capsule recall errors into high-severity preflight warnings (Ledger: E7, E9, E15).
68
-
69
- **Redaction before persistence.** Tool traces are high-risk memory inputs because they contain commands, environment output, stack traces, credentials, and file paths. Audrey's tool-trace contract states that raw tool input, output, and error text do not leave the module without redaction; it stores hashes, redacted summaries, redacted metadata, file fingerprints, and redaction state (Ledger: E12). The redaction layer covers common credentials, bearer/basic auth, private keys, JWTs, URL credentials, password assignments, payment/PII patterns, signed URL signatures, session cookies, high-entropy secrets, and sensitive JSON keys (Ledger: E13).
70
-
71
- **Bounded context assembly.** A pre-action controller must fit within model and tool budgets. Audrey capsules include `budget_chars`, `used_chars`, and `truncated` fields and organize evidence into typed sections rather than returning an unstructured recall list (Ledger: E5).
72
-
73
- **Agent scoping.** A local memory runtime used by multiple agents should not leak another agent's private operational history into a current preflight. Audrey capsule recall forces `scope: 'agent'` (Ledger: E7).
74
-
75
- **Closed-loop validation.** A memory controller needs feedback after action because the controller's evidence can be helpful, merely used, or wrong. Audrey validation accepts `used`, `helpful`, and `wrong` outcomes and updates salience and bookkeeping fields; impact reporting summarizes validation and recent activity (Ledger: E16-E17).
76
-
77
- ## Threat Model
78
-
79
- The controller assumes an agent with legitimate access to local tools and MCP tools. The main hazards are action-selection hazards, not cryptographic compromise.
80
-
81
- The in-scope hazards are:
82
-
83
- - Repeating an exact action that already failed.
84
- - Ignoring a remembered must-follow procedure or project rule.
85
- - Acting on a memory set with open contradictions.
86
- - Treating degraded recall as complete recall.
87
- - Persisting credentials or sensitive tool output into long-lived memory.
88
- - Allowing untrusted tool outputs or descriptors to influence future actions as if they were trusted rules.
89
- - Losing auditability between a warning/block and the evidence that caused it.
90
-
91
- The MCP ecosystem makes these hazards concrete. The MCP specification standardizes the schema for tools and messages [@mcp2025schema]. MCP security benchmarks and tool-poisoning work evaluate attacks against MCP-integrated agents, including adversarial tool descriptions, shadowing through shared context, and changed tool descriptors after approval [@zhang2026mcpsecuritybench; @jamshidi2025toolpoisoning]. The MCP tool-annotations discussion frames annotations as risk hints that matter only when a client performs a concrete action based on them [@mcp2026toolannotations]. Audrey's controller fits this pattern: memory risk is useful when it changes the host-side decision.
92
-
93
- The out-of-scope hazards are:
94
-
95
- - First-time mistakes with no relevant prior evidence.
96
- - Malicious host compromise, database tampering, or filesystem attacks outside Audrey's process boundary.
97
- - Formal verification that a tool action is semantically safe.
98
- - Permission enforcement, sandboxing, rate limiting, or policy execution outside the memory controller.
99
- - Model alignment, deception detection, and general prompt-injection defense independent of remembered evidence.
100
- - Complete prevention of secret exposure after a caller explicitly stores unredacted data outside Audrey's tool-trace path.
101
-
102
- These boundaries matter for evaluation. Audrey Guard is not a replacement for sandboxing, MCP permission systems, static analysis, or human approval. It is a memory-derived pre-action control layer: it catches hazards that are visible in prior outcomes, stored rules, contradictions, tool traces, and recall health.
103
-
104
- ## Stage-A Evaluation Target
105
-
106
- The first paper version evaluates implemented mechanisms and specifies GuardBench rather than claiming full benchmark results across external systems. The implemented evidence available today is: the controller and CLI guard path (Ledger: E1-E4, E26), the redacted tool-trace path (Ledger: E12-E13), preflight/reflex behavior (Ledger: E8-E11), recall degradation handling (Ledger: E15), closed-loop validation and impact reporting (Ledger: E16-E17), the canonical performance snapshot (Ledger: E20-E22), the current behavioral regression gate output (Ledger: E23-E24), and the deterministic repeated-failure demo (Ledger: E25).
107
-
108
- GuardBench therefore belongs in this version as a specification for future comparative evaluation, not as a completed empirical result table. The empirical claims in the first version use existing Audrey artifacts only.