mnemosyne-core 2.1.1 → 2.1.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 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 { project } = await client.createProject({ name: 'Work Notes' });
115
+ const project = await client.createProject({ name: 'Work Notes' });
116
116
 
117
117
  // Create an atom (a note)
118
- const { atom } = await client.createAtom({
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
@@ -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.1",
7602
+ version: "2.1.2",
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",