mentedb 0.39.2 → 0.41.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/README.md
CHANGED
|
@@ -5,8 +5,8 @@ The mind database for AI agents. TypeScript/Node.js SDK powered by napi-rs.
|
|
|
5
5
|
MenteDB is a purpose built database engine for AI agent memory. It provides
|
|
6
6
|
vector similarity search, a typed knowledge graph, token budget aware context
|
|
7
7
|
assembly, and cognitive features such as contradiction detection and trajectory
|
|
8
|
-
tracking. This package delivers the
|
|
9
|
-
|
|
8
|
+
tracking. This package delivers the Rust engine as a native Node.js addon with
|
|
9
|
+
no runtime npm dependencies.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -14,9 +14,10 @@ with zero runtime dependencies.
|
|
|
14
14
|
npm install mentedb
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The package ships
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
The package ships prebuilt native binaries for macOS (arm64, x64), Linux
|
|
18
|
+
(x64, arm64, glibc) and Windows (x64). On any other platform, clone the
|
|
19
|
+
repository and build the addon from `sdks/typescript` (see "Building from
|
|
20
|
+
source"; requires Rust and [napi-rs](https://napi.rs)).
|
|
20
21
|
|
|
21
22
|
## Quick start
|
|
22
23
|
|
|
@@ -25,8 +26,8 @@ import { MenteDB, MemoryType, EdgeType } from 'mentedb';
|
|
|
25
26
|
|
|
26
27
|
const db = new MenteDB('./my-agent-memory');
|
|
27
28
|
|
|
28
|
-
// Primary API — one call does everything
|
|
29
|
-
const result =
|
|
29
|
+
// Primary API — one call does everything (synchronous)
|
|
30
|
+
const result = db.processTurn(
|
|
30
31
|
"I prefer using TypeScript for backend services",
|
|
31
32
|
"Noted! TypeScript is great for type-safe backends.",
|
|
32
33
|
0 // turn_id
|
|
@@ -35,9 +36,7 @@ const result = await db.processTurn(
|
|
|
35
36
|
);
|
|
36
37
|
|
|
37
38
|
console.log(result.context); // relevant memories
|
|
38
|
-
console.log(result.
|
|
39
|
-
// Enrichment runs automatically — builds semantic facts,
|
|
40
|
-
// entity graphs, and user profile over time
|
|
39
|
+
console.log(result.storedIds); // ids of the memories stored this turn
|
|
41
40
|
|
|
42
41
|
// Low-level APIs:
|
|
43
42
|
|
|
@@ -69,8 +68,9 @@ db.close();
|
|
|
69
68
|
|
|
70
69
|
### CognitionStream
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
stored facts
|
|
71
|
+
Buffer an LLM token stream. The Node.js binding exposes only feeding and
|
|
72
|
+
draining the buffer; the alert checks against stored facts are available in
|
|
73
|
+
the Python SDK.
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
76
|
import { CognitionStream } from 'mentedb';
|
|
@@ -101,11 +101,13 @@ const resume = tracker.getResumeContext();
|
|
|
101
101
|
const next = tracker.predictNextTopics();
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
##
|
|
104
|
+
## LLM features
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
`processTurn` stores and recalls without an LLM. Sleeptime
|
|
107
|
+
enrichment (LLM fact extraction, entity linking, community summaries, user
|
|
108
|
+
profile) is not exposed by the Node.js package; use the Python SDK or the
|
|
109
|
+
server for it. `ingest` calls an LLM and needs `MENTEDB_LLM_PROVIDER`
|
|
110
|
+
(`openai`, `anthropic` or `ollama`) and `MENTEDB_LLM_API_KEY`.
|
|
109
111
|
|
|
110
112
|
## API reference
|
|
111
113
|
|
|
@@ -118,7 +120,7 @@ Requires an LLM provider: set `MENTEDB_OPENAI_API_KEY` or `MENTEDB_ANTHROPIC_API
|
|
|
118
120
|
| `recall(query)` | Recall memories via an MQL query. Returns `RecallResult`. |
|
|
119
121
|
| `search(embedding, k)` | Vector similarity search. Returns `SearchResult[]`. |
|
|
120
122
|
| `relate(source, target, edgeType?, weight?)` | Create a typed edge between two memories. |
|
|
121
|
-
| `processTurn(userMessage, assistantResponse?, turnId?, projectContext?, agentId?)` | **Primary API.** Process a conversation turn through the full cognitive pipeline. Returns context, actions, sentiment, predictions, and more. |
|
|
123
|
+
| `processTurn(userMessage, assistantResponse?, turnId?, projectContext?, agentId?, sessionId?)` | **Primary API.** Process a conversation turn through the full cognitive pipeline. Returns `ProcessTurnResult` (context, stored ids, actions, sentiment, predictions, and more). |
|
|
122
124
|
| `forget(memoryId)` | Remove a memory by ID. |
|
|
123
125
|
| `ingest(conversation, provider?, agentId?)` | **Deprecated** — use `processTurn` instead. Extract and store memories from a conversation via LLM. |
|
|
124
126
|
| `close()` | Flush and close the database. |
|
|
@@ -175,9 +177,10 @@ interface SearchResult {
|
|
|
175
177
|
|
|
176
178
|
```bash
|
|
177
179
|
cd sdks/typescript
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
npm
|
|
180
|
+
npm install -g @napi-rs/cli # the napi CLI is not a devDependency
|
|
181
|
+
cargo check # verify Rust compiles
|
|
182
|
+
npm run build # build the native addon (napi build --release)
|
|
183
|
+
npx tsc # compile the npm/ wrapper
|
|
181
184
|
```
|
|
182
185
|
|
|
183
186
|
## License
|
|
Binary file
|
package/mentedb.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|