mengram-ai 2.5.0 → 2.5.2
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 +41 -28
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mengram-ai
|
|
2
2
|
|
|
3
|
-
JavaScript / TypeScript SDK for [Mengram](https://mengram.io) —
|
|
3
|
+
JavaScript / TypeScript SDK for [Mengram](https://mengram.io) — Human-like memory for AI with 3 memory types: semantic, episodic, and procedural.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -13,60 +13,73 @@ npm install mengram-ai
|
|
|
13
13
|
```javascript
|
|
14
14
|
const { MengramClient } = require('mengram-ai');
|
|
15
15
|
|
|
16
|
-
const m = new MengramClient('
|
|
16
|
+
const m = new MengramClient('om-your-api-key');
|
|
17
17
|
|
|
18
|
-
// Add memories
|
|
18
|
+
// Add memories — auto-extracts facts, events, workflows
|
|
19
19
|
await m.add([
|
|
20
|
-
{ role: 'user', content: '
|
|
21
|
-
{ role: 'assistant', content: 'Noted your preferences!' }
|
|
20
|
+
{ role: 'user', content: 'Fixed the auth bug. My process: check logs, reproduce locally, fix and deploy.' },
|
|
22
21
|
], { userId: 'ali' });
|
|
23
22
|
|
|
24
|
-
//
|
|
25
|
-
const results = await m.search('
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
// Semantic search (classic)
|
|
24
|
+
const results = await m.search('auth issues', { userId: 'ali' });
|
|
25
|
+
|
|
26
|
+
// Episodic — what happened?
|
|
27
|
+
const events = await m.episodes({ query: 'auth bug' });
|
|
28
|
+
// → [{summary: "Fixed auth bug", outcome: "Resolved", participants: [...]}]
|
|
29
|
+
|
|
30
|
+
// Procedural — how to do it?
|
|
31
|
+
const procs = await m.procedures({ query: 'debug' });
|
|
32
|
+
// → [{name: "Debug process", steps: [...], success_count: 3}]
|
|
33
|
+
|
|
34
|
+
// Unified search — all 3 types at once
|
|
35
|
+
const all = await m.searchAll('deployment issues');
|
|
36
|
+
// → { semantic: [...], episodic: [...], procedural: [...] }
|
|
37
|
+
|
|
38
|
+
// Procedure feedback — AI learns what works
|
|
39
|
+
await m.procedureFeedback(procId, { success: true });
|
|
40
|
+
|
|
41
|
+
// Cognitive Profile — instant personalization
|
|
42
|
+
const profile = await m.getProfile('ali');
|
|
43
|
+
// → { system_prompt: "You are talking to Ali, a developer..." }
|
|
35
44
|
```
|
|
36
45
|
|
|
37
46
|
## TypeScript
|
|
38
47
|
|
|
39
48
|
```typescript
|
|
40
|
-
import { MengramClient, SearchResult } from 'mengram-ai';
|
|
49
|
+
import { MengramClient, SearchResult, Episode, Procedure, UnifiedSearchResult } from 'mengram-ai';
|
|
50
|
+
|
|
51
|
+
const m = new MengramClient('om-...');
|
|
41
52
|
|
|
42
|
-
const m = new MengramClient('mg-...');
|
|
43
53
|
const results: SearchResult[] = await m.search('preferences');
|
|
54
|
+
const events: Episode[] = await m.episodes({ query: 'deployment' });
|
|
55
|
+
const procs: Procedure[] = await m.procedures({ query: 'release' });
|
|
56
|
+
const all: UnifiedSearchResult = await m.searchAll('issues');
|
|
44
57
|
```
|
|
45
58
|
|
|
46
59
|
## API
|
|
47
60
|
|
|
48
61
|
| Method | Description |
|
|
49
62
|
|--------|-------------|
|
|
50
|
-
| `add(messages, options?)` | Add memories
|
|
63
|
+
| `add(messages, options?)` | Add memories (extracts all 3 types) |
|
|
51
64
|
| `addText(text, options?)` | Add memories from plain text |
|
|
52
65
|
| `search(query, options?)` | Semantic search |
|
|
66
|
+
| `searchAll(query, options?)` | **Unified search (all 3 types)** |
|
|
67
|
+
| `episodes(options?)` | **Search/list episodic memories** |
|
|
68
|
+
| `procedures(options?)` | **Search/list procedural memories** |
|
|
69
|
+
| `procedureFeedback(id, options?)` | **Record success/failure** |
|
|
70
|
+
| `getProfile(userId?, options?)` | **Cognitive Profile** |
|
|
53
71
|
| `getAll(options?)` | List all memories |
|
|
54
72
|
| `get(name)` | Get specific entity |
|
|
55
73
|
| `delete(name)` | Delete entity |
|
|
56
|
-
| `stats()` | Usage statistics |
|
|
57
|
-
| `graph()` | Knowledge graph |
|
|
58
74
|
| `runAgents(options?)` | Run memory agents |
|
|
59
|
-
| `insights()` | AI
|
|
75
|
+
| `insights()` | AI reflections |
|
|
60
76
|
| `createTeam(name)` | Create shared team |
|
|
61
|
-
| `joinTeam(code)` | Join team
|
|
62
|
-
| `shareMemory(entity, teamId)` | Share
|
|
63
|
-
| `listKeys()` | List API keys |
|
|
64
|
-
| `createKey(name?)` | Create new API key |
|
|
65
|
-
|
|
66
|
-
All methods support `userId`, `agentId`, `runId`, `appId` options for multi-agent systems.
|
|
77
|
+
| `joinTeam(code)` | Join team |
|
|
78
|
+
| `shareMemory(entity, teamId)` | Share with team |
|
|
67
79
|
|
|
68
80
|
## Links
|
|
69
81
|
|
|
82
|
+
- [Website](https://mengram.io)
|
|
70
83
|
- [Documentation](https://mengram.io/docs)
|
|
71
84
|
- [Python SDK](https://pypi.org/project/mengram-ai/)
|
|
72
85
|
- [GitHub](https://github.com/alibaizhanov/mengram)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mengram-ai",
|
|
3
|
-
"version": "2.5.
|
|
4
|
-
"description": "AI
|
|
3
|
+
"version": "2.5.2",
|
|
4
|
+
"description": "Human-like memory for AI — semantic, episodic & procedural memory. Cognitive Profile, unified search, memory agents. Free Mem0 alternative.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|