mnueron 0.1.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.
Files changed (52) hide show
  1. package/ARCHITECTURE.md +161 -0
  2. package/INSTALL.md +262 -0
  3. package/LICENSE +21 -0
  4. package/README.md +305 -0
  5. package/dashboard/index.html +838 -0
  6. package/dist/cli.js +685 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/config.js +44 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/dashboard/server.js +234 -0
  11. package/dist/dashboard/server.js.map +1 -0
  12. package/dist/detectors/claude_code.js +72 -0
  13. package/dist/detectors/claude_code.js.map +1 -0
  14. package/dist/detectors/claude_desktop.js +37 -0
  15. package/dist/detectors/claude_desktop.js.map +1 -0
  16. package/dist/detectors/cursor.js +36 -0
  17. package/dist/detectors/cursor.js.map +1 -0
  18. package/dist/detectors/extra.js +59 -0
  19. package/dist/detectors/extra.js.map +1 -0
  20. package/dist/detectors/index.js +14 -0
  21. package/dist/detectors/index.js.map +1 -0
  22. package/dist/detectors/json_detector.js +95 -0
  23. package/dist/detectors/json_detector.js.map +1 -0
  24. package/dist/detectors/types.js +13 -0
  25. package/dist/detectors/types.js.map +1 -0
  26. package/dist/import/claude.js +82 -0
  27. package/dist/import/claude.js.map +1 -0
  28. package/dist/import/openai.js +102 -0
  29. package/dist/import/openai.js.map +1 -0
  30. package/dist/index.js +77 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/plugins/loader.js +175 -0
  33. package/dist/plugins/loader.js.map +1 -0
  34. package/dist/plugins/types.js +24 -0
  35. package/dist/plugins/types.js.map +1 -0
  36. package/dist/setup.js +123 -0
  37. package/dist/setup.js.map +1 -0
  38. package/dist/store/chunking.js +150 -0
  39. package/dist/store/chunking.js.map +1 -0
  40. package/dist/store/embeddings.js +126 -0
  41. package/dist/store/embeddings.js.map +1 -0
  42. package/dist/store/local.js +720 -0
  43. package/dist/store/local.js.map +1 -0
  44. package/dist/store/provider.js +7 -0
  45. package/dist/store/provider.js.map +1 -0
  46. package/dist/store/redactor.js +114 -0
  47. package/dist/store/redactor.js.map +1 -0
  48. package/dist/store/remote.js +62 -0
  49. package/dist/store/remote.js.map +1 -0
  50. package/dist/tools.js +312 -0
  51. package/dist/tools.js.map +1 -0
  52. package/package.json +55 -0
package/README.md ADDED
@@ -0,0 +1,305 @@
1
+ <p align="center">
2
+ <img src="assets/promo-large-dark.png" alt="mnueron — memory for every AI" width="420" />
3
+ </p>
4
+
5
+ <p align="center"><strong>One memory layer. Every LLM. Every dev tool. Every app you build.</strong></p>
6
+ <p align="center"><sub>Persistent memory for Claude Desktop · Claude Code · Cursor · Windsurf · Cline — local-first, free forever, open source (MIT).</sub></p>
7
+
8
+ ---
9
+
10
+ ```
11
+ ┌─────────────────────────────────────────────────────────────────────────┐
12
+ │ │
13
+ │ Dev tools: │
14
+ │ Claude Desktop · Claude Code · Cursor · Windsurf · Cline ──► MCP ─┐ │
15
+ │ │ │
16
+ │ Your apps: ├─► │
17
+ │ Python SDK · C# SDK · TypeScript · REST ─────────────────────────┘ │
18
+ │ │
19
+ │ mnueron ──► [local SQLite] FREE │
20
+ │ ──► [hosted Postgres] $ optional │
21
+ │ │
22
+ └─────────────────────────────────────────────────────────────────────────┘
23
+ ```
24
+
25
+ ## Why this exists
26
+
27
+ AI tools and AI apps are stateless by default. Every new chat session, your
28
+ AI starts from zero — you re-explain the same conventions, the same project
29
+ context, the same user preferences, every time. MNUERON gives your AI a
30
+ persistent memory that follows you across sessions, across machines, across
31
+ tools, and across LLM providers.
32
+
33
+ What changes day-to-day:
34
+
35
+ - **In Claude Desktop / Cursor:** A new chat starts knowing your project conventions, past decisions, and where you left off.
36
+ - **In your apps:** When a user comes back, the AI already knows their preferences — without you wiring it up per-provider.
37
+ - **Across providers:** Switch from OpenAI to Claude to Mistral without losing your customer's history. The memory layer is the constant.
38
+
39
+ ## What you get out of the box — free, forever
40
+
41
+ Run `mnueron setup` and every single one of these is yours. No account, no credit card, no telemetry. Your data lives at `~/.mnueron/memories.db` and never leaves your computer unless you explicitly opt into hosted mode.
42
+
43
+ | ✓ | What | Why it matters |
44
+ | :-: | --- | --- |
45
+ | ✓ | **Local MCP server** with six tools (`memory_save`, `memory_recall`, `memory_get`, `memory_list`, `memory_delete`, `memory_namespaces`) | Wires into Claude Desktop, Claude Code, Cursor, Windsurf, Cline. One memory layer, every tool. |
46
+ | ✓ | **One-command setup wizard** | Auto-detects every installed AI dev tool and configures each. Restart, you're live. |
47
+ | ✓ | **Hybrid local search** — BM25 keyword (SQLite FTS5) + semantic vector (Transformers.js + sqlite-vec) | Find memories by meaning, not just keywords. No OpenAI API key, no cloud calls, runs on CPU. |
48
+ | ✓ | **Web dashboard** (`mnueron dashboard`) | Browse, search, delete, drag-drop import — all from `localhost:3122`. |
49
+ | ✓ | **Chrome extension** for claude.ai and chatgpt.com | One-click **Capture chat** button. One-click **Backfill all history** — pulls your entire past claude.ai conversation list via their internal API in ~60 seconds. |
50
+ | ✓ | **Bulk importer** for Claude and ChatGPT export JSON files | Bring months of conversation history in one command. |
51
+ | ✓ | **Python + C# SDKs** | Use mnueron from your own apps with three lines of code. Provider-agnostic (works with OpenAI, Anthropic, Mistral, anything). |
52
+ | ✓ | **Plugin system** | Bring your own processors — PII redaction example included. |
53
+ | ✓ | **Self-host the hosted backend** | The multi-tenant Postgres + pgvector + RLS code in `server/` is yours. Run it on your own VPC if you want all the features below without paying us. |
54
+
55
+ All MIT-licensed. Fork, embed, modify, sell — whatever.
56
+
57
+ ## Optional upgrade — hosted plan
58
+
59
+ When you want cross-machine sync or are running this for a team, the hosted plan handles it. Same client code; one env-var flip.
60
+
61
+ | Feature | Local (free) | Hosted |
62
+ | --- | :-: | :-: |
63
+ | All the local capabilities above | ✓ | ✓ |
64
+ | Cross-machine sync (laptop / desktop / work box) | — | ✓ |
65
+ | Hosted web dashboard with login | — | ✓ |
66
+ | Team / org-shared namespaces, role-based access | — | ✓ |
67
+ | Audit log + retention policies | — | ✓ |
68
+ | Embedding into your own SaaS (multi-tenant API) | self-host | ✓ |
69
+ | SSO / SAML, BAAs, SLAs | — | enterprise tier |
70
+
71
+ Pricing: **$9/mo Personal · $25/user/mo Team · custom Enterprise**. Full plan details at [mnueron.com/pricing](https://mnueron.com/pricing).
72
+
73
+ To flip a machine to hosted mode:
74
+
75
+ ```bash
76
+ mnueron setup --hosted https://api.your-mnueron.com --token mnu_xxx
77
+ ```
78
+
79
+ ## Install
80
+
81
+ ### Prerequisites
82
+
83
+ You need **Node.js 20 or newer** and **npm 10 or newer**. Check what you have:
84
+
85
+ ```bash
86
+ node --version # need v20.x or higher
87
+ npm --version # need 10.x or higher
88
+ ```
89
+
90
+ Don't have Node? Install from **<https://nodejs.org/en/download>** (pick LTS).
91
+ On macOS you can also use `brew install node@20`; on Ubuntu/Debian `sudo apt install nodejs`.
92
+
93
+ ### Install mnueron
94
+
95
+ Two paths, pick whichever works for you:
96
+
97
+ #### A. From source (works today)
98
+
99
+ ```bash
100
+ git clone https://github.com/randi2160/mnueron.git
101
+ cd mnueron
102
+ npm install
103
+ npm run build
104
+ npm link # registers `mnueron` as a global command on your PATH
105
+ mnueron setup
106
+ ```
107
+
108
+ The `npm link` step is what makes `mnueron` callable from anywhere. To
109
+ uninstall later, run `npm unlink -g mnueron` from the same directory.
110
+
111
+ #### B. From npm (coming soon)
112
+
113
+ Once the package is published, the one-liner will work:
114
+
115
+ ```bash
116
+ npm install -g mnueron
117
+ mnueron setup
118
+ ```
119
+
120
+ Until then, use path A. The CLI behavior is identical either way.
121
+
122
+ ### What `mnueron setup` does
123
+
124
+ The setup wizard detects every AI dev tool you have installed, configures
125
+ each one, and reports back. Restart your tools and your AI remembers.
126
+
127
+ ```
128
+ 🧠 mnueron — persistent memory for AI dev tools
129
+ mode: local SQLite
130
+
131
+ Configured:
132
+ ✓ Claude Desktop added
133
+ ✓ Claude Code added via `claude mcp add`
134
+ ✓ Cursor added
135
+
136
+ Not detected:
137
+ Windsurf
138
+ Cline (VS Code)
139
+
140
+ ✨ Done. Restart any running AI tool to load the memory plugin.
141
+ ```
142
+
143
+ ## What your AI gets
144
+
145
+ Six new tools available to any MCP-compatible AI:
146
+
147
+ | Tool | What it does |
148
+ | --- | --- |
149
+ | `memory_save` | Save a memory (content, namespace, tags). |
150
+ | `memory_recall` | Search by relevance — called when you reference prior context. |
151
+ | `memory_list` | List recent memories, optionally filtered. |
152
+ | `memory_delete` | Delete by id. |
153
+ | `memory_namespaces` | List namespaces and their counts. |
154
+ | `memory_import_chat` | Bulk-import a Claude/ChatGPT export file. |
155
+
156
+ ## Import your existing chat history
157
+
158
+ Bring months of Claude or ChatGPT conversations into your memory in one shot:
159
+
160
+ ```bash
161
+ # Export from claude.ai → Settings → Privacy → Export data
162
+ # Export from chatgpt.com → Settings → Data Controls → Export
163
+
164
+ mnueron import ~/Downloads/conversations.json --ns my-project
165
+ ```
166
+
167
+ Auto-detects Claude vs OpenAI format. Each conversation becomes a searchable
168
+ memory tagged `imported`.
169
+
170
+ ## Use it in your apps (Python)
171
+
172
+ ```bash
173
+ pip install mnueron
174
+ ```
175
+
176
+ ```python
177
+ from mnueron import Mnueron
178
+ from openai import OpenAI
179
+
180
+ mem = Mnueron(api_key="mnu_...")
181
+ llm = OpenAI()
182
+
183
+ # Pull memory before the LLM call — provider-agnostic
184
+ context = mem.search(user_message, namespace=f"user-{user.id}", k=5)
185
+ context_str = "\n".join(m.content for m in context)
186
+
187
+ # Use any LLM you want — OpenAI shown here, swap for anthropic/mistral/gemini freely
188
+ resp = llm.chat.completions.create(
189
+ model="gpt-4o-mini",
190
+ messages=[
191
+ {"role": "system", "content": f"What you know about this user:\n{context_str}"},
192
+ {"role": "user", "content": user_message},
193
+ ],
194
+ )
195
+
196
+ # Save anything worth remembering — same call regardless of provider
197
+ mem.save(extract_facts(resp), namespace=f"user-{user.id}", source="auto")
198
+ ```
199
+
200
+ The same pattern works with Anthropic, Mistral, Gemini, or any other client —
201
+ mnueron doesn't know or care which LLM you're using.
202
+
203
+ ## Use it in your apps (.NET / C#)
204
+
205
+ ```csharp
206
+ using Mnueron;
207
+
208
+ using var mem = new MnueronClient("mnu_...");
209
+ var context = await mem.SearchAsync(question, $"user-{userId}", k: 5);
210
+ // Call any LLM API with `context` injected into the prompt
211
+ await mem.SaveAsync(newFact, $"user-{userId}");
212
+ ```
213
+
214
+ Single-file C# client. Drop `MnueronClient.cs` into any .NET 6+ project. No
215
+ NuGet package required.
216
+
217
+ ## CLI reference
218
+
219
+ ```
220
+ mnueron setup Detect and configure all installed AI tools
221
+ [--only <tool>] claude-desktop | claude-code | cursor | windsurf | cline
222
+ [--hosted <url> --token <t>] Hosted mode instead of local SQLite
223
+ [--dry-run] Show what would change
224
+ [--uninstall] Remove from all detected tools
225
+ mnueron import <file> Bulk-import a Claude/OpenAI export
226
+ mnueron search <query> Quick terminal search
227
+ mnueron stats Counts by namespace
228
+ mnueron namespaces List namespaces
229
+ ```
230
+
231
+ ## Self-host the hosted backend
232
+
233
+ The hosted backend in `server/` is yours — multi-tenant Postgres + pgvector
234
+ with row-level security. Step-by-step on Supabase free tier in
235
+ `server/SUPABASE_SETUP.md` (~15 minutes from empty database to working API).
236
+
237
+ ```bash
238
+ # Quick start (Supabase recommended over RDS — see SUPABASE_SETUP.md)
239
+ psql $DATABASE_URL < server/supabase_schema.sql
240
+ cd server && npm install && npx tsx index.ts
241
+ ```
242
+
243
+ ## Supported AI dev tools
244
+
245
+ | Tool | Auto-configured | Notes |
246
+ | --- | --- | --- |
247
+ | Claude Desktop | ✓ | All platforms (macOS, Windows, Linux) |
248
+ | Claude Code | ✓ | Uses `claude mcp add` CLI when available |
249
+ | Cursor | ✓ | `~/.cursor/mcp.json` |
250
+ | Windsurf | ✓ | `~/.codeium/windsurf/mcp_config.json` |
251
+ | Cline (VS Code) | ✓ | VS Code globalStorage |
252
+ | Aider, OpenCode, Goose, Continue.dev, Zed | manual | All speak MCP |
253
+
254
+ ## Repo layout
255
+
256
+ ```
257
+ mnueron/
258
+ ├── src/ Local MCP server (Node, stdio)
259
+ │ ├── index.ts Server entry point
260
+ │ ├── cli.ts setup | import | search | stats
261
+ │ ├── setup.ts 1-click wizard orchestration
262
+ │ ├── detectors/ One file per supported dev tool
263
+ │ ├── tools.ts MCP tool definitions + handlers
264
+ │ ├── config.ts Local vs remote provider switch
265
+ │ ├── store/ Storage providers (SQLite local, HTTP remote)
266
+ │ └── import/ Claude / OpenAI export parsers
267
+ ├── server/ Hosted multi-tenant backend
268
+ │ ├── schema.sql Standalone Postgres schema
269
+ │ ├── supabase_schema.sql Supabase-adapted schema
270
+ │ ├── index.ts Express reference implementation
271
+ │ ├── README.md
272
+ │ └── SUPABASE_SETUP.md 15-minute step-by-step
273
+ ├── sdks/
274
+ │ ├── python/ Python SDK (sync + async)
275
+ │ │ ├── mnueron.py
276
+ │ │ ├── pyproject.toml
277
+ │ │ └── README.md
278
+ │ └── csharp/ .NET / C# SDK
279
+ │ ├── MnueronClient.cs
280
+ │ └── README.md
281
+ ├── INSTALL.md Full install guide (this is what most users read)
282
+ ├── ARCHITECTURE.md Multi-tenant design + threat model
283
+ ├── LICENSE MIT
284
+ └── README.md You're here
285
+ ```
286
+
287
+ ## License
288
+
289
+ mnueron uses an **open-core** model. Full details in [`LICENSE-OVERVIEW.md`](LICENSE-OVERVIEW.md).
290
+
291
+ | Directory | License | What it means |
292
+ | --- | --- | --- |
293
+ | `src/`, `dashboard/`, `extension/`, `sdks/`, `examples/`, `scripts/` | **MIT** | Use, fork, embed, sell — no restrictions. Drop the SDK into commercial products freely. |
294
+ | `server/` (and future `dashboard-web/`) | **[FSL-1.1-Apache-2.0](server/LICENSE)** | Read, modify, contribute, self-host for your own use. You cannot launch a competing commercial memory-as-a-service. Each version auto-converts to Apache 2.0 two years after release. |
295
+
296
+ In short: **the client is fully open source. The hosted backend is source-available.** This is the same model Sentry uses, and it lets us welcome contributions while keeping a viable hosted business.
297
+
298
+ ## Contributing
299
+
300
+ Contributions welcome — see [`CONTRIBUTING.md`](CONTRIBUTING.md). All contributors sign a one-time [Contributor License Agreement](CLA.md) (same pattern as Apache, Google, Microsoft).
301
+
302
+ ## Status
303
+
304
+ Pre-alpha — works end-to-end but is still being shaped. If you find a rough
305
+ edge, file an issue; if you fix it, PRs welcome.