audrey 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +13 -3
- package/benchmarks/adapter-self-test.mjs +6 -2
- package/benchmarks/adapters/example-allow.mjs +5 -2
- package/benchmarks/adapters/mem0-platform.mjs +19 -12
- package/benchmarks/adapters/zep-cloud.mjs +51 -27
- package/benchmarks/baselines.js +11 -6
- package/benchmarks/build-leaderboard.mjs +36 -23
- package/benchmarks/cases.js +24 -12
- package/benchmarks/create-conformance-card.mjs +12 -3
- package/benchmarks/create-submission-bundle.mjs +22 -8
- package/benchmarks/dry-run-external-adapters.mjs +24 -12
- package/benchmarks/guardbench.js +263 -123
- package/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +4 -4
- package/benchmarks/output/external/guardbench-external-dry-run.json +1 -1
- package/benchmarks/output/external/guardbench-external-evidence.json +1 -1
- package/benchmarks/output/guardbench-conformance-card.json +12 -12
- package/benchmarks/output/guardbench-raw.json +106 -106
- package/benchmarks/output/guardbench-summary.json +168 -168
- package/benchmarks/output/leaderboard/guardbench-leaderboard.json +5 -5
- package/benchmarks/output/leaderboard/guardbench-leaderboard.md +2 -2
- package/benchmarks/output/submission-bundle/guardbench-conformance-card.json +12 -12
- package/benchmarks/output/submission-bundle/guardbench-raw.json +106 -106
- package/benchmarks/output/submission-bundle/guardbench-summary.json +168 -168
- package/benchmarks/output/submission-bundle/submission-manifest.json +11 -11
- package/benchmarks/output/submission-bundle/validation-report.json +1 -1
- package/benchmarks/output/summary.json +58 -58
- package/benchmarks/perf-snapshot.js +12 -9
- package/benchmarks/perf.bench.js +14 -6
- package/benchmarks/public-paths.mjs +11 -5
- package/benchmarks/reference-results.js +10 -5
- package/benchmarks/report.js +48 -27
- package/benchmarks/run-external-guardbench.mjs +47 -25
- package/benchmarks/run.js +112 -59
- package/benchmarks/validate-adapter-module.mjs +13 -10
- package/benchmarks/validate-adapter-registry.mjs +16 -5
- package/benchmarks/validate-guardbench-artifacts.mjs +76 -19
- package/benchmarks/verify-external-evidence.mjs +86 -31
- package/benchmarks/verify-publication-artifacts.mjs +34 -11
- package/benchmarks/verify-submission-bundle.mjs +9 -4
- package/dist/mcp-server/config.d.ts +1 -1
- package/dist/mcp-server/config.d.ts.map +1 -1
- package/dist/mcp-server/config.js +5 -3
- package/dist/mcp-server/config.js.map +1 -1
- package/dist/mcp-server/index.d.ts +7 -347
- package/dist/mcp-server/index.d.ts.map +1 -1
- package/dist/mcp-server/index.js +289 -256
- package/dist/mcp-server/index.js.map +1 -1
- package/dist/mcp-server/tool-schemas.d.ts +341 -0
- package/dist/mcp-server/tool-schemas.d.ts.map +1 -0
- package/dist/mcp-server/tool-schemas.js +248 -0
- package/dist/mcp-server/tool-schemas.js.map +1 -0
- package/dist/mcp-server/tool-validation.d.ts +17 -0
- package/dist/mcp-server/tool-validation.d.ts.map +1 -0
- package/dist/mcp-server/tool-validation.js +41 -0
- package/dist/mcp-server/tool-validation.js.map +1 -0
- package/dist/src/action-key.d.ts.map +1 -1
- package/dist/src/action-key.js +6 -2
- package/dist/src/action-key.js.map +1 -1
- package/dist/src/adaptive.d.ts.map +1 -1
- package/dist/src/adaptive.js +4 -2
- package/dist/src/adaptive.js.map +1 -1
- package/dist/src/affect.d.ts.map +1 -1
- package/dist/src/affect.js +8 -5
- package/dist/src/affect.js.map +1 -1
- package/dist/src/audrey.d.ts +1 -1
- package/dist/src/audrey.d.ts.map +1 -1
- package/dist/src/audrey.js +93 -49
- package/dist/src/audrey.js.map +1 -1
- package/dist/src/capsule.d.ts.map +1 -1
- package/dist/src/capsule.js +37 -15
- package/dist/src/capsule.js.map +1 -1
- package/dist/src/causal.d.ts +1 -1
- package/dist/src/causal.d.ts.map +1 -1
- package/dist/src/causal.js +4 -2
- package/dist/src/causal.js.map +1 -1
- package/dist/src/confidence.d.ts.map +1 -1
- package/dist/src/confidence.js +5 -5
- package/dist/src/confidence.js.map +1 -1
- package/dist/src/consolidate.d.ts.map +1 -1
- package/dist/src/consolidate.js +17 -9
- package/dist/src/consolidate.js.map +1 -1
- package/dist/src/context.js +1 -1
- package/dist/src/context.js.map +1 -1
- package/dist/src/controller.d.ts.map +1 -1
- package/dist/src/controller.js +24 -13
- package/dist/src/controller.js.map +1 -1
- package/dist/src/db.d.ts.map +1 -1
- package/dist/src/db.js +78 -27
- package/dist/src/db.js.map +1 -1
- package/dist/src/decay.d.ts +1 -1
- package/dist/src/decay.d.ts.map +1 -1
- package/dist/src/decay.js +1 -1
- package/dist/src/decay.js.map +1 -1
- package/dist/src/embedding.d.ts +12 -4
- package/dist/src/embedding.d.ts.map +1 -1
- package/dist/src/embedding.js +18 -16
- package/dist/src/embedding.js.map +1 -1
- package/dist/src/encode.d.ts.map +1 -1
- package/dist/src/encode.js +5 -4
- package/dist/src/encode.js.map +1 -1
- package/dist/src/events.d.ts +3 -2
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +7 -3
- package/dist/src/events.js.map +1 -1
- package/dist/src/export.d.ts.map +1 -1
- package/dist/src/export.js +21 -7
- package/dist/src/export.js.map +1 -1
- package/dist/src/feedback.d.ts.map +1 -1
- package/dist/src/feedback.js +1 -1
- package/dist/src/feedback.js.map +1 -1
- package/dist/src/forget.d.ts.map +1 -1
- package/dist/src/forget.js +12 -6
- package/dist/src/forget.js.map +1 -1
- package/dist/src/fts.d.ts.map +1 -1
- package/dist/src/fts.js +20 -8
- package/dist/src/fts.js.map +1 -1
- package/dist/src/hybrid-recall.d.ts.map +1 -1
- package/dist/src/hybrid-recall.js +12 -6
- package/dist/src/hybrid-recall.js.map +1 -1
- package/dist/src/impact.d.ts.map +1 -1
- package/dist/src/impact.js +26 -10
- package/dist/src/impact.js.map +1 -1
- package/dist/src/import.d.ts.map +1 -1
- package/dist/src/import.js +11 -6
- package/dist/src/import.js.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/interference.d.ts.map +1 -1
- package/dist/src/interference.js +10 -5
- package/dist/src/interference.js.map +1 -1
- package/dist/src/introspect.d.ts.map +1 -1
- package/dist/src/introspect.js +12 -6
- package/dist/src/introspect.js.map +1 -1
- package/dist/src/llm.d.ts +2 -2
- package/dist/src/llm.d.ts.map +1 -1
- package/dist/src/llm.js +6 -6
- package/dist/src/llm.js.map +1 -1
- package/dist/src/migrate.d.ts.map +1 -1
- package/dist/src/migrate.js +10 -4
- package/dist/src/migrate.js.map +1 -1
- package/dist/src/preflight.d.ts.map +1 -1
- package/dist/src/preflight.js +6 -8
- package/dist/src/preflight.js.map +1 -1
- package/dist/src/profile.d.ts.map +1 -1
- package/dist/src/profile.js.map +1 -1
- package/dist/src/promote.d.ts.map +1 -1
- package/dist/src/promote.js +16 -7
- package/dist/src/promote.js.map +1 -1
- package/dist/src/prompts.d.ts.map +1 -1
- package/dist/src/prompts.js +1 -2
- package/dist/src/prompts.js.map +1 -1
- package/dist/src/recall.d.ts.map +1 -1
- package/dist/src/recall.js +85 -18
- package/dist/src/recall.js.map +1 -1
- package/dist/src/redact.d.ts.map +1 -1
- package/dist/src/redact.js +9 -4
- package/dist/src/redact.js.map +1 -1
- package/dist/src/reflexes.d.ts.map +1 -1
- package/dist/src/reflexes.js +1 -7
- package/dist/src/reflexes.js.map +1 -1
- package/dist/src/rollback.d.ts.map +1 -1
- package/dist/src/rollback.js +4 -2
- package/dist/src/rollback.js.map +1 -1
- package/dist/src/routes.d.ts.map +1 -1
- package/dist/src/routes.js +33 -13
- package/dist/src/routes.js.map +1 -1
- package/dist/src/rules-compiler.d.ts.map +1 -1
- package/dist/src/rules-compiler.js +24 -2
- package/dist/src/rules-compiler.js.map +1 -1
- package/dist/src/server.js +2 -2
- package/dist/src/server.js.map +1 -1
- package/dist/src/tool-trace.d.ts +2 -2
- package/dist/src/tool-trace.d.ts.map +1 -1
- package/dist/src/tool-trace.js +12 -4
- package/dist/src/tool-trace.js.map +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ulid.js +1 -1
- package/dist/src/ulid.js.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/src/validate.js +20 -10
- package/dist/src/validate.js.map +1 -1
- package/docs/paper/07-evaluation.md +5 -5
- package/docs/paper/audrey-paper-v1.md +5 -5
- package/docs/paper/evidence-ledger.md +1 -1
- package/docs/paper/output/arxiv/arxiv-manifest.json +4 -4
- package/docs/paper/output/arxiv/main.tex +5 -5
- package/docs/paper/output/arxiv-compile-report.json +3 -3
- package/docs/paper/output/submission-bundle/README.md +13 -3
- package/docs/paper/output/submission-bundle/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +4 -4
- package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-dry-run.json +1 -1
- package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-evidence.json +1 -1
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-conformance-card.json +12 -12
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-raw.json +106 -106
- package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-summary.json +168 -168
- package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.json +5 -5
- package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.md +2 -2
- package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/submission-manifest.json +11 -11
- package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/validation-report.json +1 -1
- package/docs/paper/output/submission-bundle/benchmarks/output/summary.json +64 -64
- package/docs/paper/output/submission-bundle/docs/paper/07-evaluation.md +5 -5
- package/docs/paper/output/submission-bundle/docs/paper/audrey-paper-v1.md +5 -5
- package/docs/paper/output/submission-bundle/docs/paper/evidence-ledger.md +1 -1
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/arxiv-manifest.json +4 -4
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/main.tex +5 -5
- package/docs/paper/output/submission-bundle/docs/paper/output/arxiv-compile-report.json +3 -3
- package/docs/paper/output/submission-bundle/package.json +17 -4
- package/docs/paper/output/submission-bundle/paper-submission-manifest.json +34 -34
- package/examples/fintech-ops-demo.js +12 -5
- package/examples/healthcare-ops-demo.js +8 -4
- package/examples/ollama-memory-agent.js +41 -13
- package/examples/stripe-demo.js +12 -5
- package/package.json +17 -4
- package/scripts/audit-release-completion.mjs +179 -101
- package/scripts/create-arxiv-source.mjs +20 -14
- package/scripts/create-paper-submission-bundle.mjs +6 -2
- package/scripts/finalize-release.mjs +111 -36
- package/scripts/prepare-release-cut.mjs +14 -6
- package/scripts/publish-release-bundle.mjs +62 -23
- package/scripts/publish-release-github-api.mjs +89 -24
- package/scripts/smoke-cli.js +9 -9
- package/scripts/sync-paper-artifacts.mjs +5 -1
- package/scripts/verify-arxiv-compile.mjs +52 -16
- package/scripts/verify-arxiv-source.mjs +45 -15
- package/scripts/verify-browser-launch-plan.mjs +28 -11
- package/scripts/verify-browser-launch-results.mjs +32 -14
- package/scripts/verify-paper-artifacts.mjs +539 -79
- package/scripts/verify-paper-claims.mjs +48 -20
- package/scripts/verify-paper-submission-bundle.mjs +22 -11
- package/scripts/verify-publication-pack.mjs +23 -9
- package/scripts/verify-release-readiness.mjs +211 -76
|
@@ -895,14 +895,14 @@ These numbers measure Audrey's local call path under an in-process mock embeddin
|
|
|
895
895
|
|
|
896
896
|
### Behavioral Regression Result
|
|
897
897
|
|
|
898
|
-
The current `benchmarks/output/summary.json` was generated on 2026-05-
|
|
898
|
+
The current `benchmarks/output/summary.json` was generated on 2026-05-29T13:33:19.790Z with command `node benchmarks/run.js --provider mock --dimensions 64` (Ledger: E24). It reports:
|
|
899
899
|
|
|
900
900
|
| System | Score Percent | Pass Rate | Average Duration Ms |
|
|
901
901
|
|---|---:|---:|---:|
|
|
902
|
-
| Audrey | 100 | 100 |
|
|
903
|
-
| Vector Only | 41.66666666666667 | 25 | 0.
|
|
902
|
+
| Audrey | 100 | 100 | 14.75 |
|
|
903
|
+
| Vector Only | 41.66666666666667 | 25 | 0.4166666666666667 |
|
|
904
904
|
| Keyword + Recency | 41.66666666666667 | 25 | 0.5833333333333334 |
|
|
905
|
-
| Recent Window | 37.5 | 25 | 0 |
|
|
905
|
+
| Recent Window | 37.5 | 25 | 0.08333333333333333 |
|
|
906
906
|
|
|
907
907
|
This output is a regression-gate result. The baselines are toy local baselines used to catch retrieval and lifecycle regressions in the Audrey codebase. They are not external systems, not tuned competitor implementations, and not GuardBench baselines (Ledger: E23-E24). The current suite covers retrieval and operation families such as information extraction, knowledge updates, multi-session reasoning, conflict resolution, procedural learning, privacy boundary, overwrite, delete-and-abstain, semantic merge, and procedural merge (Ledger: E23-E24).
|
|
908
908
|
|
|
@@ -924,7 +924,7 @@ It reports local adapters only, not external-system comparisons (Ledger: E46):
|
|
|
924
924
|
| Evidence recall | 100% |
|
|
925
925
|
| Redaction leaks | 0 |
|
|
926
926
|
| Recall-degradation detection | 100% |
|
|
927
|
-
| Guard latency p50 / p95 |
|
|
927
|
+
| Guard latency p50 / p95 | 3.09 ms / 28.181 ms |
|
|
928
928
|
| Published artifact raw-secret leaks | 0 |
|
|
929
929
|
| Audrey Guard decision accuracy | 100% |
|
|
930
930
|
| No-memory decision accuracy | 10% |
|
|
@@ -49,7 +49,7 @@ Every implementation claim in the paper should point to one or more ledger IDs i
|
|
|
49
49
|
| E43 - Audrey exposes a Claude Code hook generator, guarded settings apply path, and hook-mode Guard command: `hook-config claude-code` emits hooks, `hook-config claude-code --apply --scope project|user` merges them into Claude Code settings with backup/idempotence, `guard --hook --fail-on-warn` consumes PreToolUse JSON and returns `hookSpecificOutput.permissionDecision`, and `observe-tool` records post-tool events. Codex hook wiring remains pending on a stable host hook surface. | Hook integration boundary | README.md; mcp-server/index.ts; tests/mcp-server.test.js | Yes, focused Vitest and CLI hook smoke passed on 2026-05-12 |
|
|
50
50
|
| E44 - Audrey preflight events now persist `preflight_evidence_ids` and `audrey_guard_action_key`; `memory_validate` accepts optional `preflight_event_id`, action key, and evidence ids, persists them on the validation audit event, and rejects validation lineage when the memory id was not evidence for that preflight. | Validation lineage implementation | src/action-key.ts; src/controller.ts; src/preflight.ts; src/audrey.ts; mcp-server/index.ts; tests/controller.test.js | Yes, focused Vitest passed on 2026-05-12 |
|
|
51
51
|
| E45 - Preflight risk scoring uses a fixed severity map (`info=0.1`, `low=0.25`, `medium=0.55`, `high=0.85`), sorts warnings by severity, and strict mode blocks on high-severity warnings; the scoring path does not consume validation feedback. | Fixed risk scoring boundary | src/preflight.ts:6-60,291-299,332-338; src/feedback.ts:3-18,70-163 | Yes, 2026-05-08 |
|
|
52
|
-
| E46 - `benchmarks/guardbench.js` runs ten local comparative GuardBench scenarios across Audrey Guard, no-memory, recent-window, vector-only, and FTS-only adapters and writes `benchmarks/output/guardbench-summary.json`, `benchmarks/output/guardbench-manifest.json`, and `benchmarks/output/guardbench-raw.json`; the latest local run has Audrey Guard passing 10/10 scenarios with 100% prevention rate, 0% false-block rate, 100% evidence recall, zero decision-output redaction leaks, zero published artifact raw-secret leaks, 100% recall-degradation detection, 100% decision accuracy, and
|
|
52
|
+
| E46 - `benchmarks/guardbench.js` runs ten local comparative GuardBench scenarios across Audrey Guard, no-memory, recent-window, vector-only, and FTS-only adapters and writes `benchmarks/output/guardbench-summary.json`, `benchmarks/output/guardbench-manifest.json`, and `benchmarks/output/guardbench-raw.json`; the latest local run has Audrey Guard passing 10/10 scenarios with 100% prevention rate, 0% false-block rate, 100% evidence recall, zero decision-output redaction leaks, zero published artifact raw-secret leaks, 100% recall-degradation detection, 100% decision accuracy, and 3.09ms/28.181ms p50/p95 guard latency under the mock-provider methodology. Baseline decision accuracy was no-memory 10%, recent-window 60%, vector-only 40%, and FTS-only 10%, with 0% full-contract pass rate for each baseline. | GuardBench local comparative results | benchmarks/guardbench.js; benchmarks/output/guardbench-summary.json; benchmarks/output/guardbench-manifest.json; benchmarks/output/guardbench-raw.json; package.json | Yes, `npm run bench:guard:check` passed on 2026-05-13 |
|
|
53
53
|
| E47 - GuardBench accepts external ESM adapters through `--adapter`, supports `default`, `adapter`, or `createGuardBenchAdapter()` exports, withholds `expectedDecision` and `requiredEvidence` during adapter execution, then scores adapter output against the same full-contract decision/evidence/redaction checks. | GuardBench external adapter contract | benchmarks/guardbench.js; tests/guardbench.test.js; package.json | Yes, `node scripts/run-vitest.mjs run tests/guardbench.test.js` passed on 2026-05-12 |
|
|
54
54
|
| E48 - Audrey ships a Mem0 Platform GuardBench adapter that uses the current Mem0 REST shape: V3 async memory add with event polling, V2 filtered memory search, and user-entity cleanup. It requires runtime `MEM0_API_KEY` and is not run by default. | First external-system GuardBench adapter | benchmarks/adapters/mem0-platform.mjs; tests/guardbench.test.js; README.md | Import/contract and mocked REST-flow tests passed on 2026-05-12; live Mem0 run not yet executed |
|
|
55
55
|
| E49 - GuardBench ships a credential-free example external adapter and a `bench:guard:adapter-smoke` script so the adapter loader can be exercised through the real CLI path without external credentials. | External adapter smoke path | benchmarks/adapters/example-allow.mjs; package.json; README.md; tests/guardbench.test.js | Yes, `npm run bench:guard:adapter-smoke` passed on 2026-05-12 |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"suite": "Audrey arXiv source package",
|
|
4
|
-
"generatedAt": "2026-05-
|
|
4
|
+
"generatedAt": "2026-05-29T13:33:28.366Z",
|
|
5
5
|
"sourceMarkdown": "docs/paper/audrey-paper-v1.md",
|
|
6
6
|
"publicationPack": "docs/paper/publication-pack.json",
|
|
7
7
|
"sourceHashes": {
|
|
8
|
-
"sourceMarkdown": "
|
|
8
|
+
"sourceMarkdown": "69410d651699e903d475b8dd7f2a23bf824143ca16061f66028c817bab673789",
|
|
9
9
|
"publicationPack": "a1a523d5938faea72be568b843ac3890e61cea6070b0cfa46acf22ad3d2fb974",
|
|
10
10
|
"referencesBib": "c0bfcaf7bfe37d6933c812e46352be8a95397eaa430a0f5bc94037600a53f654"
|
|
11
11
|
},
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
{
|
|
14
14
|
"path": "main.tex",
|
|
15
15
|
"source": "docs/paper/audrey-paper-v1.md",
|
|
16
|
-
"bytes":
|
|
17
|
-
"sha256": "
|
|
16
|
+
"bytes": 122672,
|
|
17
|
+
"sha256": "d428d54f4b8de3bf0bba45b5e8c5b612dcf595e13770895300fa2581e3d8ff39"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"path": "references.bib",
|
|
@@ -729,14 +729,14 @@ These numbers measure Audrey's local call path under an in-process mock embeddin
|
|
|
729
729
|
|
|
730
730
|
\subsection{Behavioral Regression Result}
|
|
731
731
|
|
|
732
|
-
The current \texttt{benchmarks/output/summary.json} was generated on 2026-05-
|
|
732
|
+
The current \texttt{benchmarks/output/summary.json} was generated on 2026-05-29T13:33:19.790Z with command \texttt{node benchmarks/run.js --provider mock --dimensions 64} (Ledger: E24). It reports:
|
|
733
733
|
|
|
734
734
|
\begin{verbatim}
|
|
735
735
|
| System | Score Percent | Pass Rate | Average Duration Ms |
|
|
736
|
-
| Audrey | 100 | 100 |
|
|
737
|
-
| Vector Only | 41.66666666666667 | 25 | 0.
|
|
736
|
+
| Audrey | 100 | 100 | 14.75 |
|
|
737
|
+
| Vector Only | 41.66666666666667 | 25 | 0.4166666666666667 |
|
|
738
738
|
| Keyword + Recency | 41.66666666666667 | 25 | 0.5833333333333334 |
|
|
739
|
-
| Recent Window | 37.5 | 25 | 0 |
|
|
739
|
+
| Recent Window | 37.5 | 25 | 0.08333333333333333 |
|
|
740
740
|
\end{verbatim}
|
|
741
741
|
|
|
742
742
|
This output is a regression-gate result. The baselines are toy local baselines used to catch retrieval and lifecycle regressions in the Audrey codebase. They are not external systems, not tuned competitor implementations, and not GuardBench baselines (Ledger: E23-E24). The current suite covers retrieval and operation families such as information extraction, knowledge updates, multi-session reasoning, conflict resolution, procedural learning, privacy boundary, overwrite, delete-and-abstain, semantic merge, and procedural merge (Ledger: E23-E24).
|
|
@@ -759,7 +759,7 @@ It reports local adapters only, not external-system comparisons (Ledger: E46):
|
|
|
759
759
|
| Evidence recall | 100% |
|
|
760
760
|
| Redaction leaks | 0 |
|
|
761
761
|
| Recall-degradation detection | 100% |
|
|
762
|
-
| Guard latency p50 / p95 |
|
|
762
|
+
| Guard latency p50 / p95 | 3.09 ms / 28.181 ms |
|
|
763
763
|
| Published artifact raw-secret leaks | 0 |
|
|
764
764
|
| Audrey Guard decision accuracy | 100% |
|
|
765
765
|
| No-memory decision accuracy | 10% |
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"suite": "Audrey arXiv compile check",
|
|
4
|
-
"generatedAt": "2026-05-
|
|
4
|
+
"generatedAt": "2026-05-29T13:33:29.968Z",
|
|
5
5
|
"source": {
|
|
6
6
|
"sourceDir": "docs/paper/output/arxiv",
|
|
7
7
|
"manifest": "docs/paper/output/arxiv/arxiv-manifest.json",
|
|
8
|
-
"manifestSha256": "
|
|
8
|
+
"manifestSha256": "cecbb545033a04a0dcc30e4de9cfaa016f27c95c724db61e3825bd3765fbd2c5",
|
|
9
9
|
"mainTex": "docs/paper/output/arxiv/main.tex",
|
|
10
|
-
"mainTexSha256": "
|
|
10
|
+
"mainTexSha256": "d428d54f4b8de3bf0bba45b5e8c5b612dcf595e13770895300fa2581e3d8ff39",
|
|
11
11
|
"referencesBib": "docs/paper/output/arxiv/references.bib",
|
|
12
12
|
"referencesBibSha256": "c0bfcaf7bfe37d6933c812e46352be8a95397eaa430a0f5bc94037600a53f654"
|
|
13
13
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "audrey",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Local-first memory runtime for AI agents with recall, consolidation, memory reflexes, contradiction detection, and tool-trace learning",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"test": "node scripts/run-vitest.mjs",
|
|
73
73
|
"test:watch": "node scripts/run-vitest.mjs watch",
|
|
74
74
|
"test:artifacts": "npm run bench:perf && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run paper:sync && npm run paper:arxiv && npm run paper:arxiv:verify && npm run paper:arxiv:compile && npm run paper:bundle && npm run paper:bundle:verify && npm run paper:verify",
|
|
75
|
-
"release:gate": "npm run typecheck && npm test && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-registry:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run bench:guard:adapter-module:validate && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:validate && npm run bench:guard:publication:verify && npm run python:release:check && npm run smoke:cli && npm run security:audit && npm run pack:check",
|
|
76
|
-
"release:gate:sandbox": "npm run build && npm run typecheck && npm run bench:perf && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-registry:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run bench:guard:adapter-module:validate && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:validate && npm run bench:guard:publication:verify && npm run python:release:check && npm run smoke:cli && npm run security:audit && npm run pack:check",
|
|
77
|
-
"release:gate:paper": "npm run build && npm run typecheck && npm run bench:perf && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-registry:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run bench:guard:adapter-module:validate && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:validate && npm run bench:guard:publication:verify && npm run python:release:check && npm run paper:sync && npm run paper:arxiv && npm run paper:arxiv:verify && npm run paper:arxiv:compile && npm run paper:launch-plan && npm run paper:launch-results && npm run paper:bundle && npm run paper:bundle:verify && npm run paper:verify && npm run release:readiness && npm run smoke:cli && npm run security:audit && npm run pack:check",
|
|
75
|
+
"release:gate": "npm run typecheck && npm run lint && npm run format:check && npm test && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-registry:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run bench:guard:adapter-module:validate && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:validate && npm run bench:guard:publication:verify && npm run python:release:check && npm run smoke:cli && npm run security:audit && npm run pack:check",
|
|
76
|
+
"release:gate:sandbox": "npm run build && npm run typecheck && npm run lint && npm run format:check && npm run bench:perf && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-registry:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run bench:guard:adapter-module:validate && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:validate && npm run bench:guard:publication:verify && npm run python:release:check && npm run smoke:cli && npm run security:audit && npm run pack:check",
|
|
77
|
+
"release:gate:paper": "npm run build && npm run typecheck && npm run lint && npm run format:check && npm run bench:perf && npm run bench:memory:check && npm run bench:guard:check && npm run bench:guard:card && npm run bench:guard:bundle && npm run bench:guard:bundle:verify && npm run bench:guard:leaderboard && npm run bench:guard:adapter-registry:validate && npm run bench:guard:external:dry-run && npm run bench:guard:external:evidence && npm run bench:guard:adapter-module:validate && npm run bench:guard:adapter-self-test && npm run bench:guard:adapter-self-test:validate && npm run bench:guard:validate && npm run bench:guard:publication:verify && npm run python:release:check && npm run paper:sync && npm run paper:arxiv && npm run paper:arxiv:verify && npm run paper:arxiv:compile && npm run paper:launch-plan && npm run paper:launch-results && npm run paper:bundle && npm run paper:bundle:verify && npm run paper:verify && npm run release:readiness && npm run smoke:cli && npm run security:audit && npm run pack:check",
|
|
78
78
|
"release:cut:plan": "node scripts/prepare-release-cut.mjs --json",
|
|
79
79
|
"release:cut:apply": "node scripts/prepare-release-cut.mjs --apply",
|
|
80
80
|
"release:readiness": "node scripts/verify-release-readiness.mjs --allow-pending",
|
|
@@ -135,6 +135,10 @@
|
|
|
135
135
|
"paper:sync": "node scripts/sync-paper-artifacts.mjs",
|
|
136
136
|
"paper:verify": "node scripts/verify-paper-artifacts.mjs",
|
|
137
137
|
"typecheck": "tsc --noEmit",
|
|
138
|
+
"lint": "eslint .",
|
|
139
|
+
"lint:fix": "eslint . --fix",
|
|
140
|
+
"format": "prettier --write \"src/**/*.ts\" \"mcp-server/**/*.ts\" \"tests/**/*.js\" \"benchmarks/**/*.{js,mjs}\" \"scripts/**/*.{js,mjs}\" \"examples/**/*.js\" \"*.{js,mjs}\" \".prettierrc.json\"",
|
|
141
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"mcp-server/**/*.ts\" \"tests/**/*.js\" \"benchmarks/**/*.{js,mjs}\" \"scripts/**/*.{js,mjs}\" \"examples/**/*.js\" \"*.{js,mjs}\" \".prettierrc.json\"",
|
|
138
142
|
"serve": "node dist/mcp-server/index.js serve",
|
|
139
143
|
"docker:build": "docker build -t audrey:local .",
|
|
140
144
|
"docker:up": "docker compose up -d --build",
|
|
@@ -200,11 +204,20 @@
|
|
|
200
204
|
"zod": "^4.4.3"
|
|
201
205
|
},
|
|
202
206
|
"devDependencies": {
|
|
207
|
+
"@eslint/js": "^10.0.1",
|
|
203
208
|
"@types/better-sqlite3": "^7.6.13",
|
|
204
209
|
"@types/node": "^25.6.2",
|
|
210
|
+
"eslint": "^10.4.0",
|
|
211
|
+
"eslint-config-prettier": "^10.1.8",
|
|
212
|
+
"globals": "^17.6.0",
|
|
213
|
+
"prettier": "^3.8.3",
|
|
205
214
|
"typescript": "^6.0.3",
|
|
215
|
+
"typescript-eslint": "^8.60.0",
|
|
206
216
|
"vitest": "^4.1.5"
|
|
207
217
|
},
|
|
218
|
+
"overrides": {
|
|
219
|
+
"qs": "^6.15.2"
|
|
220
|
+
},
|
|
208
221
|
"directories": {
|
|
209
222
|
"example": "examples",
|
|
210
223
|
"test": "tests"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"suite": "Audrey paper submission bundle",
|
|
4
|
-
"generatedAt": "2026-05-
|
|
4
|
+
"generatedAt": "2026-05-29T13:33:30.195Z",
|
|
5
5
|
"sourceRoot": ".",
|
|
6
6
|
"outDir": "docs/paper/output/submission-bundle",
|
|
7
7
|
"claimVerification": {
|
|
@@ -17,33 +17,33 @@
|
|
|
17
17
|
"scenarios": 10,
|
|
18
18
|
"redactionLeaks": 0,
|
|
19
19
|
"artifactLeaks": 0,
|
|
20
|
-
"latencyP50Ms":
|
|
21
|
-
"latencyP95Ms":
|
|
20
|
+
"latencyP50Ms": 3.09,
|
|
21
|
+
"latencyP95Ms": 28.181
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
{
|
|
25
25
|
"path": "benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json",
|
|
26
26
|
"source": "benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json",
|
|
27
27
|
"bytes": 1267,
|
|
28
|
-
"sha256": "
|
|
28
|
+
"sha256": "53354a5acf7758d5707e3f274532149b86a3ee1c1785ced4e2fa2bb59bf5c311"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"path": "benchmarks/output/external/guardbench-external-dry-run.json",
|
|
32
32
|
"source": "benchmarks/output/external/guardbench-external-dry-run.json",
|
|
33
33
|
"bytes": 1831,
|
|
34
|
-
"sha256": "
|
|
34
|
+
"sha256": "2803eb8b7b552cdacf30b91c71fe34533f84d69c3891a096a65ef44f700924aa"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"path": "benchmarks/output/external/guardbench-external-evidence.json",
|
|
38
38
|
"source": "benchmarks/output/external/guardbench-external-evidence.json",
|
|
39
39
|
"bytes": 1638,
|
|
40
|
-
"sha256": "
|
|
40
|
+
"sha256": "f79dd222e44e2544b03bb7a7b7368e444eebfac6e0192beb42411d30333a6676"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "benchmarks/output/guardbench-conformance-card.json",
|
|
44
44
|
"source": "benchmarks/output/guardbench-conformance-card.json",
|
|
45
|
-
"bytes":
|
|
46
|
-
"sha256": "
|
|
45
|
+
"bytes": 1748,
|
|
46
|
+
"sha256": "88cba808b893cde3530f4e29317d4cf9ae3b20f08456c58d97d4e5300f5f9298"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"path": "benchmarks/output/guardbench-manifest.json",
|
|
@@ -54,44 +54,44 @@
|
|
|
54
54
|
{
|
|
55
55
|
"path": "benchmarks/output/guardbench-raw.json",
|
|
56
56
|
"source": "benchmarks/output/guardbench-raw.json",
|
|
57
|
-
"bytes":
|
|
58
|
-
"sha256": "
|
|
57
|
+
"bytes": 43466,
|
|
58
|
+
"sha256": "66d4b69087258638f3572a40e1fd59bb84067034f899eaa2c27eed2dde554b2b"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"path": "benchmarks/output/guardbench-summary.json",
|
|
62
62
|
"source": "benchmarks/output/guardbench-summary.json",
|
|
63
|
-
"bytes":
|
|
64
|
-
"sha256": "
|
|
63
|
+
"bytes": 69359,
|
|
64
|
+
"sha256": "91f264dd889e2c639a6fc6d1b867bc228b94c84ed5120345e23dddb79c11ee74"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "benchmarks/output/leaderboard/guardbench-leaderboard.json",
|
|
68
68
|
"source": "benchmarks/output/leaderboard/guardbench-leaderboard.json",
|
|
69
|
-
"bytes":
|
|
70
|
-
"sha256": "
|
|
69
|
+
"bytes": 2797,
|
|
70
|
+
"sha256": "c7ea992ccd65991b8fc8d6283c93417d8380c19af1d208fa1ae5205406cdc6f3"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"path": "benchmarks/output/leaderboard/guardbench-leaderboard.md",
|
|
74
74
|
"source": "benchmarks/output/leaderboard/guardbench-leaderboard.md",
|
|
75
75
|
"bytes": 364,
|
|
76
|
-
"sha256": "
|
|
76
|
+
"sha256": "1a68f0218d9821597dfecf3b8dc42d21b24cd3d19c30bfcf3c66ed5cfc6e29dc"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"path": "benchmarks/output/submission-bundle/submission-manifest.json",
|
|
80
80
|
"source": "benchmarks/output/submission-bundle/submission-manifest.json",
|
|
81
|
-
"bytes":
|
|
82
|
-
"sha256": "
|
|
81
|
+
"bytes": 3985,
|
|
82
|
+
"sha256": "888f1a0a9e1e905405b70e2ff56287267555191b01b19905fbb76c579ea647aa"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
"path": "benchmarks/output/submission-bundle/validation-report.json",
|
|
86
86
|
"source": "benchmarks/output/submission-bundle/validation-report.json",
|
|
87
87
|
"bytes": 739,
|
|
88
|
-
"sha256": "
|
|
88
|
+
"sha256": "284c40f608508d59e8cdc8047371dfcf0a9824a891ff37b77035241ab5de275f"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"path": "benchmarks/output/summary.json",
|
|
92
92
|
"source": "benchmarks/output/summary.json",
|
|
93
|
-
"bytes":
|
|
94
|
-
"sha256": "
|
|
93
|
+
"bytes": 100761,
|
|
94
|
+
"sha256": "ee298b1a492a72bd61ce5929242997399ac509988bca6942e29485c15d0efe78"
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
"path": "benchmarks/schemas/guardbench-adapter-registry.schema.json",
|
|
@@ -216,8 +216,8 @@
|
|
|
216
216
|
{
|
|
217
217
|
"path": "docs/paper/07-evaluation.md",
|
|
218
218
|
"source": "docs/paper/07-evaluation.md",
|
|
219
|
-
"bytes":
|
|
220
|
-
"sha256": "
|
|
219
|
+
"bytes": 11273,
|
|
220
|
+
"sha256": "a8af98d9d69a75aff57a27fa10e7df92567541588472e86609311fdf80000304"
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
"path": "docs/paper/08-discussion-limitations.md",
|
|
@@ -252,8 +252,8 @@
|
|
|
252
252
|
{
|
|
253
253
|
"path": "docs/paper/audrey-paper-v1.md",
|
|
254
254
|
"source": "docs/paper/audrey-paper-v1.md",
|
|
255
|
-
"bytes":
|
|
256
|
-
"sha256": "
|
|
255
|
+
"bytes": 116621,
|
|
256
|
+
"sha256": "69410d651699e903d475b8dd7f2a23bf824143ca16061f66028c817bab673789"
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
"path": "docs/paper/browser-launch-plan.json",
|
|
@@ -294,26 +294,26 @@
|
|
|
294
294
|
{
|
|
295
295
|
"path": "docs/paper/evidence-ledger.md",
|
|
296
296
|
"source": "docs/paper/evidence-ledger.md",
|
|
297
|
-
"bytes":
|
|
298
|
-
"sha256": "
|
|
297
|
+
"bytes": 61843,
|
|
298
|
+
"sha256": "a5277812110254062bd77b3d1f7e00908aa9674726e95b877c6be7e15c8158a4"
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
301
|
"path": "docs/paper/output/arxiv-compile-report.json",
|
|
302
302
|
"source": "docs/paper/output/arxiv-compile-report.json",
|
|
303
303
|
"bytes": 924,
|
|
304
|
-
"sha256": "
|
|
304
|
+
"sha256": "f25c12bee4b85fd18f0f3df10293a3a1fb9241f53be445574d918546e1a68be0"
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
307
|
"path": "docs/paper/output/arxiv/arxiv-manifest.json",
|
|
308
308
|
"source": "docs/paper/output/arxiv/arxiv-manifest.json",
|
|
309
309
|
"bytes": 1316,
|
|
310
|
-
"sha256": "
|
|
310
|
+
"sha256": "cecbb545033a04a0dcc30e4de9cfaa016f27c95c724db61e3825bd3765fbd2c5"
|
|
311
311
|
},
|
|
312
312
|
{
|
|
313
313
|
"path": "docs/paper/output/arxiv/main.tex",
|
|
314
314
|
"source": "docs/paper/output/arxiv/main.tex",
|
|
315
|
-
"bytes":
|
|
316
|
-
"sha256": "
|
|
315
|
+
"bytes": 122672,
|
|
316
|
+
"sha256": "d428d54f4b8de3bf0bba45b5e8c5b612dcf595e13770895300fa2581e3d8ff39"
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
319
|
"path": "docs/paper/output/arxiv/README-arxiv.txt",
|
|
@@ -366,14 +366,14 @@
|
|
|
366
366
|
{
|
|
367
367
|
"path": "package.json",
|
|
368
368
|
"source": "package.json",
|
|
369
|
-
"bytes":
|
|
370
|
-
"sha256": "
|
|
369
|
+
"bytes": 12529,
|
|
370
|
+
"sha256": "2919b602beb87d25382ddc5dded4eb8d0eb4ef1b5d8741ea910c3b02655e592a"
|
|
371
371
|
},
|
|
372
372
|
{
|
|
373
373
|
"path": "README.md",
|
|
374
374
|
"source": "README.md",
|
|
375
|
-
"bytes":
|
|
376
|
-
"sha256": "
|
|
375
|
+
"bytes": 27091,
|
|
376
|
+
"sha256": "a84ff9c4b0b98a919ffaaeaa71359f0f8d1e00019cac60d4816d57cf271ff01f"
|
|
377
377
|
}
|
|
378
378
|
]
|
|
379
379
|
}
|
|
@@ -11,7 +11,8 @@ async function demo() {
|
|
|
11
11
|
|
|
12
12
|
console.log('--- Encoding payment-operations incidents ---');
|
|
13
13
|
await brain.encode({
|
|
14
|
-
content:
|
|
14
|
+
content:
|
|
15
|
+
'Processor X returned HTTP 429 when payout retries exceeded 120 requests per minute for marketplace merchants.',
|
|
15
16
|
source: 'direct-observation',
|
|
16
17
|
salience: 0.9,
|
|
17
18
|
tags: ['payments', 'payouts', 'rate-limit'],
|
|
@@ -19,7 +20,8 @@ async function demo() {
|
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
await brain.encode({
|
|
22
|
-
content:
|
|
23
|
+
content:
|
|
24
|
+
'On-call notes show payout incident volume drops after retry batches are capped at 50 merchants per worker.',
|
|
23
25
|
source: 'tool-result',
|
|
24
26
|
salience: 0.8,
|
|
25
27
|
tags: ['payments', 'payouts', 'ops'],
|
|
@@ -27,7 +29,8 @@ async function demo() {
|
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
await brain.encode({
|
|
30
|
-
content:
|
|
32
|
+
content:
|
|
33
|
+
'Risk operations requested automatic escalation when payout failures affect more than three merchants in the same hour.',
|
|
31
34
|
source: 'told-by-user',
|
|
32
35
|
salience: 0.7,
|
|
33
36
|
tags: ['payments', 'escalation', 'risk'],
|
|
@@ -39,9 +42,13 @@ async function demo() {
|
|
|
39
42
|
minClusterSize: 3,
|
|
40
43
|
similarityThreshold: -0.3,
|
|
41
44
|
extractPrinciple: () => ({
|
|
42
|
-
content:
|
|
45
|
+
content:
|
|
46
|
+
'When payout retries spike, cap retry batches and escalate once multiple merchants are affected in the same hour.',
|
|
43
47
|
type: 'procedural',
|
|
44
|
-
conditions: [
|
|
48
|
+
conditions: [
|
|
49
|
+
'payout failures > 3 merchants per hour',
|
|
50
|
+
'processor returns 429 or throttling errors',
|
|
51
|
+
],
|
|
45
52
|
}),
|
|
46
53
|
});
|
|
47
54
|
|
|
@@ -11,7 +11,8 @@ async function demo() {
|
|
|
11
11
|
|
|
12
12
|
console.log('--- Encoding care-coordination observations ---');
|
|
13
13
|
await brain.encode({
|
|
14
|
-
content:
|
|
14
|
+
content:
|
|
15
|
+
'Referral queue delays drop when missing imaging notes are requested before prior-authorization submission.',
|
|
15
16
|
source: 'direct-observation',
|
|
16
17
|
salience: 0.9,
|
|
17
18
|
tags: ['healthcare-ops', 'prior-auth', 'referrals'],
|
|
@@ -19,7 +20,8 @@ async function demo() {
|
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
await brain.encode({
|
|
22
|
-
content:
|
|
23
|
+
content:
|
|
24
|
+
'Scheduling team reports the highest callback completion rate between 4pm and 6pm for discharge follow-up.',
|
|
23
25
|
source: 'tool-result',
|
|
24
26
|
salience: 0.8,
|
|
25
27
|
tags: ['healthcare-ops', 'follow-up', 'scheduling'],
|
|
@@ -27,7 +29,8 @@ async function demo() {
|
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
await brain.encode({
|
|
30
|
-
content:
|
|
32
|
+
content:
|
|
33
|
+
'Care coordinators want interpreter requirements captured in every handoff note before outreach starts.',
|
|
31
34
|
source: 'told-by-user',
|
|
32
35
|
salience: 0.7,
|
|
33
36
|
tags: ['healthcare-ops', 'handoff', 'interpreter'],
|
|
@@ -39,7 +42,8 @@ async function demo() {
|
|
|
39
42
|
minClusterSize: 3,
|
|
40
43
|
similarityThreshold: -0.3,
|
|
41
44
|
extractPrinciple: () => ({
|
|
42
|
-
content:
|
|
45
|
+
content:
|
|
46
|
+
'For care-coordination workflows, collect missing documentation and communication preferences before outreach or prior-auth submission.',
|
|
43
47
|
type: 'procedural',
|
|
44
48
|
conditions: ['prior-auth missing documentation', 'handoff note lacks outreach constraints'],
|
|
45
49
|
}),
|
|
@@ -6,8 +6,9 @@ const OLLAMA_MODEL = process.env.OLLAMA_MODEL || 'qwen3';
|
|
|
6
6
|
const AUDREY_API_KEY = process.env.AUDREY_API_KEY || '';
|
|
7
7
|
const MAX_TOOL_LOOPS = Number.parseInt(process.env.MAX_TOOL_LOOPS || '4', 10);
|
|
8
8
|
|
|
9
|
-
const userPrompt =
|
|
10
|
-
|
|
9
|
+
const userPrompt =
|
|
10
|
+
process.argv.slice(2).join(' ').trim() ||
|
|
11
|
+
'Use Audrey memory to explain how this local Ollama agent should remember useful facts.';
|
|
11
12
|
|
|
12
13
|
function usage() {
|
|
13
14
|
console.log(`
|
|
@@ -112,15 +113,22 @@ const tools = [
|
|
|
112
113
|
type: 'function',
|
|
113
114
|
function: {
|
|
114
115
|
name: 'memory_preflight',
|
|
115
|
-
description:
|
|
116
|
+
description:
|
|
117
|
+
'Check Audrey memory before taking an action, so prior failures and rules are not repeated.',
|
|
116
118
|
parameters: {
|
|
117
119
|
type: 'object',
|
|
118
120
|
required: ['action'],
|
|
119
121
|
properties: {
|
|
120
122
|
action: { type: 'string', description: 'Action the agent is considering.' },
|
|
121
123
|
tool: { type: 'string', description: 'Optional tool or command family.' },
|
|
122
|
-
strict: {
|
|
123
|
-
|
|
124
|
+
strict: {
|
|
125
|
+
type: 'boolean',
|
|
126
|
+
description: 'If true, high-severity warnings can block the action.',
|
|
127
|
+
},
|
|
128
|
+
include_capsule: {
|
|
129
|
+
type: 'boolean',
|
|
130
|
+
description: 'Include full capsule context in the result.',
|
|
131
|
+
},
|
|
124
132
|
},
|
|
125
133
|
},
|
|
126
134
|
},
|
|
@@ -129,15 +137,22 @@ const tools = [
|
|
|
129
137
|
type: 'function',
|
|
130
138
|
function: {
|
|
131
139
|
name: 'memory_reflexes',
|
|
132
|
-
description:
|
|
140
|
+
description:
|
|
141
|
+
'Return Audrey Memory Reflexes: trigger-response rules for the action the agent is considering.',
|
|
133
142
|
parameters: {
|
|
134
143
|
type: 'object',
|
|
135
144
|
required: ['action'],
|
|
136
145
|
properties: {
|
|
137
146
|
action: { type: 'string', description: 'Action the agent is considering.' },
|
|
138
147
|
tool: { type: 'string', description: 'Optional tool or command family.' },
|
|
139
|
-
strict: {
|
|
140
|
-
|
|
148
|
+
strict: {
|
|
149
|
+
type: 'boolean',
|
|
150
|
+
description: 'If true, high-severity warnings can become blocking reflexes.',
|
|
151
|
+
},
|
|
152
|
+
include_preflight: {
|
|
153
|
+
type: 'boolean',
|
|
154
|
+
description: 'Include the full underlying preflight report.',
|
|
155
|
+
},
|
|
141
156
|
},
|
|
142
157
|
},
|
|
143
158
|
},
|
|
@@ -176,7 +191,8 @@ const tools = [
|
|
|
176
191
|
type: 'function',
|
|
177
192
|
function: {
|
|
178
193
|
name: 'memory_encode',
|
|
179
|
-
description:
|
|
194
|
+
description:
|
|
195
|
+
'Store a useful lasting observation, decision, preference, or procedure in Audrey.',
|
|
180
196
|
parameters: {
|
|
181
197
|
type: 'object',
|
|
182
198
|
required: ['content'],
|
|
@@ -184,7 +200,13 @@ const tools = [
|
|
|
184
200
|
content: { type: 'string', description: 'Memory content to store.' },
|
|
185
201
|
source: {
|
|
186
202
|
type: 'string',
|
|
187
|
-
enum: [
|
|
203
|
+
enum: [
|
|
204
|
+
'direct-observation',
|
|
205
|
+
'told-by-user',
|
|
206
|
+
'tool-result',
|
|
207
|
+
'inference',
|
|
208
|
+
'model-generated',
|
|
209
|
+
],
|
|
188
210
|
description: 'Source reliability category.',
|
|
189
211
|
},
|
|
190
212
|
tags: {
|
|
@@ -270,7 +292,9 @@ async function main() {
|
|
|
270
292
|
try {
|
|
271
293
|
response = await ollamaChat(messages);
|
|
272
294
|
} catch (err) {
|
|
273
|
-
console.error(
|
|
295
|
+
console.error(
|
|
296
|
+
`Ollama is not reachable at ${OLLAMA_URL}, or model "${OLLAMA_MODEL}" is not available.`,
|
|
297
|
+
);
|
|
274
298
|
console.error(`Try: ollama pull ${OLLAMA_MODEL}`);
|
|
275
299
|
console.error(`Details: ${err.message}`);
|
|
276
300
|
process.exit(1);
|
|
@@ -294,7 +318,11 @@ async function main() {
|
|
|
294
318
|
const name = call.function?.name;
|
|
295
319
|
const executor = toolExecutors[name];
|
|
296
320
|
if (!executor) {
|
|
297
|
-
messages.push({
|
|
321
|
+
messages.push({
|
|
322
|
+
role: 'tool',
|
|
323
|
+
tool_name: name || 'unknown',
|
|
324
|
+
content: 'Unknown Audrey tool',
|
|
325
|
+
});
|
|
298
326
|
continue;
|
|
299
327
|
}
|
|
300
328
|
|
|
@@ -320,7 +348,7 @@ async function main() {
|
|
|
320
348
|
console.log('Stopped after MAX_TOOL_LOOPS without a final model answer.');
|
|
321
349
|
}
|
|
322
350
|
|
|
323
|
-
main().catch(
|
|
351
|
+
main().catch(err => {
|
|
324
352
|
console.error(err);
|
|
325
353
|
process.exit(1);
|
|
326
354
|
});
|
package/examples/stripe-demo.js
CHANGED
|
@@ -21,11 +21,15 @@ async function demo() {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
brain.on('consolidation', ({ principlesExtracted, clustersFound }) => {
|
|
24
|
-
console.log(
|
|
24
|
+
console.log(
|
|
25
|
+
` [CONSOLIDATE] Found ${clustersFound} clusters, extracted ${principlesExtracted} principles`,
|
|
26
|
+
);
|
|
25
27
|
});
|
|
26
28
|
|
|
27
29
|
brain.on('reinforcement', ({ episodeId, similarity }) => {
|
|
28
|
-
console.log(
|
|
30
|
+
console.log(
|
|
31
|
+
` [REINFORCE] Episode ${episodeId.slice(0, 8)}... reinforced existing knowledge (sim: ${similarity?.toFixed(2) || 'N/A'})`,
|
|
32
|
+
);
|
|
29
33
|
});
|
|
30
34
|
|
|
31
35
|
// --- Scenario: Agent encounters Stripe rate limits ---
|
|
@@ -41,7 +45,8 @@ async function demo() {
|
|
|
41
45
|
|
|
42
46
|
console.log('\n--- Episode 2: Second hit from different code path ---');
|
|
43
47
|
await brain.encode({
|
|
44
|
-
content:
|
|
48
|
+
content:
|
|
49
|
+
'Stripe webhook verification endpoint returned 429 Too Many Requests during high traffic',
|
|
45
50
|
source: 'tool-result',
|
|
46
51
|
salience: 0.7,
|
|
47
52
|
causal: { trigger: 'webhook-flood', consequence: 'missed-webhook-events' },
|
|
@@ -65,7 +70,7 @@ async function demo() {
|
|
|
65
70
|
// (e.g. OpenAI text-embedding-3-small), a threshold of 0.80+ works well.
|
|
66
71
|
// We drop it here so the demo pipeline runs end-to-end.
|
|
67
72
|
similarityThreshold: -0.3,
|
|
68
|
-
extractPrinciple: (
|
|
73
|
+
extractPrinciple: () => ({
|
|
69
74
|
content: `Stripe enforces ~100 req/s rate limit across all endpoints. Exceeding this causes 429 errors that can stall payment queues and cause missed webhooks. Implement request throttling.`,
|
|
70
75
|
type: 'semantic',
|
|
71
76
|
}),
|
|
@@ -80,7 +85,9 @@ async function demo() {
|
|
|
80
85
|
|
|
81
86
|
console.log(`\nRecalled ${memories.length} memories:`);
|
|
82
87
|
for (const mem of memories) {
|
|
83
|
-
console.log(
|
|
88
|
+
console.log(
|
|
89
|
+
` [${mem.type.toUpperCase()}] (conf: ${mem.confidence.toFixed(2)}, score: ${mem.score.toFixed(3)}) ${mem.content.slice(0, 80)}${mem.content.length > 80 ? '...' : ''}`,
|
|
90
|
+
);
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
// --- Introspection ---
|