audrey 0.17.0 → 0.21.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.
- package/CHANGELOG.md +15 -0
- package/README.md +180 -370
- package/dist/mcp-server/config.d.ts +44 -0
- package/dist/mcp-server/config.d.ts.map +1 -0
- package/dist/mcp-server/config.js +210 -0
- package/dist/mcp-server/config.js.map +1 -0
- package/dist/mcp-server/index.d.ts +181 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/index.js +1530 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/dist/src/adaptive.d.ts +7 -0
- package/dist/src/adaptive.d.ts.map +1 -0
- package/dist/src/adaptive.js +49 -0
- package/dist/src/adaptive.js.map +1 -0
- package/dist/src/affect.d.ts +19 -0
- package/dist/src/affect.d.ts.map +1 -0
- package/dist/src/affect.js +72 -0
- package/dist/src/affect.js.map +1 -0
- package/dist/src/audrey.d.ts +144 -0
- package/dist/src/audrey.d.ts.map +1 -0
- package/dist/src/audrey.js +576 -0
- package/dist/src/audrey.js.map +1 -0
- package/dist/src/capsule.d.ts +68 -0
- package/dist/src/capsule.d.ts.map +1 -0
- package/dist/src/capsule.js +311 -0
- package/dist/src/capsule.js.map +1 -0
- package/dist/src/causal.d.ts +28 -0
- package/dist/src/causal.d.ts.map +1 -0
- package/dist/src/causal.js +65 -0
- package/dist/src/causal.js.map +1 -0
- package/dist/src/confidence.d.ts +12 -0
- package/dist/src/confidence.d.ts.map +1 -0
- package/dist/src/confidence.js +63 -0
- package/dist/src/confidence.js.map +1 -0
- package/dist/src/consolidate.d.ts +8 -0
- package/dist/src/consolidate.d.ts.map +1 -0
- package/dist/src/consolidate.js +218 -0
- package/dist/src/consolidate.js.map +1 -0
- package/dist/src/context.d.ts +3 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +19 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/db.d.ts +12 -0
- package/dist/src/db.d.ts.map +1 -0
- package/dist/src/db.js +380 -0
- package/dist/src/db.js.map +1 -0
- package/dist/src/decay.d.ts +7 -0
- package/dist/src/decay.d.ts.map +1 -0
- package/dist/src/decay.js +68 -0
- package/dist/src/decay.js.map +1 -0
- package/dist/src/embedding.d.ts +57 -0
- package/dist/src/embedding.d.ts.map +1 -0
- package/dist/src/embedding.js +254 -0
- package/dist/src/embedding.js.map +1 -0
- package/dist/src/encode.d.ts +15 -0
- package/dist/src/encode.d.ts.map +1 -0
- package/dist/src/encode.js +36 -0
- package/dist/src/encode.js.map +1 -0
- package/dist/src/events.d.ts +69 -0
- package/dist/src/events.d.ts.map +1 -0
- package/dist/src/events.js +149 -0
- package/dist/src/events.js.map +1 -0
- package/dist/src/export.d.ts +3 -0
- package/dist/src/export.d.ts.map +1 -0
- package/dist/src/export.js +46 -0
- package/dist/src/export.js.map +1 -0
- package/dist/src/forget.d.ts +11 -0
- package/dist/src/forget.d.ts.map +1 -0
- package/dist/src/forget.js +105 -0
- package/dist/src/forget.js.map +1 -0
- package/dist/src/fts.d.ts +34 -0
- package/dist/src/fts.d.ts.map +1 -0
- package/dist/src/fts.js +117 -0
- package/dist/src/fts.js.map +1 -0
- package/dist/src/hybrid-recall.d.ts +37 -0
- package/dist/src/hybrid-recall.d.ts.map +1 -0
- package/dist/src/hybrid-recall.js +213 -0
- package/dist/src/hybrid-recall.js.map +1 -0
- package/dist/src/import.d.ts +4 -0
- package/dist/src/import.d.ts.map +1 -0
- package/dist/src/import.js +127 -0
- package/dist/src/import.js.map +1 -0
- package/dist/src/index.d.ts +26 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{src → dist/src}/index.js +7 -13
- package/dist/src/index.js.map +1 -0
- package/dist/src/interference.d.ts +13 -0
- package/dist/src/interference.d.ts.map +1 -0
- package/dist/src/interference.js +45 -0
- package/dist/src/interference.js.map +1 -0
- package/dist/src/introspect.d.ts +4 -0
- package/dist/src/introspect.d.ts.map +1 -0
- package/dist/src/introspect.js +40 -0
- package/dist/src/introspect.js.map +1 -0
- package/dist/src/llm.d.ts +38 -0
- package/dist/src/llm.d.ts.map +1 -0
- package/dist/src/llm.js +167 -0
- package/dist/src/llm.js.map +1 -0
- package/dist/src/migrate.d.ts +6 -0
- package/dist/src/migrate.d.ts.map +1 -0
- package/dist/src/migrate.js +51 -0
- package/dist/src/migrate.js.map +1 -0
- package/dist/src/preflight.d.ts +51 -0
- package/dist/src/preflight.d.ts.map +1 -0
- package/dist/src/preflight.js +201 -0
- package/dist/src/preflight.js.map +1 -0
- package/dist/src/promote.d.ts +40 -0
- package/dist/src/promote.d.ts.map +1 -0
- package/dist/src/promote.js +200 -0
- package/dist/src/promote.js.map +1 -0
- package/dist/src/prompts.d.ts +16 -0
- package/dist/src/prompts.d.ts.map +1 -0
- package/{src → dist/src}/prompts.js +172 -203
- package/dist/src/prompts.js.map +1 -0
- package/dist/src/recall.d.ts +9 -0
- package/dist/src/recall.d.ts.map +1 -0
- package/dist/src/recall.js +432 -0
- package/dist/src/recall.js.map +1 -0
- package/dist/src/redact.d.ts +27 -0
- package/dist/src/redact.d.ts.map +1 -0
- package/dist/src/redact.js +228 -0
- package/dist/src/redact.js.map +1 -0
- package/dist/src/reflexes.d.ts +35 -0
- package/dist/src/reflexes.d.ts.map +1 -0
- package/dist/src/reflexes.js +87 -0
- package/dist/src/reflexes.js.map +1 -0
- package/dist/src/rollback.d.ts +8 -0
- package/dist/src/rollback.d.ts.map +1 -0
- package/dist/src/rollback.js +33 -0
- package/dist/src/rollback.js.map +1 -0
- package/dist/src/routes.d.ts +7 -0
- package/dist/src/routes.d.ts.map +1 -0
- package/dist/src/routes.js +303 -0
- package/dist/src/routes.js.map +1 -0
- package/dist/src/rules-compiler.d.ts +20 -0
- package/dist/src/rules-compiler.d.ts.map +1 -0
- package/dist/src/rules-compiler.js +143 -0
- package/dist/src/rules-compiler.js.map +1 -0
- package/dist/src/server.d.ts +12 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +22 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tool-trace.d.ts +37 -0
- package/dist/src/tool-trace.d.ts.map +1 -0
- package/dist/src/tool-trace.js +142 -0
- package/dist/src/tool-trace.js.map +1 -0
- package/dist/src/types.d.ts +446 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +6 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/ulid.d.ts +3 -0
- package/dist/src/ulid.d.ts.map +1 -0
- package/dist/src/ulid.js +11 -0
- package/dist/src/ulid.js.map +1 -0
- package/dist/src/utils.d.ts +10 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +41 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/src/validate.d.ts +22 -0
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +109 -0
- package/dist/src/validate.js.map +1 -0
- package/docs/assets/audrey-feature-grid.jpg +0 -0
- package/docs/assets/audrey-logo.svg +45 -0
- package/docs/assets/audrey-wordmark.png +0 -0
- package/docs/audrey-for-dummies.md +670 -0
- package/docs/future-of-llm-memory.md +452 -0
- package/docs/mcp-hosts.md +206 -0
- package/docs/ollama-local-agents.md +128 -0
- package/docs/production-readiness.md +37 -5
- package/examples/fintech-ops-demo.js +1 -1
- package/examples/healthcare-ops-demo.js +1 -1
- package/examples/ollama-memory-agent.js +326 -0
- package/examples/stripe-demo.js +1 -1
- package/package.json +54 -14
- package/benchmarks/baselines.js +0 -169
- package/benchmarks/cases.js +0 -421
- package/benchmarks/reference-results.js +0 -70
- package/benchmarks/report.js +0 -255
- package/benchmarks/run.js +0 -514
- package/mcp-server/config.js +0 -133
- package/mcp-server/index.js +0 -1265
- package/mcp-server/serve.js +0 -482
- package/src/adaptive.js +0 -53
- package/src/affect.js +0 -64
- package/src/audrey.js +0 -642
- package/src/causal.js +0 -95
- package/src/confidence.js +0 -120
- package/src/consolidate.js +0 -281
- package/src/context.js +0 -15
- package/src/db.js +0 -391
- package/src/decay.js +0 -84
- package/src/embedding.js +0 -260
- package/src/encode.js +0 -69
- package/src/export.js +0 -67
- package/src/forget.js +0 -111
- package/src/fts.js +0 -134
- package/src/import.js +0 -273
- package/src/interference.js +0 -51
- package/src/introspect.js +0 -48
- package/src/llm.js +0 -249
- package/src/migrate.js +0 -58
- package/src/recall.js +0 -573
- package/src/rollback.js +0 -42
- package/src/ulid.js +0 -18
- package/src/utils.js +0 -63
- package/src/validate.js +0 -172
- package/types/index.d.ts +0 -434
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.21.0 - Release Diagnostics and Host Setup
|
|
4
|
+
|
|
5
|
+
- Added `npx audrey doctor` for first-contact diagnostics, JSON automation, provider checks, MCP entrypoint validation, memory-store health, and host config generation.
|
|
6
|
+
- Added `npx audrey install --host <host> --dry-run` so Codex, Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, JetBrains, and generic MCP hosts can preview setup without accidental config writes.
|
|
7
|
+
- Updated docs around the recommended first run: `doctor`, `demo`, safe host install preview, then host-specific verification.
|
|
8
|
+
- Kept Claude Code's direct installer intact while making the default release story host-neutral.
|
|
9
|
+
- Refreshed lockfile transitive packages through the npm resolver; vulnerability audit remains clean.
|
|
10
|
+
|
|
11
|
+
## 0.20.0 - Memory Reflexes
|
|
12
|
+
|
|
13
|
+
- Added Memory Preflight and Memory Reflexes so agents can check memory before acting and turn repeated failures into trigger-response guidance.
|
|
14
|
+
- Added Ollama/local-agent guidance and runnable local-agent example.
|
|
15
|
+
- Expanded host-neutral MCP docs and Audrey for Dummies onboarding.
|
package/README.md
CHANGED
|
@@ -1,474 +1,284 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="docs/assets/audrey-wordmark.png" alt="Audrey wordmark" width="760">
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/audrey)
|
|
5
|
-
[](LICENSE)
|
|
4
|
+
<p><strong>The local-first memory control plane for AI agents.</strong></p>
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
<p>
|
|
7
|
+
Give Codex, Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, JetBrains, Ollama-backed agents,
|
|
8
|
+
and custom agent services one durable memory layer they can check before they act.
|
|
9
|
+
</p>
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Audrey also works as a standalone SDK, MCP server, and REST API for any AI agent framework.
|
|
17
|
-
|
|
18
|
-
> **On `/dream`** — Anthropic recently shipped `/dream` for Claude Code memory maintenance. Audrey predates it and goes further: episodic-to-semantic consolidation, contradiction detection, confidence decay, emotional affect, causal reasoning, and source reliability weighting. `/dream` is a maintenance pass. Audrey is a cognitive memory architecture.
|
|
19
|
-
|
|
20
|
-
## Why Audrey
|
|
21
|
-
|
|
22
|
-
Most AI memory tools are storage wrappers. They save facts, retrieve facts, and keep everything forever. That leaves real production problems unsolved:
|
|
11
|
+
<p>
|
|
12
|
+
<a href="https://github.com/Evilander/Audrey/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Evilander/Audrey/actions/workflows/ci.yml/badge.svg?branch=master"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/audrey"><img alt="npm version" src="https://img.shields.io/npm/v/audrey.svg"></a>
|
|
14
|
+
<a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
- Raw events never become reusable operating knowledge.
|
|
26
|
-
- Conflicting facts quietly coexist.
|
|
27
|
-
- Model-generated mistakes can get reinforced into false "truth."
|
|
18
|
+
## Why Audrey Exists
|
|
28
19
|
|
|
29
|
-
|
|
20
|
+
Agents forget the exact mistakes they made yesterday. They repeat broken commands, lose project-specific rules, miss contradictions, and treat every new session like a cold start.
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|---|---|---|
|
|
33
|
-
| Hippocampus | Episodic Memory | Fast capture of raw events and observations |
|
|
34
|
-
| Neocortex | Semantic Memory | Consolidated principles and patterns |
|
|
35
|
-
| Cerebellum | Procedural Memory | Learned workflows and conditional behaviors |
|
|
36
|
-
| Sleep Replay | Dream Cycle | Consolidates episodes into principles and applies decay |
|
|
37
|
-
| Prefrontal Cortex | Validation Engine | Truth-checking and contradiction detection |
|
|
38
|
-
| Amygdala | Affect System | Emotional encoding, arousal-salience coupling, and mood-congruent recall |
|
|
39
|
-
|
|
40
|
-
## What You Get
|
|
41
|
-
|
|
42
|
-
- Local SQLite-backed memory with `sqlite-vec`
|
|
43
|
-
- MCP server for Claude Code with 13 memory tools
|
|
44
|
-
- **Claude Code hooks integration** — automatic memory in every session (`npx audrey hooks install`)
|
|
45
|
-
- JavaScript SDK for direct application use
|
|
46
|
-
- **Git-friendly versioning** via JSON snapshots (`npx audrey snapshot` / `restore`)
|
|
47
|
-
- **REST API server** - any language, any framework (`npx audrey serve`)
|
|
48
|
-
- Health checks via `npx audrey status --json`
|
|
49
|
-
- Benchmark harness with retrieval and lifecycle-operation tracks via `npm run bench:memory`
|
|
50
|
-
- Regression gate for benchmark quality via `npm run bench:memory:check`
|
|
51
|
-
- Optional local embeddings and optional hosted LLM providers
|
|
52
|
-
- Strongest production fit today in financial services ops and healthcare ops
|
|
53
|
-
|
|
54
|
-
## Install
|
|
55
|
-
|
|
56
|
-
### MCP Server for Claude Code
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
npx audrey install # Register 13 MCP memory tools
|
|
60
|
-
npx audrey hooks install # Wire automatic memory into session lifecycle
|
|
61
|
-
```
|
|
22
|
+
Audrey turns those hard-won lessons into a local memory runtime:
|
|
62
23
|
|
|
63
|
-
|
|
24
|
+
- `memory_recall` finds durable context by semantic similarity.
|
|
25
|
+
- `memory_preflight` checks prior failures, risks, rules, and relevant procedures before an action.
|
|
26
|
+
- `memory_reflexes` converts remembered evidence into trigger-response guidance agents can follow.
|
|
27
|
+
- `memory_dream` consolidates episodes into principles and applies decay.
|
|
28
|
+
- `audrey doctor` tells a human or CI system whether the runtime is actually ready.
|
|
64
29
|
|
|
65
|
-
|
|
66
|
-
- no embedding key -> local embeddings (384d, MiniLM, offline-capable)
|
|
67
|
-
- `AUDREY_EMBEDDING_PROVIDER=openai` -> explicit OpenAI embeddings (1536d)
|
|
68
|
-
- `ANTHROPIC_API_KEY` -> LLM-powered consolidation, contradiction detection, and reflection
|
|
30
|
+
It is not a hosted vector database, a notes app, or a Claude-only plugin. Audrey is a SQLite-backed continuity layer that can sit under any local or sidecar agent loop.
|
|
69
31
|
|
|
70
|
-
|
|
32
|
+
<div align="center">
|
|
33
|
+
<img src="docs/assets/audrey-feature-grid.jpg" alt="Audrey feature marks: memory continuity, archive signal, recall loop, layered evidence, local node, and remembering before acting" width="760">
|
|
34
|
+
</div>
|
|
71
35
|
|
|
72
|
-
|
|
73
|
-
npx audrey status
|
|
74
|
-
npx audrey status --json
|
|
75
|
-
npx audrey status --json --fail-on-unhealthy
|
|
76
|
-
```
|
|
36
|
+
## Quick Start
|
|
77
37
|
|
|
78
|
-
|
|
38
|
+
Requires Node.js 20+.
|
|
79
39
|
|
|
80
40
|
```bash
|
|
81
|
-
|
|
41
|
+
npx audrey doctor
|
|
42
|
+
npx audrey demo
|
|
82
43
|
```
|
|
83
44
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## Quick Start
|
|
87
|
-
|
|
88
|
-
```js
|
|
89
|
-
import { Audrey } from 'audrey';
|
|
90
|
-
|
|
91
|
-
const brain = new Audrey({
|
|
92
|
-
dataDir: './agent-memory',
|
|
93
|
-
agent: 'support-agent',
|
|
94
|
-
embedding: { provider: 'local', dimensions: 384 },
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
await brain.encode({
|
|
98
|
-
content: 'Stripe API returned 429 above 100 req/s',
|
|
99
|
-
source: 'direct-observation',
|
|
100
|
-
tags: ['stripe', 'rate-limit'],
|
|
101
|
-
context: { task: 'debugging', domain: 'payments' },
|
|
102
|
-
affect: { valence: -0.4, arousal: 0.7, label: 'frustration' },
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const memories = await brain.recall('stripe rate limits', {
|
|
106
|
-
limit: 5,
|
|
107
|
-
context: { task: 'debugging', domain: 'payments' },
|
|
108
|
-
});
|
|
45
|
+
`doctor` verifies Node, the MCP entrypoint, provider selection, memory-store health, and host config generation. `demo` runs a no-key, no-host, no-network proof: it creates temporary memories, records a redacted failed tool trace, generates a Memory Capsule, proves recall, prints Memory Reflexes, and deletes the demo store.
|
|
109
46
|
|
|
110
|
-
|
|
111
|
-
const briefing = await brain.greeting({ context: 'debugging stripe' });
|
|
47
|
+
Expected first-run shape:
|
|
112
48
|
|
|
113
|
-
|
|
114
|
-
|
|
49
|
+
```text
|
|
50
|
+
Audrey Doctor v0.21.0
|
|
51
|
+
Store health: not initialized
|
|
52
|
+
Verdict: ready
|
|
115
53
|
```
|
|
116
54
|
|
|
117
|
-
|
|
55
|
+
After the first real memory write, `doctor` should report the store as healthy.
|
|
118
56
|
|
|
119
|
-
|
|
57
|
+
## Install Into Agent Hosts
|
|
120
58
|
|
|
121
|
-
|
|
122
|
-
- `memory_recall`
|
|
123
|
-
- `memory_consolidate`
|
|
124
|
-
- `memory_dream`
|
|
125
|
-
- `memory_introspect`
|
|
126
|
-
- `memory_resolve_truth`
|
|
127
|
-
- `memory_export`
|
|
128
|
-
- `memory_import`
|
|
129
|
-
- `memory_forget`
|
|
130
|
-
- `memory_decay`
|
|
131
|
-
- `memory_status`
|
|
132
|
-
- `memory_reflect`
|
|
133
|
-
- `memory_greeting`
|
|
134
|
-
|
|
135
|
-
## CLI
|
|
59
|
+
Preview host setup without editing config files:
|
|
136
60
|
|
|
137
61
|
```bash
|
|
138
|
-
|
|
139
|
-
npx audrey install
|
|
140
|
-
npx audrey
|
|
141
|
-
npx audrey hooks install # Wire Audrey into Claude Code hooks (automatic memory)
|
|
142
|
-
npx audrey hooks uninstall # Remove Audrey hooks
|
|
143
|
-
|
|
144
|
-
# Health and monitoring
|
|
145
|
-
npx audrey status # Human-readable health report
|
|
146
|
-
npx audrey status --json # Machine-readable health output
|
|
147
|
-
npx audrey status --json --fail-on-unhealthy # CI gate
|
|
148
|
-
|
|
149
|
-
# Session lifecycle (used by hooks automatically)
|
|
150
|
-
npx audrey greeting # Load identity, principles, mood
|
|
151
|
-
npx audrey greeting "auth" # With context-aware recall
|
|
152
|
-
npx audrey recall "query" # Semantic memory search (returns hook-compatible JSON)
|
|
153
|
-
npx audrey reflect # Consolidate learnings from stdin conversation + dream
|
|
154
|
-
|
|
155
|
-
# Maintenance
|
|
156
|
-
npx audrey dream # Full consolidation + decay cycle
|
|
157
|
-
npx audrey reembed # Re-embed all memories after provider/dimension change
|
|
158
|
-
|
|
159
|
-
# Versioning
|
|
160
|
-
npx audrey snapshot # Export memories to timestamped JSON file
|
|
161
|
-
npx audrey snapshot backup.json # Export to specific file
|
|
162
|
-
npx audrey restore backup.json # Restore from snapshot (re-embeds with current provider)
|
|
163
|
-
npx audrey restore backup.json --force # Overwrite existing memories
|
|
164
|
-
|
|
165
|
-
# REST API server
|
|
166
|
-
npx audrey serve # Start HTTP server on port 3487
|
|
167
|
-
npx audrey serve 8080 # Custom port
|
|
62
|
+
npx audrey install --host codex --dry-run
|
|
63
|
+
npx audrey install --host claude-code --dry-run
|
|
64
|
+
npx audrey install --host generic --dry-run
|
|
168
65
|
```
|
|
169
66
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
Audrey integrates directly into Claude Code's hook lifecycle for automatic, zero-config memory in every session:
|
|
67
|
+
Generate raw config blocks:
|
|
173
68
|
|
|
174
69
|
```bash
|
|
175
|
-
npx audrey
|
|
70
|
+
npx audrey mcp-config codex
|
|
71
|
+
npx audrey mcp-config generic
|
|
72
|
+
npx audrey mcp-config vscode
|
|
176
73
|
```
|
|
177
74
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
| Hook Event | Command | What Happens |
|
|
181
|
-
|---|---|---|
|
|
182
|
-
| **SessionStart** | `npx audrey greeting` | Loads identity, learned principles, current mood, and recent memories |
|
|
183
|
-
| **UserPromptSubmit** | `npx audrey recall` | Semantic search on every prompt — injects relevant memories as context |
|
|
184
|
-
| **Stop** | `npx audrey reflect` | Extracts lasting learnings from the conversation, then runs a dream cycle |
|
|
185
|
-
| **PostCompact** | `npx audrey greeting` | Re-injects critical memories after context window compaction |
|
|
186
|
-
|
|
187
|
-
With hooks installed, Claude Code sessions automatically wake up with context, recall relevant memories per-prompt, and consolidate learnings when the session ends. No manual tool calls needed.
|
|
188
|
-
|
|
189
|
-
## REST API Server
|
|
190
|
-
|
|
191
|
-
Turn Audrey into an HTTP service that any language or framework can use:
|
|
75
|
+
Claude Code can be registered directly:
|
|
192
76
|
|
|
193
77
|
```bash
|
|
194
|
-
npx audrey
|
|
195
|
-
|
|
196
|
-
AUDREY_API_KEY=secret npx audrey serve # With Bearer token auth
|
|
78
|
+
npx audrey install
|
|
79
|
+
claude mcp list
|
|
197
80
|
```
|
|
198
81
|
|
|
199
|
-
|
|
82
|
+
All local MCP paths default to local embeddings and one shared SQLite-backed memory directory. Use `AUDREY_DATA_DIR` to isolate projects, tenants, or host identities.
|
|
200
83
|
|
|
201
|
-
|
|
202
|
-
|--------|------|-------------|
|
|
203
|
-
| `GET` | `/health` | Liveness probe |
|
|
204
|
-
| `GET` | `/status` | Memory stats (introspect) |
|
|
205
|
-
| `POST` | `/encode` | Store a memory (`{ content, source, tags?, context?, affect? }`) |
|
|
206
|
-
| `POST` | `/recall` | Semantic search (`{ query, limit?, context? }`) |
|
|
207
|
-
| `POST` | `/dream` | Full consolidation + decay cycle |
|
|
208
|
-
| `POST` | `/consolidate` | Run consolidation only |
|
|
209
|
-
| `POST` | `/forget` | Forget by `{ id }` or `{ query }` |
|
|
210
|
-
| `POST` | `/snapshot` | Export all memories as JSON |
|
|
211
|
-
| `POST` | `/restore` | Wipe and reimport from snapshot |
|
|
84
|
+
## Use With Ollama And Local Agents
|
|
212
85
|
|
|
213
|
-
|
|
86
|
+
Ollama runs models; Audrey supplies memory. Start Audrey as a local REST sidecar and expose its routes as tools in your agent loop:
|
|
214
87
|
|
|
215
88
|
```bash
|
|
216
|
-
|
|
217
|
-
curl
|
|
218
|
-
|
|
219
|
-
-d '{"content": "The deploy failed due to OOM", "source": "direct-observation"}'
|
|
220
|
-
|
|
221
|
-
# Search memories
|
|
222
|
-
curl -X POST http://localhost:3487/recall \
|
|
223
|
-
-H "Content-Type: application/json" \
|
|
224
|
-
-d '{"query": "deploy failures", "limit": 5}'
|
|
89
|
+
AUDREY_AGENT=ollama-local-agent npx audrey serve
|
|
90
|
+
curl http://localhost:7437/health
|
|
91
|
+
curl http://localhost:7437/v1/status
|
|
225
92
|
```
|
|
226
93
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
Audrey stores memories in SQLite with WAL mode, which isn't git-friendly. Instead, use JSON snapshots:
|
|
94
|
+
Runnable example:
|
|
230
95
|
|
|
231
96
|
```bash
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
# Commit it
|
|
236
|
-
git add audrey-snapshot-*.json && git commit -m "memory checkpoint"
|
|
237
|
-
|
|
238
|
-
# Restore on another machine or after a reset
|
|
239
|
-
npx audrey restore audrey-snapshot-2026-03-24_15-30-00.json
|
|
97
|
+
AUDREY_AGENT=ollama-local-agent npx audrey serve
|
|
98
|
+
OLLAMA_MODEL=qwen3 node examples/ollama-memory-agent.js "What should you remember about Audrey?"
|
|
240
99
|
```
|
|
241
100
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
## Production Fit
|
|
245
|
-
|
|
246
|
-
Audrey is strongest today in workflows where memory must stay local, reviewable, and durable:
|
|
247
|
-
|
|
248
|
-
- **Financial services operations**: payments ops, fraud and dispute workflows, KYC/KYB review, internal policy assistants
|
|
249
|
-
- **Healthcare operations**: care coordination, prior-auth workflows, intake and referral routing, internal staff knowledge assistants
|
|
250
|
-
|
|
251
|
-
Audrey is a memory layer, not a compliance boundary. For regulated environments, pair it with application-level access control, encryption, retention, audit logging, and data-minimization rules.
|
|
252
|
-
|
|
253
|
-
Production guide: [docs/production-readiness.md](docs/production-readiness.md)
|
|
254
|
-
|
|
255
|
-
Industry demos:
|
|
256
|
-
|
|
257
|
-
- [examples/fintech-ops-demo.js](examples/fintech-ops-demo.js)
|
|
258
|
-
- [examples/healthcare-ops-demo.js](examples/healthcare-ops-demo.js)
|
|
101
|
+
Core sidecar tools:
|
|
259
102
|
|
|
260
|
-
|
|
103
|
+
| Agent Need | REST Route |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Check memory before acting | `POST /v1/preflight` |
|
|
106
|
+
| Get reflex rules for an action | `POST /v1/reflexes` |
|
|
107
|
+
| Store a useful observation | `POST /v1/encode` |
|
|
108
|
+
| Recall relevant context | `POST /v1/recall` |
|
|
109
|
+
| Get a turn-sized memory packet | `POST /v1/capsule` |
|
|
110
|
+
| Check health | `GET /v1/status` |
|
|
261
111
|
|
|
262
|
-
|
|
112
|
+
## What Ships
|
|
263
113
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
-
|
|
114
|
+
| Surface | Status |
|
|
115
|
+
|---|---|
|
|
116
|
+
| MCP stdio server | 19 tools, resources, and prompt templates |
|
|
117
|
+
| CLI | `doctor`, `demo`, `install`, `mcp-config`, `status`, `dream`, `reembed`, `observe-tool`, `promote` |
|
|
118
|
+
| REST API | Hono server with `/health`, `/openapi.json`, `/docs`, and `/v1/*` routes |
|
|
119
|
+
| JavaScript SDK | Direct TypeScript/Node import from `audrey` |
|
|
120
|
+
| Python client | `pip install audrey-memory`, calls the REST sidecar |
|
|
121
|
+
| Storage | Local SQLite plus `sqlite-vec`, no hosted database required |
|
|
122
|
+
| Deployment | npm package, Docker, Compose, host-specific MCP config generation |
|
|
123
|
+
| Safety loop | preflight warnings, reflexes, redacted tool traces, contradiction handling |
|
|
268
124
|
|
|
269
|
-
|
|
125
|
+
## Memory Model
|
|
270
126
|
|
|
271
|
-
Audrey
|
|
127
|
+
Audrey is built around the parts of memory that matter for agents:
|
|
272
128
|
|
|
273
|
-
|
|
129
|
+
- Episodic memory: specific observations, tool results, preferences, and session facts.
|
|
130
|
+
- Semantic memory: consolidated principles extracted from repeated evidence.
|
|
131
|
+
- Procedural memory: remembered ways to act, avoid, retry, or verify.
|
|
132
|
+
- Affect and salience: emotional weight and importance influence recall.
|
|
133
|
+
- Interference and decay: stale, conflicting, or low-confidence memories lose authority over time.
|
|
134
|
+
- Contradiction handling: competing claims are tracked instead of silently overwritten.
|
|
135
|
+
- Tool-trace learning: failed commands and risky actions become future preflight warnings.
|
|
274
136
|
|
|
275
|
-
|
|
137
|
+
The product bet is simple: the next generation of useful agents will not just retrieve facts. They will remember what happened, decide whether a memory is still trustworthy, and use that memory before touching tools.
|
|
276
138
|
|
|
277
|
-
|
|
278
|
-
2. Apply decay so low-value memories lose weight over time.
|
|
279
|
-
3. Report memory health and current stats.
|
|
139
|
+
## Use Audrey From Code
|
|
280
140
|
|
|
281
|
-
###
|
|
282
|
-
|
|
283
|
-
When evidence conflicts, Audrey tracks the contradiction instead of silently picking a winner. Resolutions can stay open, be marked resolved, or become context-dependent.
|
|
284
|
-
|
|
285
|
-
## Configuration
|
|
141
|
+
### JavaScript
|
|
286
142
|
|
|
287
143
|
```js
|
|
144
|
+
import { Audrey } from 'audrey';
|
|
145
|
+
|
|
288
146
|
const brain = new Audrey({
|
|
289
147
|
dataDir: './audrey-data',
|
|
290
|
-
agent: '
|
|
291
|
-
embedding: {
|
|
292
|
-
provider: 'local', // mock | local | gemini | openai
|
|
293
|
-
dimensions: 384,
|
|
294
|
-
device: 'gpu',
|
|
295
|
-
},
|
|
296
|
-
llm: {
|
|
297
|
-
provider: 'anthropic', // mock | anthropic | openai
|
|
298
|
-
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
299
|
-
},
|
|
300
|
-
consolidation: {
|
|
301
|
-
minEpisodes: 3,
|
|
302
|
-
},
|
|
303
|
-
context: {
|
|
304
|
-
enabled: true,
|
|
305
|
-
weight: 0.3,
|
|
306
|
-
},
|
|
307
|
-
affect: {
|
|
308
|
-
enabled: true,
|
|
309
|
-
weight: 0.2,
|
|
310
|
-
},
|
|
311
|
-
decay: {
|
|
312
|
-
dormantThreshold: 0.1,
|
|
313
|
-
},
|
|
148
|
+
agent: 'support-agent',
|
|
149
|
+
embedding: { provider: 'local', dimensions: 384 },
|
|
314
150
|
});
|
|
315
|
-
```
|
|
316
151
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
# Health checks
|
|
323
|
-
npx audrey status
|
|
324
|
-
npx audrey status --json --fail-on-unhealthy
|
|
325
|
-
|
|
326
|
-
# Scheduled maintenance
|
|
327
|
-
npx audrey dream
|
|
328
|
-
|
|
329
|
-
# Repair vector/index drift after provider or dimension changes
|
|
330
|
-
npx audrey reembed
|
|
152
|
+
await brain.encode({
|
|
153
|
+
content: 'Stripe returns HTTP 429 above 100 req/s',
|
|
154
|
+
source: 'direct-observation',
|
|
155
|
+
tags: ['stripe', 'rate-limit'],
|
|
156
|
+
});
|
|
331
157
|
|
|
332
|
-
|
|
333
|
-
npx audrey snapshot
|
|
334
|
-
npx audrey restore <file> --force
|
|
158
|
+
const memories = await brain.recall('stripe rate limit');
|
|
335
159
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
# Fail CI if Audrey drops below benchmark guardrails
|
|
340
|
-
npm run bench:memory:check
|
|
160
|
+
await brain.waitForIdle();
|
|
161
|
+
brain.close();
|
|
341
162
|
```
|
|
342
163
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
Audrey now ships with a memory benchmark harness built for three purposes:
|
|
346
|
-
|
|
347
|
-
- measure Audrey against naive local baselines on LongMemEval-style memory abilities plus privacy and abstention checks
|
|
348
|
-
- measure Audrey on lifecycle operations that other memory systems usually hand-wave: update, overwrite, delete, merge, and abstain
|
|
349
|
-
- keep Audrey grounded against published LoCoMo results from leading memory systems
|
|
350
|
-
|
|
351
|
-
Run it with:
|
|
164
|
+
### Python
|
|
352
165
|
|
|
353
166
|
```bash
|
|
354
|
-
|
|
167
|
+
pip install audrey-memory
|
|
355
168
|
```
|
|
356
169
|
|
|
357
|
-
|
|
170
|
+
```python
|
|
171
|
+
from audrey_memory import Audrey
|
|
358
172
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
173
|
+
brain = Audrey(base_url="http://127.0.0.1:7437", agent="support-agent")
|
|
174
|
+
memory_id = brain.encode("Stripe returns HTTP 429 above 100 req/s", source="direct-observation")
|
|
175
|
+
results = brain.recall("stripe rate limit", limit=5)
|
|
176
|
+
brain.close()
|
|
363
177
|
```
|
|
364
178
|
|
|
365
|
-
|
|
179
|
+
## Production Readiness
|
|
180
|
+
|
|
181
|
+
Audrey is close to a 1.0-ready local memory runtime, but production depends on how it is embedded. Treat it like stateful infrastructure.
|
|
366
182
|
|
|
367
|
-
|
|
183
|
+
Release gates used for this package:
|
|
368
184
|
|
|
369
185
|
```bash
|
|
370
|
-
npm run
|
|
371
|
-
npm run
|
|
186
|
+
npm run build
|
|
187
|
+
npm run typecheck
|
|
188
|
+
npm run bench:memory:check
|
|
189
|
+
npm pack --dry-run
|
|
190
|
+
npx audrey doctor
|
|
191
|
+
npx audrey demo
|
|
372
192
|
```
|
|
373
193
|
|
|
374
|
-
|
|
194
|
+
Recommended runtime checks:
|
|
375
195
|
|
|
376
196
|
```bash
|
|
377
|
-
|
|
197
|
+
npx audrey doctor --json
|
|
198
|
+
npx audrey status --json --fail-on-unhealthy
|
|
199
|
+
npx audrey install --host codex --dry-run
|
|
378
200
|
```
|
|
379
201
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
Local Audrey-vs-baseline results:
|
|
383
|
-
|
|
384
|
-

|
|
385
|
-
|
|
386
|
-
Lifecycle operations benchmark:
|
|
202
|
+
Production controls you still own:
|
|
387
203
|
|
|
388
|
-
|
|
204
|
+
- Set one `AUDREY_DATA_DIR` per tenant, environment, or isolation boundary.
|
|
205
|
+
- Pin `AUDREY_EMBEDDING_PROVIDER` and `AUDREY_LLM_PROVIDER` explicitly.
|
|
206
|
+
- Back up the SQLite data directory before provider or dimension changes.
|
|
207
|
+
- Keep API keys and raw credentials out of encoded memory content.
|
|
208
|
+
- Use `AUDREY_API_KEY` if the REST sidecar is reachable beyond the local process boundary.
|
|
209
|
+
- Run `npx audrey dream` on a schedule so consolidation and decay stay current.
|
|
210
|
+
- Add application-level encryption, retention, access control, and audit logging for regulated environments.
|
|
389
211
|
|
|
390
|
-
|
|
212
|
+
Read the full guide: [docs/production-readiness.md](docs/production-readiness.md).
|
|
391
213
|
|
|
392
|
-
|
|
214
|
+
## Benchmarks
|
|
393
215
|
|
|
394
|
-
|
|
216
|
+
Audrey ships with a benchmark harness and release gate:
|
|
395
217
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
| Memory operations | **100.0%** | 25.0% |
|
|
401
|
-
|
|
402
|
-
Retrieval-family breakdown:
|
|
403
|
-
|
|
404
|
-
| Category | Audrey | Vector Only | Best Baseline |
|
|
405
|
-
|---|---|---|---|
|
|
406
|
-
| Information Extraction | 100% | 100% | 100% |
|
|
407
|
-
| Knowledge Updates | 100% | 50% | 50% |
|
|
408
|
-
| Multi-Session Reasoning | 100% | 100% | 100% |
|
|
409
|
-
| Temporal Reasoning | 100% | 100% | 100% |
|
|
410
|
-
| Abstention | 100% | 50% | 50% |
|
|
411
|
-
| Conflict Resolution | 100% | 50% | 50% |
|
|
412
|
-
| Procedural Learning | 100% | 0% | 0% |
|
|
413
|
-
| Privacy | 100% | 0% | 0% |
|
|
218
|
+
```bash
|
|
219
|
+
npm run bench:memory
|
|
220
|
+
npm run bench:memory:check
|
|
221
|
+
```
|
|
414
222
|
|
|
415
|
-
|
|
223
|
+
Current repo snapshot:
|
|
416
224
|
|
|
417
|
-
|
|
418
|
-
|---|---|---|---|
|
|
419
|
-
| Update / Overwrite | 100% | 50% | 50% |
|
|
420
|
-
| Delete + Abstain | 100% | 0% | 50% |
|
|
421
|
-
| Semantic Merge | 100% | 0% | 0% |
|
|
422
|
-
| Procedural Merge | 100% | 0% | 0% |
|
|
225
|
+

|
|
423
226
|
|
|
424
|
-
|
|
227
|
+
The benchmark suite covers retrieval behavior, overwrite behavior, delete/abstain behavior, and semantic/procedural merge behavior. For methodology and comparison anchors, see [docs/benchmarking.md](docs/benchmarking.md).
|
|
425
228
|
|
|
426
|
-
|
|
427
|
-
|---|---|---|---|
|
|
428
|
-
| **Audrey** | Internal retrieval + operations benchmark | **100.0%** | Update, overwrite, delete, merge, abstention, consolidation, privacy |
|
|
429
|
-
| MIRIX | Published LoCoMo | 85.4% | Typed multimodal memory |
|
|
430
|
-
| Letta Filesystem | Published LoCoMo | 74.0% | Context-engineering |
|
|
431
|
-
| Mem0 Graph Memory | Published LoCoMo | 68.5% | Graph memory |
|
|
432
|
-
| Mem0 | Published LoCoMo | 66.9% | Production baseline |
|
|
229
|
+
## Command Reference
|
|
433
230
|
|
|
434
|
-
|
|
231
|
+
```bash
|
|
232
|
+
# First contact
|
|
233
|
+
npx audrey doctor
|
|
234
|
+
npx audrey demo
|
|
235
|
+
|
|
236
|
+
# MCP setup
|
|
237
|
+
npx audrey install --host codex --dry-run
|
|
238
|
+
npx audrey mcp-config codex
|
|
239
|
+
npx audrey mcp-config generic
|
|
240
|
+
npx audrey install
|
|
241
|
+
npx audrey uninstall
|
|
242
|
+
|
|
243
|
+
# Health and maintenance
|
|
244
|
+
npx audrey status
|
|
245
|
+
npx audrey status --json --fail-on-unhealthy
|
|
246
|
+
npx audrey dream
|
|
247
|
+
npx audrey reembed
|
|
435
248
|
|
|
436
|
-
-
|
|
437
|
-
-
|
|
438
|
-
|
|
439
|
-
- [LongMemEval paper](https://arxiv.org/abs/2410.10813)
|
|
249
|
+
# Tool-trace learning
|
|
250
|
+
npx audrey observe-tool --event PostToolUse --tool Bash --outcome failed
|
|
251
|
+
npx audrey promote --dry-run
|
|
440
252
|
|
|
441
|
-
|
|
253
|
+
# REST sidecar
|
|
254
|
+
npx audrey serve
|
|
255
|
+
docker compose up -d --build
|
|
256
|
+
```
|
|
442
257
|
|
|
443
|
-
##
|
|
258
|
+
## Documentation
|
|
444
259
|
|
|
445
|
-
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
448
|
-
-
|
|
260
|
+
- [Audrey for Dummies](docs/audrey-for-dummies.md)
|
|
261
|
+
- [MCP host guide](docs/mcp-hosts.md)
|
|
262
|
+
- [Ollama and local agents](docs/ollama-local-agents.md)
|
|
263
|
+
- [Production readiness](docs/production-readiness.md)
|
|
264
|
+
- [Future of LLM memory](docs/future-of-llm-memory.md)
|
|
265
|
+
- [Benchmarking](docs/benchmarking.md)
|
|
266
|
+
- [Security policy](SECURITY.md)
|
|
449
267
|
|
|
450
268
|
## Development
|
|
451
269
|
|
|
452
270
|
```bash
|
|
453
271
|
npm ci
|
|
272
|
+
npm run build
|
|
273
|
+
npm run typecheck
|
|
454
274
|
npm test
|
|
455
|
-
npm run pack:check
|
|
456
|
-
npm run bench:memory
|
|
457
|
-
npm run bench:memory:retrieval
|
|
458
|
-
npm run bench:memory:operations
|
|
459
275
|
npm run bench:memory:check
|
|
460
|
-
npm run
|
|
276
|
+
npm run pack:check
|
|
277
|
+
python -m unittest discover -s python/tests -v
|
|
278
|
+
python -m build --no-isolation python
|
|
461
279
|
```
|
|
462
280
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
- `npm test`
|
|
466
|
-
- `npm run pack:check`
|
|
467
|
-
- `npm run bench:memory`
|
|
468
|
-
- `npm run bench:memory:retrieval`
|
|
469
|
-
- `npm run bench:memory:operations`
|
|
470
|
-
- `npm run bench:memory:check`
|
|
471
|
-
- `npm run bench:memory:readme-assets`
|
|
281
|
+
On some locked-down Windows hosts, Vitest/Vite can fail before tests start with `spawn EPERM`. That is an environment process-spawn blocker, not an Audrey runtime failure. Use build, typecheck, benchmark, pack dry-run, direct `dist/` smokes, and GitHub Actions as the release evidence path.
|
|
472
282
|
|
|
473
283
|
## License
|
|
474
284
|
|