mnemosyne-core 2.1.1 → 2.1.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/README.md +2 -2
- package/WORKING_EXAMPLE.md +126 -0
- package/dist/cli/index.js +11 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +11 -9
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/index.mjs +1 -1
- package/dist/mcp/index.mjs.map +1 -1
- package/dist/sdk/index.d.mts +4 -0
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +4 -0
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/index.mjs +4 -0
- package/dist/sdk/index.mjs.map +1 -1
- package/dist/server/api.js +3 -3
- package/dist/server/api.js.map +1 -1
- package/dist/server/api.mjs +3 -3
- package/dist/server/api.mjs.map +1 -1
- package/dist/server/index.js +4 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +4 -4
- package/dist/server/index.mjs.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -112,10 +112,10 @@ import { MnemosyneClient } from 'mnemosyne-core/sdk';
|
|
|
112
112
|
const client = new MnemosyneClient({ baseUrl: 'http://localhost:7321' });
|
|
113
113
|
|
|
114
114
|
// Create a project
|
|
115
|
-
const
|
|
115
|
+
const project = await client.createProject({ name: 'Work Notes' });
|
|
116
116
|
|
|
117
117
|
// Create an atom (a note)
|
|
118
|
-
const
|
|
118
|
+
const atom = await client.createAtom({
|
|
119
119
|
project_id: project.id,
|
|
120
120
|
title: 'Meeting Notes',
|
|
121
121
|
type: 'text',
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Mnemosyne — Working Example
|
|
2
|
+
|
|
3
|
+
Copy-paste runnable code. Every line below has been tested against a live server.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g mnemosyne-core
|
|
9
|
+
mnemosyne init --data-dir ./data
|
|
10
|
+
mnemosyne start --data-dir ./data
|
|
11
|
+
# In another terminal, run the examples below
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Naming Guide
|
|
15
|
+
|
|
16
|
+
| Mnemosyne Term | What It Means |
|
|
17
|
+
|---|---|
|
|
18
|
+
| **Project** | A folder/workspace (e.g. "Work", "Personal") |
|
|
19
|
+
| **Atom** | A note, idea, or document |
|
|
20
|
+
| **Block** | A paragraph, snippet, or file attachment inside an atom |
|
|
21
|
+
| **Bond** | A link or relationship between two atoms |
|
|
22
|
+
|
|
23
|
+
## SDK Example
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { MnemosyneClient } from 'mnemosyne-core/sdk';
|
|
27
|
+
|
|
28
|
+
const client = new MnemosyneClient({ baseUrl: 'http://localhost:7321' });
|
|
29
|
+
|
|
30
|
+
async function demo() {
|
|
31
|
+
// Health check
|
|
32
|
+
const health = await client.health();
|
|
33
|
+
console.log('Version:', health.version);
|
|
34
|
+
|
|
35
|
+
// Create a project
|
|
36
|
+
const project = await client.createProject({ name: 'My Project' });
|
|
37
|
+
console.log('Project:', project.id);
|
|
38
|
+
|
|
39
|
+
// Create an atom (a note)
|
|
40
|
+
const atom = await client.createAtom({
|
|
41
|
+
project_id: project.id,
|
|
42
|
+
title: 'Hello World',
|
|
43
|
+
type: 'text',
|
|
44
|
+
});
|
|
45
|
+
console.log('Atom:', atom.id, atom.title);
|
|
46
|
+
|
|
47
|
+
// Add a content block
|
|
48
|
+
const block = await client.createBlock(atom.id, {
|
|
49
|
+
type: 'text',
|
|
50
|
+
content: 'This is my first note in Mnemosyne.',
|
|
51
|
+
});
|
|
52
|
+
console.log('Block:', block.id);
|
|
53
|
+
|
|
54
|
+
// Search by keyword
|
|
55
|
+
const results = await client.searchKeyword('first note');
|
|
56
|
+
console.log('Found:', results.count, 'results');
|
|
57
|
+
|
|
58
|
+
// Create a second atom and bond them
|
|
59
|
+
const atom2 = await client.createAtom({
|
|
60
|
+
project_id: project.id,
|
|
61
|
+
title: 'Related Idea',
|
|
62
|
+
type: 'text',
|
|
63
|
+
});
|
|
64
|
+
const bond = await client.createBond(atom.id, { target_id: atom2.id, label: 'relates to' });
|
|
65
|
+
console.log('Bond:', bond.id);
|
|
66
|
+
|
|
67
|
+
// List bonds
|
|
68
|
+
const bonds = await client.listBonds(atom.id);
|
|
69
|
+
console.log('Bonds:', bonds.length);
|
|
70
|
+
|
|
71
|
+
// Cleanup
|
|
72
|
+
await client.deleteAtom(atom.id);
|
|
73
|
+
await client.deleteAtom(atom2.id);
|
|
74
|
+
await client.deleteProject(project.id);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
demo().catch(console.error);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Raw Fetch Example
|
|
81
|
+
|
|
82
|
+
If you prefer `fetch` over the SDK:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const BASE = 'http://localhost:7321/api/v1';
|
|
86
|
+
|
|
87
|
+
async function fetchDemo() {
|
|
88
|
+
// Health
|
|
89
|
+
const health = await fetch(`${BASE}/health`).then(r => r.json());
|
|
90
|
+
console.log(health);
|
|
91
|
+
|
|
92
|
+
// Create project
|
|
93
|
+
const project = await fetch(`${BASE}/projects`, {
|
|
94
|
+
method: 'POST',
|
|
95
|
+
headers: { 'Content-Type': 'application/json' },
|
|
96
|
+
body: JSON.stringify({ name: 'Demo' }),
|
|
97
|
+
}).then(r => r.json());
|
|
98
|
+
console.log(project);
|
|
99
|
+
|
|
100
|
+
// Create atom
|
|
101
|
+
const atom = await fetch(`${BASE}/atoms`, {
|
|
102
|
+
method: 'POST',
|
|
103
|
+
headers: { 'Content-Type': 'application/json' },
|
|
104
|
+
body: JSON.stringify({ project_id: project.project.id, title: 'Note', type: 'text' }),
|
|
105
|
+
}).then(r => r.json());
|
|
106
|
+
console.log(atom);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
fetchDemo().catch(console.error);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## CLI One-Liners
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Start with dashboard + MCP SSE
|
|
116
|
+
mnemosyne start --data-dir ./data
|
|
117
|
+
|
|
118
|
+
# Start stdio mode for Claude Desktop
|
|
119
|
+
mnemosyne start --data-dir ./data --mcp-transport stdio
|
|
120
|
+
|
|
121
|
+
# Export a project to Markdown
|
|
122
|
+
mnemosyne export --project "My Project" --format markdown --data-dir ./data
|
|
123
|
+
|
|
124
|
+
# Run diagnostics
|
|
125
|
+
mnemosyne doctor --data-dir ./data
|
|
126
|
+
```
|
package/dist/cli/index.js
CHANGED
|
@@ -3635,7 +3635,7 @@ function getVersion() {
|
|
|
3635
3635
|
const pkg = JSON.parse(readFileSync8(resolve14(process.cwd(), "package.json"), "utf-8"));
|
|
3636
3636
|
return pkg.version;
|
|
3637
3637
|
} catch {
|
|
3638
|
-
return "2.1.
|
|
3638
|
+
return "2.1.3";
|
|
3639
3639
|
}
|
|
3640
3640
|
}
|
|
3641
3641
|
}
|
|
@@ -7599,7 +7599,7 @@ var require_package = __commonJS({
|
|
|
7599
7599
|
"package.json"(exports2, module2) {
|
|
7600
7600
|
module2.exports = {
|
|
7601
7601
|
name: "mnemosyne-core",
|
|
7602
|
-
version: "2.1.
|
|
7602
|
+
version: "2.1.3",
|
|
7603
7603
|
description: "Unified memory engine for AI agents \u2014 graph atoms, semantic search, and collaborative memory",
|
|
7604
7604
|
logo: "logo.png",
|
|
7605
7605
|
author: "Arman Aslanyan <aslanyanarman88@gmail.com> (https://www.linkedin.com/in/arman-aslanyan/)",
|
|
@@ -7637,7 +7637,9 @@ var require_package = __commonJS({
|
|
|
7637
7637
|
}
|
|
7638
7638
|
},
|
|
7639
7639
|
files: [
|
|
7640
|
-
"dist"
|
|
7640
|
+
"dist",
|
|
7641
|
+
"README.md",
|
|
7642
|
+
"WORKING_EXAMPLE.md"
|
|
7641
7643
|
],
|
|
7642
7644
|
scripts: {
|
|
7643
7645
|
start: "node dist/cli/index.js",
|
|
@@ -8945,7 +8947,7 @@ function getVersion2() {
|
|
|
8945
8947
|
const pkg = JSON.parse(readFileSync8(resolve14(process.cwd(), "package.json"), "utf-8"));
|
|
8946
8948
|
return pkg.version;
|
|
8947
8949
|
} catch {
|
|
8948
|
-
return "2.1.
|
|
8950
|
+
return "2.1.3";
|
|
8949
8951
|
}
|
|
8950
8952
|
}
|
|
8951
8953
|
}
|
|
@@ -9543,7 +9545,7 @@ function getVersion3() {
|
|
|
9543
9545
|
const pkg = JSON.parse(readFileSync8(resolve14(process.cwd(), "package.json"), "utf-8"));
|
|
9544
9546
|
return pkg.version;
|
|
9545
9547
|
} catch {
|
|
9546
|
-
return "2.1.
|
|
9548
|
+
return "2.1.3";
|
|
9547
9549
|
}
|
|
9548
9550
|
}
|
|
9549
9551
|
}
|
|
@@ -10678,7 +10680,7 @@ var PKG_VERSION = (() => {
|
|
|
10678
10680
|
const pkg = JSON.parse(require("fs").readFileSync(require("path").resolve(__dirname, "../../package.json"), "utf-8"));
|
|
10679
10681
|
return pkg.version;
|
|
10680
10682
|
} catch {
|
|
10681
|
-
return "2.1.
|
|
10683
|
+
return "2.1.3";
|
|
10682
10684
|
}
|
|
10683
10685
|
})();
|
|
10684
10686
|
function handleHealth(store, pathname, method, res) {
|
|
@@ -11002,7 +11004,7 @@ var MnemosyneServer = class {
|
|
|
11002
11004
|
const wss = new import_websocket_server.default({ server: this.httpServer });
|
|
11003
11005
|
this.wsHandler = new WebSocketHandler(wss, this.store);
|
|
11004
11006
|
}
|
|
11005
|
-
const version = cfg?.server?.version || "2.1.
|
|
11007
|
+
const version = cfg?.server?.version || "2.1.3";
|
|
11006
11008
|
this.httpServer.listen(port, () => {
|
|
11007
11009
|
console.log(`Mnemosyne v${version} \u2014 port ${port}`);
|
|
11008
11010
|
console.log(`Dashboard: http://${host}:${port}/dashboard`);
|
|
@@ -11060,7 +11062,7 @@ function getVersion4() {
|
|
|
11060
11062
|
const { resolve: resolve14 } = require("path");
|
|
11061
11063
|
return JSON.parse(readFileSync8(resolve14(__dirname, "../../package.json"), "utf-8")).version;
|
|
11062
11064
|
} catch {
|
|
11063
|
-
return "2.1.
|
|
11065
|
+
return "2.1.3";
|
|
11064
11066
|
}
|
|
11065
11067
|
}
|
|
11066
11068
|
async function startCommand(options) {
|
|
@@ -11352,7 +11354,7 @@ program2.name("mnemosyne").description("Mnemosyne \u2014 Your exocortex").versio
|
|
|
11352
11354
|
try {
|
|
11353
11355
|
return require_package().version;
|
|
11354
11356
|
} catch {
|
|
11355
|
-
return "2.1.
|
|
11357
|
+
return "2.1.3";
|
|
11356
11358
|
}
|
|
11357
11359
|
})());
|
|
11358
11360
|
program2.command("init").description("Initialize a new Mnemosyne workspace").option("-d, --data-dir <path>", "Data directory", "./data").option("-c, --config <path>", "Config file path").action(initCommand);
|