adaptive-context-memory 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,43 +1,36 @@
|
|
|
1
|
-
# context-memory
|
|
1
|
+
# adaptive-context-memory
|
|
2
2
|
|
|
3
3
|
High-performance, standalone, zero-binary long-term adaptive memory system for AI agents and LLM applications in TypeScript & Node.js.
|
|
4
4
|
|
|
5
|
-
Ported and optimized from the Python `contextmemory` package.
|
|
6
|
-
|
|
7
5
|
---
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## Features
|
|
10
8
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
9
|
+
- **Zero Binary Vector Search:** Flat cosine similarity search in pure TypeScript. No C++ compilation or heavy FAISS binaries needed.
|
|
10
|
+
- **High Performance Local Database:** Fast SQLite persistence via `better-sqlite3`.
|
|
11
|
+
- **Dual Memory Engine:** Automatically classifies information into:
|
|
12
|
+
- **Semantic Facts:** Long-term durable user knowledge (profile, skills, preferences).
|
|
13
|
+
- **Episodic Bubbles:** Time-sensitive events, tasks, and deadlines with importance scoring.
|
|
14
|
+
- **Smart Contradiction Resolution:** LLM agent dynamically decides whether to `ADD`, `UPDATE`, `REPLACE`, `DELETE`, or `NOOP` incoming facts.
|
|
15
|
+
- **MMR (Maximum Marginal Relevance) Search:** Re-ranks query results for optimal relevance and diversity.
|
|
16
|
+
- **Batch & Cached Embeddings:** Built-in LRU cache and single-call batch embedding to minimize API latency and cost.
|
|
17
|
+
- **Resilient Auto-Retry:** Exponential backoff retry wrapper handles rate limits (429) and transient errors automatically.
|
|
18
|
+
- **Multi-Provider Support:** Plug-and-play support for **OpenAI** and **OpenRouter**.
|
|
21
19
|
|
|
22
20
|
---
|
|
23
21
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install context-memory-ts
|
|
28
|
-
```
|
|
22
|
+
## Installation
|
|
29
23
|
|
|
30
|
-
*Or install from local tarball bundle:*
|
|
31
24
|
```bash
|
|
32
|
-
npm install
|
|
25
|
+
npm install adaptive-context-memory
|
|
33
26
|
```
|
|
34
27
|
|
|
35
28
|
---
|
|
36
29
|
|
|
37
|
-
##
|
|
30
|
+
## Quick Start
|
|
38
31
|
|
|
39
32
|
```typescript
|
|
40
|
-
import { configure, createTables, getDb, ContextMemory } from 'context-memory
|
|
33
|
+
import { configure, createTables, getDb, ContextMemory } from 'adaptive-context-memory';
|
|
41
34
|
|
|
42
35
|
// 1. Configure provider and model
|
|
43
36
|
configure({
|
|
@@ -68,7 +61,7 @@ console.log(searchResult.results);
|
|
|
68
61
|
|
|
69
62
|
---
|
|
70
63
|
|
|
71
|
-
##
|
|
64
|
+
## API Reference
|
|
72
65
|
|
|
73
66
|
### `configure(options: ContextMemoryConfig)`
|
|
74
67
|
Configures the global LLM provider, API keys, and embedding models.
|
|
@@ -99,6 +92,6 @@ Soft-deletes episodic bubbles older than $N$ days (default 30 days).
|
|
|
99
92
|
|
|
100
93
|
---
|
|
101
94
|
|
|
102
|
-
##
|
|
95
|
+
## License
|
|
103
96
|
|
|
104
97
|
MIT
|
package/package.json
CHANGED