audrey 0.21.0 → 1.0.0

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 (346) hide show
  1. package/CHANGELOG.md +238 -0
  2. package/LICENSE +21 -21
  3. package/README.md +281 -33
  4. package/SECURITY.md +30 -0
  5. package/benchmarks/adapter-kit.mjs +20 -0
  6. package/benchmarks/adapter-self-test.mjs +166 -0
  7. package/benchmarks/adapters/example-allow.mjs +28 -0
  8. package/benchmarks/adapters/mem0-platform.mjs +267 -0
  9. package/benchmarks/adapters/registry.json +51 -0
  10. package/benchmarks/adapters/zep-cloud.mjs +280 -0
  11. package/benchmarks/baselines.js +169 -0
  12. package/benchmarks/build-leaderboard.mjs +170 -0
  13. package/benchmarks/cases.js +537 -0
  14. package/benchmarks/create-conformance-card.mjs +139 -0
  15. package/benchmarks/create-submission-bundle.mjs +176 -0
  16. package/benchmarks/dry-run-external-adapters.mjs +165 -0
  17. package/benchmarks/guardbench.js +1035 -0
  18. package/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +50 -0
  19. package/benchmarks/output/external/guardbench-external-dry-run.json +69 -0
  20. package/benchmarks/output/external/guardbench-external-evidence.json +56 -0
  21. package/benchmarks/output/guardbench-conformance-card.json +63 -0
  22. package/benchmarks/output/guardbench-manifest.json +414 -0
  23. package/benchmarks/output/guardbench-raw.json +1171 -0
  24. package/benchmarks/output/guardbench-summary.json +1981 -0
  25. package/benchmarks/output/leaderboard/guardbench-leaderboard.json +93 -0
  26. package/benchmarks/output/leaderboard/guardbench-leaderboard.md +7 -0
  27. package/benchmarks/output/submission-bundle/guardbench-conformance-card.json +63 -0
  28. package/benchmarks/output/submission-bundle/guardbench-manifest.json +414 -0
  29. package/benchmarks/output/submission-bundle/guardbench-raw.json +1171 -0
  30. package/benchmarks/output/submission-bundle/guardbench-summary.json +1981 -0
  31. package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-registry.schema.json +69 -0
  32. package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-self-test.schema.json +156 -0
  33. package/benchmarks/output/submission-bundle/schemas/guardbench-conformance-card.schema.json +184 -0
  34. package/benchmarks/output/submission-bundle/schemas/guardbench-external-dry-run.schema.json +74 -0
  35. package/benchmarks/output/submission-bundle/schemas/guardbench-external-evidence.schema.json +108 -0
  36. package/benchmarks/output/submission-bundle/schemas/guardbench-external-run.schema.json +160 -0
  37. package/benchmarks/output/submission-bundle/schemas/guardbench-leaderboard.schema.json +179 -0
  38. package/benchmarks/output/submission-bundle/schemas/guardbench-manifest.schema.json +213 -0
  39. package/benchmarks/output/submission-bundle/schemas/guardbench-publication-verification.schema.json +47 -0
  40. package/benchmarks/output/submission-bundle/schemas/guardbench-raw.schema.json +164 -0
  41. package/benchmarks/output/submission-bundle/schemas/guardbench-submission-manifest.schema.json +151 -0
  42. package/benchmarks/output/submission-bundle/schemas/guardbench-summary.schema.json +228 -0
  43. package/benchmarks/output/submission-bundle/submission-manifest.json +131 -0
  44. package/benchmarks/output/submission-bundle/validation-report.json +31 -0
  45. package/benchmarks/output/summary.json +2354 -0
  46. package/benchmarks/perf-snapshot.js +304 -0
  47. package/benchmarks/perf.bench.js +161 -0
  48. package/benchmarks/public-paths.mjs +78 -0
  49. package/benchmarks/reference-results.js +70 -0
  50. package/benchmarks/report.js +259 -0
  51. package/benchmarks/run-external-guardbench.mjs +281 -0
  52. package/benchmarks/run.js +682 -0
  53. package/benchmarks/schemas/guardbench-adapter-registry.schema.json +69 -0
  54. package/benchmarks/schemas/guardbench-adapter-self-test.schema.json +156 -0
  55. package/benchmarks/schemas/guardbench-conformance-card.schema.json +184 -0
  56. package/benchmarks/schemas/guardbench-external-dry-run.schema.json +74 -0
  57. package/benchmarks/schemas/guardbench-external-evidence.schema.json +108 -0
  58. package/benchmarks/schemas/guardbench-external-run.schema.json +160 -0
  59. package/benchmarks/schemas/guardbench-leaderboard.schema.json +179 -0
  60. package/benchmarks/schemas/guardbench-manifest.schema.json +213 -0
  61. package/benchmarks/schemas/guardbench-publication-verification.schema.json +47 -0
  62. package/benchmarks/schemas/guardbench-raw.schema.json +164 -0
  63. package/benchmarks/schemas/guardbench-submission-manifest.schema.json +151 -0
  64. package/benchmarks/schemas/guardbench-summary.schema.json +228 -0
  65. package/benchmarks/snapshots/perf-0.22.2.json +123 -0
  66. package/benchmarks/snapshots/perf-0.23.0.json +123 -0
  67. package/benchmarks/validate-adapter-module.mjs +104 -0
  68. package/benchmarks/validate-adapter-registry.mjs +134 -0
  69. package/benchmarks/validate-adapter-self-test.mjs +96 -0
  70. package/benchmarks/validate-guardbench-artifacts.mjs +343 -0
  71. package/benchmarks/verify-external-evidence.mjs +296 -0
  72. package/benchmarks/verify-publication-artifacts.mjs +286 -0
  73. package/benchmarks/verify-submission-bundle.mjs +167 -0
  74. package/dist/mcp-server/config.d.ts +5 -4
  75. package/dist/mcp-server/config.d.ts.map +1 -1
  76. package/dist/mcp-server/config.js +6 -8
  77. package/dist/mcp-server/config.js.map +1 -1
  78. package/dist/mcp-server/index.d.ts +281 -23
  79. package/dist/mcp-server/index.d.ts.map +1 -1
  80. package/dist/mcp-server/index.js +1186 -82
  81. package/dist/mcp-server/index.js.map +1 -1
  82. package/dist/src/action-key.d.ts +9 -0
  83. package/dist/src/action-key.d.ts.map +1 -0
  84. package/dist/src/action-key.js +49 -0
  85. package/dist/src/action-key.js.map +1 -0
  86. package/dist/src/adaptive.d.ts.map +1 -1
  87. package/dist/src/adaptive.js +8 -6
  88. package/dist/src/adaptive.js.map +1 -1
  89. package/dist/src/affect.d.ts +4 -1
  90. package/dist/src/affect.d.ts.map +1 -1
  91. package/dist/src/affect.js +14 -12
  92. package/dist/src/affect.js.map +1 -1
  93. package/dist/src/audrey.d.ts +57 -4
  94. package/dist/src/audrey.d.ts.map +1 -1
  95. package/dist/src/audrey.js +512 -65
  96. package/dist/src/audrey.js.map +1 -1
  97. package/dist/src/capsule.d.ts +2 -1
  98. package/dist/src/capsule.d.ts.map +1 -1
  99. package/dist/src/capsule.js +18 -8
  100. package/dist/src/capsule.js.map +1 -1
  101. package/dist/src/causal.d.ts.map +1 -1
  102. package/dist/src/causal.js +23 -5
  103. package/dist/src/causal.js.map +1 -1
  104. package/dist/src/confidence.d.ts.map +1 -1
  105. package/dist/src/confidence.js +3 -0
  106. package/dist/src/confidence.js.map +1 -1
  107. package/dist/src/consolidate.d.ts +1 -0
  108. package/dist/src/consolidate.d.ts.map +1 -1
  109. package/dist/src/consolidate.js +70 -54
  110. package/dist/src/consolidate.js.map +1 -1
  111. package/dist/src/controller.d.ts +94 -0
  112. package/dist/src/controller.d.ts.map +1 -0
  113. package/dist/src/controller.js +350 -0
  114. package/dist/src/controller.js.map +1 -0
  115. package/dist/src/db.d.ts.map +1 -1
  116. package/dist/src/db.js +181 -169
  117. package/dist/src/db.js.map +1 -1
  118. package/dist/src/decay.d.ts.map +1 -1
  119. package/dist/src/decay.js +62 -55
  120. package/dist/src/decay.js.map +1 -1
  121. package/dist/src/embedding.d.ts +2 -1
  122. package/dist/src/embedding.d.ts.map +1 -1
  123. package/dist/src/embedding.js +60 -22
  124. package/dist/src/embedding.js.map +1 -1
  125. package/dist/src/encode.d.ts +9 -2
  126. package/dist/src/encode.d.ts.map +1 -1
  127. package/dist/src/encode.js +25 -12
  128. package/dist/src/encode.js.map +1 -1
  129. package/dist/src/export.d.ts.map +1 -1
  130. package/dist/src/export.js +5 -3
  131. package/dist/src/export.js.map +1 -1
  132. package/dist/src/feedback.d.ts +35 -0
  133. package/dist/src/feedback.d.ts.map +1 -0
  134. package/dist/src/feedback.js +129 -0
  135. package/dist/src/feedback.js.map +1 -0
  136. package/dist/src/forget.d.ts.map +1 -1
  137. package/dist/src/forget.js +68 -60
  138. package/dist/src/forget.js.map +1 -1
  139. package/dist/src/fts.js +1 -1
  140. package/dist/src/fts.js.map +1 -1
  141. package/dist/src/hybrid-recall.d.ts +2 -1
  142. package/dist/src/hybrid-recall.d.ts.map +1 -1
  143. package/dist/src/hybrid-recall.js +41 -32
  144. package/dist/src/hybrid-recall.js.map +1 -1
  145. package/dist/src/impact.d.ts +47 -0
  146. package/dist/src/impact.d.ts.map +1 -0
  147. package/dist/src/impact.js +146 -0
  148. package/dist/src/impact.js.map +1 -0
  149. package/dist/src/import.d.ts +177 -1
  150. package/dist/src/import.d.ts.map +1 -1
  151. package/dist/src/import.js +235 -46
  152. package/dist/src/import.js.map +1 -1
  153. package/dist/src/index.d.ts +5 -1
  154. package/dist/src/index.d.ts.map +1 -1
  155. package/dist/src/index.js +3 -1
  156. package/dist/src/index.js.map +1 -1
  157. package/dist/src/interference.d.ts +5 -2
  158. package/dist/src/interference.d.ts.map +1 -1
  159. package/dist/src/interference.js +39 -32
  160. package/dist/src/interference.js.map +1 -1
  161. package/dist/src/introspect.js +18 -18
  162. package/dist/src/llm.d.ts.map +1 -1
  163. package/dist/src/llm.js +1 -0
  164. package/dist/src/llm.js.map +1 -1
  165. package/dist/src/migrate.d.ts.map +1 -1
  166. package/dist/src/migrate.js +21 -9
  167. package/dist/src/migrate.js.map +1 -1
  168. package/dist/src/preflight.d.ts +2 -1
  169. package/dist/src/preflight.d.ts.map +1 -1
  170. package/dist/src/preflight.js +66 -5
  171. package/dist/src/preflight.js.map +1 -1
  172. package/dist/src/profile.d.ts +23 -0
  173. package/dist/src/profile.d.ts.map +1 -0
  174. package/dist/src/profile.js +51 -0
  175. package/dist/src/profile.js.map +1 -0
  176. package/dist/src/promote.d.ts.map +1 -1
  177. package/dist/src/promote.js +8 -9
  178. package/dist/src/promote.js.map +1 -1
  179. package/dist/src/prompts.d.ts.map +1 -1
  180. package/dist/src/prompts.js +165 -136
  181. package/dist/src/prompts.js.map +1 -1
  182. package/dist/src/recall.d.ts +9 -6
  183. package/dist/src/recall.d.ts.map +1 -1
  184. package/dist/src/recall.js +204 -62
  185. package/dist/src/recall.js.map +1 -1
  186. package/dist/src/redact.d.ts +7 -1
  187. package/dist/src/redact.d.ts.map +1 -1
  188. package/dist/src/redact.js +94 -11
  189. package/dist/src/redact.js.map +1 -1
  190. package/dist/src/reflexes.d.ts +1 -0
  191. package/dist/src/reflexes.d.ts.map +1 -1
  192. package/dist/src/reflexes.js +3 -0
  193. package/dist/src/reflexes.js.map +1 -1
  194. package/dist/src/rollback.d.ts.map +1 -1
  195. package/dist/src/rollback.js +13 -8
  196. package/dist/src/rollback.js.map +1 -1
  197. package/dist/src/routes.d.ts +1 -0
  198. package/dist/src/routes.d.ts.map +1 -1
  199. package/dist/src/routes.js +251 -6
  200. package/dist/src/routes.js.map +1 -1
  201. package/dist/src/rules-compiler.d.ts.map +1 -1
  202. package/dist/src/rules-compiler.js +36 -6
  203. package/dist/src/rules-compiler.js.map +1 -1
  204. package/dist/src/server.d.ts +2 -1
  205. package/dist/src/server.d.ts.map +1 -1
  206. package/dist/src/server.js +42 -4
  207. package/dist/src/server.js.map +1 -1
  208. package/dist/src/tool-trace.d.ts.map +1 -1
  209. package/dist/src/tool-trace.js +42 -29
  210. package/dist/src/tool-trace.js.map +1 -1
  211. package/dist/src/types.d.ts +28 -1
  212. package/dist/src/types.d.ts.map +1 -1
  213. package/dist/src/ulid.d.ts.map +1 -1
  214. package/dist/src/ulid.js +52 -2
  215. package/dist/src/ulid.js.map +1 -1
  216. package/dist/src/utils.d.ts.map +1 -1
  217. package/dist/src/utils.js +8 -1
  218. package/dist/src/utils.js.map +1 -1
  219. package/dist/src/validate.d.ts +2 -0
  220. package/dist/src/validate.d.ts.map +1 -1
  221. package/dist/src/validate.js +77 -46
  222. package/dist/src/validate.js.map +1 -1
  223. package/docs/AUDREY_PAPER_OUTLINE.md +175 -0
  224. package/docs/MEMORY_BENCHMARKING.md +59 -0
  225. package/docs/PRODUCTION_BACKLOG.md +304 -0
  226. package/docs/paper/00-master.md +48 -0
  227. package/docs/paper/01-introduction.md +27 -0
  228. package/docs/paper/02-related-work.md +47 -0
  229. package/docs/paper/03-problem-definition.md +108 -0
  230. package/docs/paper/04-design.md +164 -0
  231. package/docs/paper/05-guardbench-spec.md +412 -0
  232. package/docs/paper/06-implementation.md +113 -0
  233. package/docs/paper/07-evaluation.md +168 -0
  234. package/docs/paper/08-discussion-limitations.md +61 -0
  235. package/docs/paper/09-conclusion.md +11 -0
  236. package/docs/paper/SUBMISSION_README.md +162 -0
  237. package/docs/paper/appendix-a-demo-transcript.md +114 -0
  238. package/docs/paper/arxiv-compile-report.schema.json +116 -0
  239. package/docs/paper/arxiv-source.schema.json +61 -0
  240. package/docs/paper/audrey-paper-v1.md +1106 -0
  241. package/docs/paper/browser-launch-plan.json +209 -0
  242. package/docs/paper/browser-launch-plan.schema.json +100 -0
  243. package/docs/paper/browser-launch-results.json +86 -0
  244. package/docs/paper/browser-launch-results.schema.json +66 -0
  245. package/docs/paper/claim-register.json +138 -0
  246. package/docs/paper/claim-register.schema.json +81 -0
  247. package/docs/paper/evidence-ledger.md +103 -0
  248. package/docs/paper/output/arxiv/README-arxiv.txt +8 -0
  249. package/docs/paper/output/arxiv/arxiv-manifest.json +41 -0
  250. package/docs/paper/output/arxiv/main.tex +949 -0
  251. package/docs/paper/output/arxiv/references.bib +222 -0
  252. package/docs/paper/output/arxiv-compile-report.json +24 -0
  253. package/docs/paper/output/submission-bundle/LICENSE +21 -0
  254. package/docs/paper/output/submission-bundle/README.md +533 -0
  255. package/docs/paper/output/submission-bundle/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +50 -0
  256. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-dry-run.json +69 -0
  257. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-evidence.json +56 -0
  258. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-conformance-card.json +63 -0
  259. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-manifest.json +414 -0
  260. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-raw.json +1171 -0
  261. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-summary.json +1981 -0
  262. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.json +93 -0
  263. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.md +7 -0
  264. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/submission-manifest.json +131 -0
  265. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/validation-report.json +31 -0
  266. package/docs/paper/output/submission-bundle/benchmarks/output/summary.json +2354 -0
  267. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-registry.schema.json +69 -0
  268. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-self-test.schema.json +156 -0
  269. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-conformance-card.schema.json +184 -0
  270. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-dry-run.schema.json +74 -0
  271. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-evidence.schema.json +108 -0
  272. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-run.schema.json +160 -0
  273. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-leaderboard.schema.json +179 -0
  274. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-manifest.schema.json +213 -0
  275. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-publication-verification.schema.json +47 -0
  276. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-raw.schema.json +164 -0
  277. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-submission-manifest.schema.json +151 -0
  278. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-summary.schema.json +228 -0
  279. package/docs/paper/output/submission-bundle/docs/AUDREY_PAPER_OUTLINE.md +175 -0
  280. package/docs/paper/output/submission-bundle/docs/paper/00-master.md +48 -0
  281. package/docs/paper/output/submission-bundle/docs/paper/01-introduction.md +27 -0
  282. package/docs/paper/output/submission-bundle/docs/paper/02-related-work.md +47 -0
  283. package/docs/paper/output/submission-bundle/docs/paper/03-problem-definition.md +108 -0
  284. package/docs/paper/output/submission-bundle/docs/paper/04-design.md +164 -0
  285. package/docs/paper/output/submission-bundle/docs/paper/05-guardbench-spec.md +412 -0
  286. package/docs/paper/output/submission-bundle/docs/paper/06-implementation.md +113 -0
  287. package/docs/paper/output/submission-bundle/docs/paper/07-evaluation.md +168 -0
  288. package/docs/paper/output/submission-bundle/docs/paper/08-discussion-limitations.md +61 -0
  289. package/docs/paper/output/submission-bundle/docs/paper/09-conclusion.md +11 -0
  290. package/docs/paper/output/submission-bundle/docs/paper/SUBMISSION_README.md +162 -0
  291. package/docs/paper/output/submission-bundle/docs/paper/appendix-a-demo-transcript.md +114 -0
  292. package/docs/paper/output/submission-bundle/docs/paper/arxiv-compile-report.schema.json +116 -0
  293. package/docs/paper/output/submission-bundle/docs/paper/arxiv-source.schema.json +61 -0
  294. package/docs/paper/output/submission-bundle/docs/paper/audrey-paper-v1.md +1106 -0
  295. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.json +209 -0
  296. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.schema.json +100 -0
  297. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.json +86 -0
  298. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.schema.json +66 -0
  299. package/docs/paper/output/submission-bundle/docs/paper/claim-register.json +138 -0
  300. package/docs/paper/output/submission-bundle/docs/paper/claim-register.schema.json +81 -0
  301. package/docs/paper/output/submission-bundle/docs/paper/evidence-ledger.md +103 -0
  302. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/README-arxiv.txt +8 -0
  303. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/arxiv-manifest.json +41 -0
  304. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/main.tex +949 -0
  305. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/references.bib +222 -0
  306. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv-compile-report.json +24 -0
  307. package/docs/paper/output/submission-bundle/docs/paper/paper-submission-bundle.schema.json +70 -0
  308. package/docs/paper/output/submission-bundle/docs/paper/publication-pack.json +81 -0
  309. package/docs/paper/output/submission-bundle/docs/paper/publication-pack.schema.json +60 -0
  310. package/docs/paper/output/submission-bundle/docs/paper/references.bib +222 -0
  311. package/docs/paper/output/submission-bundle/package.json +212 -0
  312. package/docs/paper/output/submission-bundle/paper-submission-manifest.json +379 -0
  313. package/docs/paper/paper-submission-bundle.schema.json +70 -0
  314. package/docs/paper/publication-pack.json +81 -0
  315. package/docs/paper/publication-pack.schema.json +60 -0
  316. package/docs/paper/references.bib +222 -0
  317. package/package.json +103 -26
  318. package/scripts/audit-release-completion.mjs +362 -0
  319. package/scripts/create-arxiv-source.mjs +362 -0
  320. package/scripts/create-paper-submission-bundle.mjs +210 -0
  321. package/scripts/finalize-release.mjs +526 -0
  322. package/scripts/prepare-release-cut.mjs +269 -0
  323. package/scripts/publish-release-bundle.mjs +209 -0
  324. package/scripts/publish-release-github-api.mjs +429 -0
  325. package/scripts/run-vitest.mjs +34 -0
  326. package/scripts/smoke-cli.js +72 -0
  327. package/scripts/sync-paper-artifacts.mjs +109 -0
  328. package/scripts/verify-arxiv-compile.mjs +440 -0
  329. package/scripts/verify-arxiv-source.mjs +194 -0
  330. package/scripts/verify-browser-launch-plan.mjs +237 -0
  331. package/scripts/verify-browser-launch-results.mjs +285 -0
  332. package/scripts/verify-paper-artifacts.mjs +338 -0
  333. package/scripts/verify-paper-claims.mjs +226 -0
  334. package/scripts/verify-paper-submission-bundle.mjs +207 -0
  335. package/scripts/verify-publication-pack.mjs +196 -0
  336. package/scripts/verify-python-package.py +201 -0
  337. package/scripts/verify-release-readiness.mjs +741 -0
  338. package/docs/assets/benchmarks/local-benchmark.svg +0 -45
  339. package/docs/assets/benchmarks/operations-benchmark.svg +0 -45
  340. package/docs/assets/benchmarks/published-memory-standards.svg +0 -50
  341. package/docs/audrey-for-dummies.md +0 -670
  342. package/docs/benchmarking.md +0 -151
  343. package/docs/future-of-llm-memory.md +0 -452
  344. package/docs/mcp-hosts.md +0 -206
  345. package/docs/ollama-local-agents.md +0 -128
  346. package/docs/production-readiness.md +0 -128
@@ -1,670 +0,0 @@
1
- # Audrey For Dummies
2
-
3
- Date: 2026-04-24
4
-
5
- This guide explains Audrey in plain language. It assumes you know what an AI assistant is, but not how memory systems work.
6
-
7
- ## The One-Sentence Version
8
-
9
- Audrey is a local brain for AI agents.
10
-
11
- It gives tools like Codex, Claude Code, Claude Desktop, Cursor, Ollama agents, and custom apps a shared memory that can remember facts, decisions, procedures, failures, preferences, and project context across sessions.
12
-
13
- ## The Problem Audrey Solves
14
-
15
- Most AI agents are powerful but forgetful.
16
-
17
- You can spend an hour teaching an agent how your project works, what failed before, what commands are safe, what your customer cares about, and how you like work done. Then the next session starts and the agent often needs that same context again.
18
-
19
- Large context windows help, but they are not the same as memory. A context window is what the model can see right now. Memory is what the system decides is worth keeping, organizing, updating, recalling, and eventually forgetting.
20
-
21
- Audrey gives agents a durable memory layer so they do not have to start from zero every time.
22
-
23
- ## What Audrey Is
24
-
25
- Audrey is:
26
-
27
- - A local-first memory runtime.
28
- - A SQLite-backed memory database.
29
- - A vector-search recall engine.
30
- - A Model Context Protocol server for AI tools.
31
- - A REST API sidecar for local agents and services.
32
- - A JavaScript library.
33
- - A Python client.
34
- - A benchmarked memory system with health checks.
35
-
36
- Audrey is not:
37
-
38
- - A replacement for an LLM.
39
- - A hosted chatbot.
40
- - A vector database only.
41
- - A regulated compliance platform by itself.
42
- - A magic guarantee that an agent will always remember correctly.
43
-
44
- ## Why "Local-First" Matters
45
-
46
- Local-first means Audrey can store memory on your machine or inside your deployment boundary instead of forcing you to send memory to a hosted vendor.
47
-
48
- By default, Audrey stores data under:
49
-
50
- ```text
51
- C:\Users\<you>\.audrey\data
52
- ```
53
-
54
- You can change that with:
55
-
56
- ```bash
57
- AUDREY_DATA_DIR=B:\path\to\audrey-data
58
- ```
59
-
60
- Use one shared data directory when you want multiple hosts to share memory. Use separate directories when you need strict separation by customer, project, environment, or agent.
61
-
62
- ## The Basic Loop
63
-
64
- Audrey does seven core things.
65
-
66
- 1. Encode memory.
67
- 2. Recall memory.
68
- 3. Build Memory Capsules.
69
- 4. Dream over memory.
70
- 5. Track tool traces and failures.
71
- 6. Run Memory Preflight before actions.
72
- 7. Turn important warnings into Memory Reflexes.
73
-
74
- ### 1. Encode Memory
75
-
76
- Encoding means storing something worth remembering.
77
-
78
- Examples:
79
-
80
- - "This repo uses TypeScript ES modules only."
81
- - "On this machine, Vitest can fail with `spawn EPERM`; use build, typecheck, benchmarks, and direct dist smokes as fallback evidence."
82
- - "The customer wants website changes explained in business language, not technical language."
83
- - "Before starting a task, ask Audrey for a Memory Capsule."
84
-
85
- Good memories are durable. They are likely to help again later.
86
-
87
- Bad memories are raw noise. Do not store every sentence of every chat unless you have a clear reason.
88
-
89
- ### 2. Recall Memory
90
-
91
- Recall means asking Audrey for memories related to the current task.
92
-
93
- Example:
94
-
95
- ```bash
96
- npx audrey
97
- ```
98
-
99
- In MCP hosts, the agent calls tools such as `memory_recall`. In REST mode, local agents call `/v1/recall`.
100
-
101
- ### 3. Build Memory Capsules
102
-
103
- A Memory Capsule is a compact task briefing.
104
-
105
- Instead of dumping every matching memory into the model, Audrey groups useful memories into a structured packet with reasons. This is the right shape for agent context.
106
-
107
- Use cases:
108
-
109
- - "What should Codex know before editing this repo?"
110
- - "What should an Ollama agent remember before answering this customer?"
111
- - "What project rules matter before release?"
112
- - "What risks have happened before?"
113
-
114
- REST route:
115
-
116
- ```text
117
- POST /v1/capsule
118
- ```
119
-
120
- ### 4. Dream Over Memory
121
-
122
- Dreaming is Audrey's maintenance and consolidation step.
123
-
124
- It can:
125
-
126
- - Find patterns.
127
- - Promote repeated lessons into stronger memories.
128
- - Detect contradictions.
129
- - Decay stale memories.
130
- - Consolidate episodes into semantic or procedural knowledge.
131
-
132
- Run it manually:
133
-
134
- ```bash
135
- npx audrey dream
136
- ```
137
-
138
- In production, schedule it during low-traffic windows.
139
-
140
- ### 5. Track Tool Traces
141
-
142
- Agents do not just chat. They use tools, run commands, edit files, call APIs, and sometimes fail.
143
-
144
- Audrey can remember those tool outcomes.
145
-
146
- Example:
147
-
148
- ```bash
149
- npx audrey observe-tool --event PostToolUse --tool Bash --outcome failed
150
- ```
151
-
152
- Why this matters:
153
-
154
- If an agent keeps running into the same environment failure, Audrey can turn that failure into a future warning or procedure.
155
-
156
- ### 6. Run Memory Preflight
157
-
158
- Preflight means asking Audrey what the agent should know before it acts.
159
-
160
- Example:
161
-
162
- ```text
163
- Before running npm test, check whether this failed before, whether there are release rules, and whether there is a safer known procedure.
164
- ```
165
-
166
- Audrey returns:
167
-
168
- - `decision`: `go`, `caution`, or `block`.
169
- - `risk_score`: how serious the remembered risks are.
170
- - `warnings`: prior failures, must-follow rules, risks, contradictions, or uncertain memories.
171
- - `recommended_actions`: what the agent should do next.
172
- - `evidence_ids`: memories that support the warning.
173
-
174
- ### 7. Use Memory Reflexes
175
-
176
- Memory Reflexes are preflight results shaped as trigger-response rules.
177
-
178
- Example:
179
-
180
- ```text
181
- Trigger: Before using npm test
182
- Response: Review the prior EPERM failure path before re-running the command.
183
- ```
184
-
185
- This is the product pivot: Audrey is not only a memory store. It is a reflex layer that helps agents stop repeating expensive mistakes.
186
-
187
- REST route:
188
-
189
- ```text
190
- POST /v1/reflexes
191
- ```
192
-
193
- ## The Fastest Demo
194
-
195
- Run:
196
-
197
- ```bash
198
- npx audrey doctor
199
- npx audrey demo
200
- ```
201
-
202
- `doctor` checks whether Audrey can run on your machine. The demo does not need API keys, Claude, Codex, Ollama, or any hosted model.
203
-
204
- The demo:
205
-
206
- - Creates a temporary memory store.
207
- - Writes example memories.
208
- - Records a redacted tool failure.
209
- - Builds a Memory Capsule.
210
- - Proves recall.
211
- - Deletes the temporary store unless you pass `--keep`.
212
-
213
- ## Three Ways To Use Audrey
214
-
215
- ### 1. MCP Mode
216
-
217
- Use this when connecting Audrey to tools that support Model Context Protocol.
218
-
219
- Examples:
220
-
221
- - Codex
222
- - Claude Code
223
- - Claude Desktop
224
- - Cursor
225
- - Windsurf
226
- - VS Code Copilot
227
- - JetBrains AI Assistant
228
-
229
- Generate host config:
230
-
231
- ```bash
232
- npx audrey install --host codex --dry-run
233
- npx audrey install --host generic --dry-run
234
- npx audrey mcp-config codex
235
- npx audrey mcp-config generic
236
- npx audrey mcp-config vscode
237
- ```
238
-
239
- Claude Code has a direct installer:
240
-
241
- ```bash
242
- npx audrey install
243
- claude mcp list
244
- ```
245
-
246
- ### 2. REST Sidecar Mode
247
-
248
- Use this when building your own local agent, web app, CRM assistant, or Ollama-backed tool loop.
249
-
250
- Start Audrey:
251
-
252
- ```bash
253
- npx audrey serve
254
- ```
255
-
256
- Health check:
257
-
258
- ```bash
259
- curl http://localhost:7437/health
260
- ```
261
-
262
- Useful routes:
263
-
264
- ```text
265
- GET /health
266
- GET /v1/status
267
- POST /v1/encode
268
- POST /v1/recall
269
- POST /v1/capsule
270
- POST /v1/preflight
271
- POST /v1/reflexes
272
- POST /v1/export
273
- POST /v1/import
274
- ```
275
-
276
- ### 3. SDK Mode
277
-
278
- Use this when embedding Audrey directly in a Node.js app.
279
-
280
- ```js
281
- import { Audrey } from 'audrey';
282
-
283
- const brain = new Audrey({
284
- dataDir: './.audrey-data',
285
- agent: 'my-agent',
286
- });
287
-
288
- await brain.encode({
289
- content: 'This project prefers ES modules.',
290
- source: 'direct-observation',
291
- tags: ['project-rule'],
292
- });
293
-
294
- const memories = await brain.recall('project module format', { limit: 3 });
295
- console.log(memories);
296
-
297
- brain.close();
298
- ```
299
-
300
- ## Ollama And Local Agents
301
-
302
- Ollama runs local models. Audrey gives those local models memory.
303
-
304
- Start Audrey:
305
-
306
- ```bash
307
- AUDREY_AGENT=ollama-local-agent npx audrey serve
308
- ```
309
-
310
- Run the example agent:
311
-
312
- ```bash
313
- OLLAMA_MODEL=qwen3 node examples/ollama-memory-agent.js "What should you remember about this project?"
314
- ```
315
-
316
- The example uses Ollama tool calling and Audrey REST routes. It exposes Audrey tools for:
317
-
318
- - `memory_preflight`
319
- - `memory_reflexes`
320
- - `memory_capsule`
321
- - `memory_recall`
322
- - `memory_encode`
323
-
324
- ## Memory Types
325
-
326
- Audrey stores several kinds of memory.
327
-
328
- ### Episodic Memory
329
-
330
- Something that happened.
331
-
332
- Example:
333
-
334
- ```text
335
- The release smoke on 2026-04-24 passed build, typecheck, pack dry-run, and the demo command.
336
- ```
337
-
338
- ### Semantic Memory
339
-
340
- A general fact or principle.
341
-
342
- Example:
343
-
344
- ```text
345
- Audrey is host-neutral and should not be framed as Claude-only.
346
- ```
347
-
348
- ### Procedural Memory
349
-
350
- How to do something.
351
-
352
- Example:
353
-
354
- ```text
355
- Before calling a release ready, run build, typecheck, benchmark, pack dry-run, and direct CLI smoke.
356
- ```
357
-
358
- ### Tool Trace Memory
359
-
360
- What happened when a tool ran.
361
-
362
- Example:
363
-
364
- ```text
365
- npm test failed with spawn EPERM on a locked-down Windows host.
366
- ```
367
-
368
- ## Memory Metadata
369
-
370
- A memory is more useful when it has metadata.
371
-
372
- Important fields:
373
-
374
- - `source`: where the memory came from.
375
- - `tags`: searchable labels.
376
- - `salience`: importance.
377
- - `context`: project, task, customer, host, or environment.
378
- - `affect`: emotional or urgency signal.
379
- - `private`: whether it should be excluded from public recall results.
380
-
381
- Example encode body:
382
-
383
- ```json
384
- {
385
- "content": "Use npm run typecheck before claiming TypeScript changes are safe.",
386
- "source": "direct-observation",
387
- "tags": ["procedure", "release-gate"],
388
- "salience": 0.8,
389
- "context": {
390
- "repo": "audrey",
391
- "host": "codex"
392
- }
393
- }
394
- ```
395
-
396
- ## Beginner Rules For Good Memory
397
-
398
- Use these rules when deciding what Audrey should remember.
399
-
400
- - Store lessons that will matter again.
401
- - Store procedures, not just facts.
402
- - Store failures that should not be repeated.
403
- - Store user preferences when they affect future work.
404
- - Store project conventions.
405
- - Store business context that saves explanation later.
406
- - Do not store raw secrets, API keys, passwords, or private customer data unless your deployment is designed for it.
407
- - Do not blindly store everything.
408
- - Prefer short, clear memories over giant pasted transcripts.
409
- - Add tags.
410
- - Run `npx audrey status` when recall seems wrong.
411
-
412
- ## Command Cheat Sheet
413
-
414
- ```bash
415
- # Run the local proof demo
416
- npx audrey doctor
417
- npx audrey demo
418
-
419
- # Preview host setup without editing files
420
- npx audrey install --host codex --dry-run
421
-
422
- # Print Codex MCP config
423
- npx audrey mcp-config codex
424
-
425
- # Print generic MCP JSON
426
- npx audrey mcp-config generic
427
-
428
- # Install into Claude Code
429
- npx audrey install
430
-
431
- # Remove from Claude Code
432
- npx audrey uninstall
433
-
434
- # Start REST sidecar
435
- npx audrey serve
436
-
437
- # Check memory health
438
- npx audrey doctor --json
439
- npx audrey status
440
- npx audrey status --json --fail-on-unhealthy
441
-
442
- # Consolidate memory
443
- npx audrey dream
444
-
445
- # Repair vector/index drift
446
- npx audrey reembed
447
-
448
- # Record a tool result
449
- npx audrey observe-tool --event PostToolUse --tool Bash --outcome failed
450
- ```
451
-
452
- ## HTTP Examples
453
-
454
- Start the server:
455
-
456
- ```bash
457
- npx audrey serve
458
- ```
459
-
460
- Encode a memory:
461
-
462
- ```bash
463
- curl -X POST http://localhost:7437/v1/encode ^
464
- -H "Content-Type: application/json" ^
465
- -d "{\"content\":\"Audrey should work across Codex, Claude, and Ollama.\",\"source\":\"direct-observation\",\"tags\":[\"host-neutral\"]}"
466
- ```
467
-
468
- Recall memory:
469
-
470
- ```bash
471
- curl -X POST http://localhost:7437/v1/recall ^
472
- -H "Content-Type: application/json" ^
473
- -d "{\"query\":\"host neutral Audrey\",\"limit\":5}"
474
- ```
475
-
476
- Build a Memory Capsule:
477
-
478
- ```bash
479
- curl -X POST http://localhost:7437/v1/capsule ^
480
- -H "Content-Type: application/json" ^
481
- -d "{\"query\":\"How should an agent use Audrey before starting work?\",\"budget_chars\":3000}"
482
- ```
483
-
484
- PowerShell equivalent:
485
-
486
- ```powershell
487
- Invoke-RestMethod -Method Post -Uri http://localhost:7437/v1/capsule `
488
- -ContentType 'application/json' `
489
- -Body '{"query":"How should an agent use Audrey before starting work?","budget_chars":3000}'
490
- ```
491
-
492
- Run Memory Preflight:
493
-
494
- ```powershell
495
- Invoke-RestMethod -Method Post -Uri http://localhost:7437/v1/preflight `
496
- -ContentType 'application/json' `
497
- -Body '{"action":"run npm test before release","tool":"npm test","include_capsule":false}'
498
- ```
499
-
500
- ## Production Basics
501
-
502
- For real deployments:
503
-
504
- - Pin `AUDREY_EMBEDDING_PROVIDER`.
505
- - Pin `AUDREY_LLM_PROVIDER` if using LLM-backed consolidation.
506
- - Set a dedicated `AUDREY_DATA_DIR`.
507
- - Use one data directory per tenant boundary.
508
- - Set `AUDREY_API_KEY` before exposing REST beyond localhost.
509
- - Run `npx audrey status --json --fail-on-unhealthy` in health checks.
510
- - Schedule `npx audrey dream`.
511
- - Backup the data directory before migrations or provider changes.
512
- - Keep secrets out of memory.
513
- - Put encryption, access control, and audit logging around Audrey at the host layer.
514
-
515
- ## Small Business Use Cases
516
-
517
- Audrey is especially practical for small businesses because their operational knowledge is usually scattered across the owner, a few employees, emails, spreadsheets, website notes, CRM records, and repeated manual fixes.
518
-
519
- ### Website Optimization
520
-
521
- Audrey can remember:
522
-
523
- - What the business sells.
524
- - Which pages convert.
525
- - Which SEO changes were already tried.
526
- - Which technical issues recur.
527
- - The owner's tone and brand preferences.
528
-
529
- ### CRM Assistant
530
-
531
- Audrey can remember:
532
-
533
- - Customer preferences.
534
- - Follow-up rules.
535
- - Common objections.
536
- - Deal stage quirks.
537
- - Which fields matter in the CRM.
538
-
539
- ### Support Agent
540
-
541
- Audrey can remember:
542
-
543
- - Recurring customer issues.
544
- - Approved response patterns.
545
- - Escalation rules.
546
- - Past fixes.
547
- - Product or service constraints.
548
-
549
- ### Internal Operations
550
-
551
- Audrey can remember:
552
-
553
- - How invoices are handled.
554
- - Which vendor has special terms.
555
- - How reports are generated.
556
- - What failed during the last migration.
557
- - Which automations are safe to run.
558
-
559
- ## Troubleshooting
560
-
561
- ### `npx audrey demo` Fails
562
-
563
- Run:
564
-
565
- ```bash
566
- npx audrey doctor
567
- npx audrey status
568
- node --version
569
- ```
570
-
571
- Audrey requires Node.js 20 or newer.
572
-
573
- ### Codex Or Claude Cannot Find Audrey
574
-
575
- Generate a pinned config:
576
-
577
- ```bash
578
- npx audrey install --host codex --dry-run
579
- npx audrey install --host generic --dry-run
580
- npx audrey mcp-config codex
581
- npx audrey mcp-config generic
582
- ```
583
-
584
- If a Windows MCP host cannot find `npx`, use `cmd /c npx -y audrey` in the host config.
585
-
586
- ### Recall Returns Nothing
587
-
588
- Check health:
589
-
590
- ```bash
591
- npx audrey status --json --fail-on-unhealthy
592
- ```
593
-
594
- If the embedding dimensions changed, run:
595
-
596
- ```bash
597
- npx audrey reembed
598
- ```
599
-
600
- ### Local Embeddings Are Slow
601
-
602
- The local embedding provider may download or initialize model assets. For quick CI or demos, use mock providers. For production, pin the provider explicitly.
603
-
604
- ### REST Returns Unauthorized
605
-
606
- If `AUDREY_API_KEY` is set, requests need:
607
-
608
- ```text
609
- Authorization: Bearer <your-key>
610
- ```
611
-
612
- ### Tests Fail With `spawn EPERM`
613
-
614
- On some locked-down Windows hosts, Vitest/Vite worker startup can fail with `spawn EPERM`. Treat that as a local execution blocker. Use build, typecheck, benchmark checks, package dry-run, and direct Node smokes as fallback evidence.
615
-
616
- ## Glossary
617
-
618
- ### Agent
619
-
620
- An AI system that can take actions, use tools, or work across steps.
621
-
622
- ### MCP
623
-
624
- Model Context Protocol. A standard way for AI tools to call external tools and access resources.
625
-
626
- ### REST Sidecar
627
-
628
- A local HTTP service that another app or agent can call.
629
-
630
- ### Embedding
631
-
632
- A numeric representation of text used for similarity search.
633
-
634
- ### Vector Search
635
-
636
- Searching by meaning instead of exact words.
637
-
638
- ### Memory Capsule
639
-
640
- A compact briefing of memories relevant to a task.
641
-
642
- ### Dream
643
-
644
- Audrey's consolidation and maintenance cycle.
645
-
646
- ### Tool Trace
647
-
648
- A record of what happened when an agent used a tool.
649
-
650
- ### Re-Embedding
651
-
652
- Rebuilding vector indexes when the embedding provider or dimensions change.
653
-
654
- ## The Mental Model
655
-
656
- Think of Audrey like a project notebook that AI agents can read and update, except it is structured, searchable, local, and designed for automation.
657
-
658
- The best use is not "remember everything."
659
-
660
- The best use is:
661
-
662
- > Remember the lessons, preferences, procedures, and failures that make the next session better than the last one.
663
-
664
- ## Where To Go Next
665
-
666
- - Run `npx audrey doctor`, then `npx audrey demo`.
667
- - Read `docs/mcp-hosts.md` to connect Codex, Claude, Cursor, Windsurf, VS Code, or JetBrains.
668
- - Read `docs/ollama-local-agents.md` for local Ollama-backed agents.
669
- - Read `docs/production-readiness.md` before using Audrey in a real deployment.
670
- - Read `docs/future-of-llm-memory.md` for the forward-looking product roadmap.