mneme-cli 0.4.0__py3-none-any.whl
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.
- mneme/__init__.py +8 -0
- mneme/__main__.py +5 -0
- mneme/config.py +103 -0
- mneme/core.py +6526 -0
- mneme/profiles/eu-mdr.md +196 -0
- mneme/profiles/iso-13485.md +182 -0
- mneme/profiles/mappings/dds.json +21 -0
- mneme/profiles/mappings/requirements.json +22 -0
- mneme/profiles/mappings/risk-register.json +24 -0
- mneme/profiles/mappings/test-cases.json +21 -0
- mneme/profiles/mappings/user-needs.json +19 -0
- mneme/server.py +312 -0
- mneme/templates/workspace/.gitignore +9 -0
- mneme/templates/workspace/AGENTS.md +706 -0
- mneme/templates/workspace/README.md +33 -0
- mneme/templates/workspace/inbox/.gitkeep +0 -0
- mneme/templates/workspace/index.md +18 -0
- mneme/templates/workspace/log.md +6 -0
- mneme/templates/workspace/profiles/README.md +109 -0
- mneme/templates/workspace/profiles/mappings/.gitkeep +0 -0
- mneme/templates/workspace/schema/entities.json +5 -0
- mneme/templates/workspace/schema/graph.json +6 -0
- mneme/templates/workspace/schema/tags.json +5 -0
- mneme/templates/workspace/sources/.gitkeep +0 -0
- mneme/templates/workspace/wiki/_templates/page.md +31 -0
- mneme/ui.html +1520 -0
- mneme_cli-0.4.0.dist-info/METADATA +499 -0
- mneme_cli-0.4.0.dist-info/RECORD +32 -0
- mneme_cli-0.4.0.dist-info/WHEEL +5 -0
- mneme_cli-0.4.0.dist-info/entry_points.txt +2 -0
- mneme_cli-0.4.0.dist-info/licenses/LICENSE +21 -0
- mneme_cli-0.4.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mneme-cli
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Mnemosyne - CLI tool that turns documents into a searchable second brain. Ingest once, query forever.
|
|
5
|
+
Author-email: Tolis Moustaklis <apostolos.moustaklis@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tolism/mneme
|
|
8
|
+
Project-URL: Repository, https://github.com/tolism/mneme
|
|
9
|
+
Project-URL: Issues, https://github.com/tolism/mneme/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/tolism/mneme#readme
|
|
11
|
+
Project-URL: Changelog, https://github.com/tolism/mneme/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: knowledge-management,second-brain,cli,wiki,memvid,llm,qms,obsidian,traceability
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Documentation
|
|
25
|
+
Classifier: Topic :: Office/Business
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
27
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: memvid-sdk>=2.0.0
|
|
32
|
+
Requires-Dist: portalocker>=2.0.0
|
|
33
|
+
Provides-Extra: pdf
|
|
34
|
+
Requires-Dist: pymupdf>=1.23.0; extra == "pdf"
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: pymupdf>=1.23.0; extra == "all"
|
|
37
|
+
Provides-Extra: release
|
|
38
|
+
Requires-Dist: build>=1.0.0; extra == "release"
|
|
39
|
+
Requires-Dist: twine>=5.0.0; extra == "release"
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="https://raw.githubusercontent.com/tolism/mneme/main/assets/logo.png" alt="Mnemosyne" width="400">
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
<h1 align="center"></h1>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
A CLI tool that turns your documents into a searchable second brain. Drop files in, get a structured knowledge layer out -- browsable by humans in Obsidian, queryable by machines in under 5ms.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install mneme-cli
|
|
54
|
+
mneme new ~/projects/my-research --name "My Research" --client acme-corp
|
|
55
|
+
cd ~/projects/my-research
|
|
56
|
+
mneme ingest proposal.pdf acme-corp
|
|
57
|
+
mneme search "delivery timeline"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
One installed `mneme` CLI can serve many independent workspaces. Switch between them by `cd`-ing, exporting `MNEME_HOME`, or passing `--workspace /path/to/ws`.
|
|
61
|
+
|
|
62
|
+
That's it. Your knowledge compounds instead of decaying.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Why
|
|
67
|
+
|
|
68
|
+
You're building a medical device. You have a risk analysis in a PDF, user needs in a spreadsheet, meeting notes in markdown, and 47 requirements in a CSV. An auditor asks "show me the trace from hazard HAZ-001 to the test that verifies its mitigation." You spend two hours searching folders.
|
|
69
|
+
|
|
70
|
+
Mneme fixes this:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Import everything
|
|
74
|
+
mneme ingest risk-analysis.pdf cardio-monitor
|
|
75
|
+
mneme ingest-csv user-needs.csv cardio-monitor --mapping user-needs
|
|
76
|
+
mneme ingest-csv risk-register.csv cardio-monitor --mapping risk-register
|
|
77
|
+
|
|
78
|
+
# Answer the auditor in 2 seconds
|
|
79
|
+
mneme trace show cardio-monitor/haz-001 --direction forward
|
|
80
|
+
# haz-001 (Electrical Shock)
|
|
81
|
+
# mitigated-by -> rma-003 (Insulation Barrier)
|
|
82
|
+
# implemented-by -> req-007 (Double Insulation)
|
|
83
|
+
# verified-by -> test-042 (Dielectric Strength Test)
|
|
84
|
+
|
|
85
|
+
# Find gaps before the auditor does
|
|
86
|
+
mneme trace gaps cardio-monitor
|
|
87
|
+
# Requirements with no verification: req-011, req-023
|
|
88
|
+
# Hazards with no mitigation: haz-009
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Every document ingested once. Every trace link tracked. Every vocabulary term harmonized. Every gap found automatically.
|
|
92
|
+
|
|
93
|
+
No databases. No servers. No infrastructure. Plain markdown files + JSON schemas that any system can read.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Install
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install mneme-cli
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Or from source:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git clone https://github.com/tolism/mneme.git
|
|
107
|
+
cd mneme
|
|
108
|
+
pip install -e .
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
You now have the `mneme` command globally. Verify with `mneme --help`.
|
|
112
|
+
|
|
113
|
+
**Optional:** For PDF support, `pip install "mneme-cli[pdf]"`. For everything, `pip install "mneme-cli[all]"`.
|
|
114
|
+
|
|
115
|
+
**Requirements:** Python 3.9+. Works on macOS, Linux, Windows.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Quick Start
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Scaffold a new workspace (from anywhere)
|
|
123
|
+
mneme new ~/projects/my-project --name "My Project" --client client-a
|
|
124
|
+
|
|
125
|
+
cd ~/projects/my-project
|
|
126
|
+
|
|
127
|
+
# Ingest some documents
|
|
128
|
+
mneme ingest report.pdf client-a
|
|
129
|
+
mneme ingest meeting-notes.md client-a
|
|
130
|
+
|
|
131
|
+
# Search across everything
|
|
132
|
+
mneme search "quarterly budget"
|
|
133
|
+
|
|
134
|
+
# Check health
|
|
135
|
+
mneme stats
|
|
136
|
+
|
|
137
|
+
# Launch the web dashboard
|
|
138
|
+
python -m mneme.server # http://localhost:3141
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Run mneme against any workspace
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
mneme --workspace ~/projects/parkiwatch stats # one-shot
|
|
145
|
+
export MNEME_HOME=~/projects/parkiwatch # sticky for the shell
|
|
146
|
+
mneme stats
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
One installed CLI serves many projects — each workspace is just a directory.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## CLI
|
|
154
|
+
|
|
155
|
+
| Command | What It Does |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `mneme new <dir>` | Scaffold a new workspace from the bundled template |
|
|
158
|
+
| `mneme init` | Scaffold a workspace in cwd (legacy) |
|
|
159
|
+
| `mneme --workspace <dir>` | Run any command against a specific workspace |
|
|
160
|
+
| `mneme ingest <file> <client>` | Ingest a source document |
|
|
161
|
+
| `mneme resync <file> <client>` | Re-ingest an updated source via 3-way merge, preserving hand edits |
|
|
162
|
+
| `mneme resync-resolve <client/page>` | Finalize a conflicted resync after editing out markers |
|
|
163
|
+
| `mneme search "<query>"` | Search across all layers |
|
|
164
|
+
| `mneme draft --doc-type <t> --section <s> --client <c>` | Build a *write packet* for an LLM agent to produce one section |
|
|
165
|
+
| `mneme validate writing-style <page>` | Build a *review packet* for an LLM agent to grade a page |
|
|
166
|
+
| `mneme agent plan --goal "..." --doc-type <t> --client <c>` | Generate a deterministic TODO plan from the active profile |
|
|
167
|
+
| `mneme agent next-task` | Return the next ready task in the active plan |
|
|
168
|
+
| `mneme agent task-done <id>` | Mark a task as done |
|
|
169
|
+
| `mneme sync` | Sync wiki to Memvid memory |
|
|
170
|
+
| `mneme drift` | Detect layer desynchronization |
|
|
171
|
+
| `mneme stats` | Health overview |
|
|
172
|
+
| `mneme repair` | Fix corrupted archives |
|
|
173
|
+
|
|
174
|
+
**Formats:** `.md`, `.txt`, `.pdf`
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## For LLM agents
|
|
179
|
+
|
|
180
|
+
If you are an LLM agent driving mneme on a user's behalf — read **[AGENTS.md](AGENTS.md)** first. It is the canonical contract for the agent loop, the standard task templates (DVR, CER, risk file, resync, migration, pre-submission), the sub-agent spawning patterns, and the hard rules you must never violate.
|
|
181
|
+
|
|
182
|
+
The 30-second version of the agent loop:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# 1. Generate a plan from the active profile
|
|
186
|
+
mneme agent plan --goal "Produce a Design Validation Report" \
|
|
187
|
+
--doc-type design-validation-report \
|
|
188
|
+
--client tda
|
|
189
|
+
|
|
190
|
+
# 2. Walk the plan one task at a time
|
|
191
|
+
mneme agent next-task # returns a self-contained task envelope
|
|
192
|
+
# (do the work the envelope describes -- usually `mneme draft` or
|
|
193
|
+
# `mneme validate writing-style`, then write or grade prose)
|
|
194
|
+
mneme agent task-done section-context
|
|
195
|
+
|
|
196
|
+
# 3. Repeat until done
|
|
197
|
+
mneme agent next-task
|
|
198
|
+
# ...
|
|
199
|
+
|
|
200
|
+
# 4. Inspect progress at any time
|
|
201
|
+
mneme agent show
|
|
202
|
+
mneme agent list
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Mneme generates the plan deterministically from the active profile's section_notes. Tasks have a dependency graph; `next-task` only returns ones whose dependencies are satisfied. The plan and per-task state are persisted under `<workspace>/.mneme/agent-plans/` (gitignored). Mneme does not call any LLM — you (the agent) do the writing. Mneme assembles the contracts.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## How It Works
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
Your Document
|
|
213
|
+
|
|
|
214
|
+
v
|
|
215
|
+
mneme ingest
|
|
216
|
+
|
|
|
217
|
+
+---> Wiki Layer (markdown, Obsidian-compatible)
|
|
218
|
+
| Frontmatter, citations, [[wikilinks]]
|
|
219
|
+
| You read and browse here
|
|
220
|
+
|
|
|
221
|
+
+---> Memory Layer (.mv2 archive)
|
|
222
|
+
| Smart Frames, semantic embeddings
|
|
223
|
+
| Machines query here (<5ms)
|
|
224
|
+
|
|
|
225
|
+
+---> Schema Layer (JSON)
|
|
226
|
+
entities.json - people, companies, products
|
|
227
|
+
graph.json - relationships between entities
|
|
228
|
+
tags.json - taxonomy
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Every `mneme ingest` writes both layers atomically. `mneme drift` catches desync. `mneme repair` fixes it.
|
|
232
|
+
|
|
233
|
+
**Memvid is optional.** Without it, mneme runs as a wiki-only knowledge base with text search. Add `memvid-sdk` when you outgrow grep.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Obsidian Integration
|
|
238
|
+
|
|
239
|
+
A mneme workspace *is* an Obsidian vault. The wiki pages use YAML frontmatter and `[[wikilinks]]`, so Obsidian indexes everything natively.
|
|
240
|
+
|
|
241
|
+
**Open a workspace as a vault:**
|
|
242
|
+
|
|
243
|
+
1. Open Obsidian → *Open folder as vault* → select your workspace directory (e.g. `~/projects/parkiwatch`)
|
|
244
|
+
2. Obsidian creates `.obsidian/` inside the workspace on first open — this is safe and mneme ignores it
|
|
245
|
+
3. Browse `wiki/` in the file explorer; click any page to render with backlinks, graph view, and tag search
|
|
246
|
+
|
|
247
|
+
**Recommended Obsidian settings:**
|
|
248
|
+
|
|
249
|
+
- **Files & Links → Default location for new notes:** `wiki/{default-client}/`
|
|
250
|
+
- **Files & Links → New link format:** `Relative path to file`
|
|
251
|
+
- **Files & Links → Use [[Wikilinks]]:** ON
|
|
252
|
+
- **Files & Links → Detect all file extensions:** OFF (keeps `sources/` archive out of the graph)
|
|
253
|
+
|
|
254
|
+
**Useful community plugins:**
|
|
255
|
+
|
|
256
|
+
| Plugin | Why |
|
|
257
|
+
|---|---|
|
|
258
|
+
| **Dataview** | Query frontmatter: list all pages with `type: hazard`, `confidence: low`, etc. |
|
|
259
|
+
| **Templater** | Paste mneme page frontmatter from a snippet |
|
|
260
|
+
| **Tag Wrangler** | Visualise the same tags mneme tracks in `schema/tags.json` |
|
|
261
|
+
| **Graph Analysis** | See the entity relationships mneme builds in `schema/graph.json` |
|
|
262
|
+
|
|
263
|
+
**Workflow:**
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Ingest new docs from the CLI
|
|
267
|
+
mneme ingest meeting.pdf parkiwatch
|
|
268
|
+
|
|
269
|
+
# Obsidian auto-detects the new wiki page
|
|
270
|
+
# Read, link, and annotate in Obsidian
|
|
271
|
+
# mneme lint catches dead links on your next run
|
|
272
|
+
mneme lint
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Sync the workspace via Dropbox, iCloud, or git and you have multi-device Obsidian + mneme.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Profiles (and custom profiles)
|
|
280
|
+
|
|
281
|
+
A profile defines the vocabulary and document structure rules for a regulatory framework. mneme ships two bundled profiles:
|
|
282
|
+
|
|
283
|
+
| Profile | Use when |
|
|
284
|
+
|---|---|
|
|
285
|
+
| `eu-mdr` | EU Medical Device Regulation (2017/745) -- 15 vocabulary rules, 6 section templates |
|
|
286
|
+
| `iso-13485` | ISO 13485:2016 QMS -- 13 vocabulary rules, 6 section templates |
|
|
287
|
+
|
|
288
|
+
Activate one in any workspace with `mneme profile set eu-mdr`. From then on, `mneme harmonize` enforces vocabulary, `mneme validate writing-style` builds an LLM review packet for prose, and `mneme validate consistency` checks cross-document standard versions.
|
|
289
|
+
|
|
290
|
+
### Adding your own profile
|
|
291
|
+
|
|
292
|
+
Profiles are just JSON files in `<workspace>/profiles/`. **No reinstall, no rebuild, no PR to mneme.** Drop a file in, activate it, you're done.
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# 1. mneme new already creates the profiles/ folder for you
|
|
296
|
+
mneme new ~/projects/parkiwatch --name Parkiwatch --client parkiwatch
|
|
297
|
+
cd ~/projects/parkiwatch
|
|
298
|
+
|
|
299
|
+
# 2. Drop your profile in (use any text editor or this heredoc).
|
|
300
|
+
# Profiles are markdown with YAML frontmatter.
|
|
301
|
+
cat > profiles/parkiwatch-qms.md <<'EOF'
|
|
302
|
+
---
|
|
303
|
+
name: Parkiwatch QMS
|
|
304
|
+
description: Internal quality framework for the Parkiwatch product line
|
|
305
|
+
version: 1.0
|
|
306
|
+
tone: formal
|
|
307
|
+
voice: passive-for-procedures
|
|
308
|
+
trace_types: [derived-from, implemented-by, verified-by]
|
|
309
|
+
requirement_levels:
|
|
310
|
+
shall: mandatory
|
|
311
|
+
should: recommended
|
|
312
|
+
vocabulary:
|
|
313
|
+
- use: parking violation
|
|
314
|
+
reject: [parking ticket, infraction]
|
|
315
|
+
- use: enforcement officer
|
|
316
|
+
reject: [meter maid, warden]
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
# Principles
|
|
320
|
+
|
|
321
|
+
- Be specific. Cite the policy clause.
|
|
322
|
+
- Auditable: every claim must trace to a controlled record.
|
|
323
|
+
|
|
324
|
+
# Terminology
|
|
325
|
+
|
|
326
|
+
| Use | Instead of | Why |
|
|
327
|
+
|---|---|---|
|
|
328
|
+
| parking violation | parking ticket, infraction | Internal Parkiwatch convention. |
|
|
329
|
+
|
|
330
|
+
# Document Type: incident-report
|
|
331
|
+
|
|
332
|
+
Standard parking incident structure used by all enforcement officers.
|
|
333
|
+
|
|
334
|
+
## Section: evidence
|
|
335
|
+
|
|
336
|
+
Photo evidence with timestamp and GPS coordinates is mandatory.
|
|
337
|
+
EOF
|
|
338
|
+
|
|
339
|
+
# 3. Activate and verify
|
|
340
|
+
mneme profile set parkiwatch-qms
|
|
341
|
+
mneme profile show
|
|
342
|
+
# Active profile: Parkiwatch QMS
|
|
343
|
+
|
|
344
|
+
# 4. Use it
|
|
345
|
+
mneme harmonize parkiwatch # flag "parking ticket" -> should be "parking violation"
|
|
346
|
+
mneme harmonize parkiwatch --fix # auto-fix vocabulary
|
|
347
|
+
mneme validate writing-style parkiwatch/incident-001 > review.md # paste into Claude
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### How resolution works
|
|
351
|
+
|
|
352
|
+
When you run `mneme profile set <name>`, mneme looks in two places, in order:
|
|
353
|
+
|
|
354
|
+
1. **First:** `<workspace>/profiles/<name>.md` (your local profile)
|
|
355
|
+
2. **Then:** `<installed-mneme>/profiles/<name>.md` (the bundled `eu-mdr` / `iso-13485`)
|
|
356
|
+
|
|
357
|
+
The first one wins. So you can:
|
|
358
|
+
|
|
359
|
+
- **Add a brand-new framework** mneme doesn't ship -- just give it a unique name (e.g. `parkiwatch-qms.md`, `acme-internal.md`)
|
|
360
|
+
- **Override a bundled framework** with project-specific tweaks -- create your own `eu-mdr.md` in the workspace and it shadows the bundled one for that project only
|
|
361
|
+
|
|
362
|
+
The same shadowing rule applies to CSV column mappings under `<workspace>/profiles/mappings/`, used by `mneme ingest-csv`. Mappings are still JSON because they are programmatic, not prose.
|
|
363
|
+
|
|
364
|
+
If neither file exists, you get a clear error listing both paths it checked.
|
|
365
|
+
|
|
366
|
+
### What goes into a profile
|
|
367
|
+
|
|
368
|
+
A profile is a markdown file with YAML frontmatter. The frontmatter carries the structured fields (`vocabulary`, `trace_types`, `tone`, etc.) and the body carries the writing-style prose under recognized H1 headings.
|
|
369
|
+
|
|
370
|
+
| Frontmatter field | What it does | Used by |
|
|
371
|
+
|---|---|---|
|
|
372
|
+
| `name`, `description`, `version` | Display metadata | `mneme profile show` |
|
|
373
|
+
| `vocabulary[].use` / `.reject[]` | Terminology swaps | `mneme harmonize` (mechanical) |
|
|
374
|
+
| `requirement_levels` | Reserved words (`shall`, `should`, `may`) | Documentation |
|
|
375
|
+
| `trace_types` | Allowed relationship types for trace links | Documentation |
|
|
376
|
+
| `tone`, `voice`, `citation_style` | Style hints | `mneme profile show` |
|
|
377
|
+
| `placeholder_for_missing_refs` | Marker token (e.g. `[TO ADD REF]`) | LLM agent |
|
|
378
|
+
|
|
379
|
+
| Body H1 heading | What it becomes |
|
|
380
|
+
|---|---|
|
|
381
|
+
| `# Principles` | Top-level principles (bullets) |
|
|
382
|
+
| `# General Rules` | Cross-cutting writing rules (bullets) |
|
|
383
|
+
| `# Terminology` | A 3-column markdown table: Use / Instead of / Why |
|
|
384
|
+
| `# Framing: <context>` | One worked example: **Wrong:** / **Correct:** / **Why:** blocks |
|
|
385
|
+
| `# Document Type: <slug>` | A document type description; nested `## Section: <slug>` blocks become per-section guidance |
|
|
386
|
+
| `# Submission Checklist` | Pre-submission go/no-go items (bullets) |
|
|
387
|
+
|
|
388
|
+
**Important:** profiles do NOT enforce a list of required headings. Mechanical heading checks were removed because they don't reflect what regulatory reviewers actually care about. Instead, use `mneme validate writing-style <page>` to build a review packet that an LLM agent grades against the full style guide.
|
|
389
|
+
|
|
390
|
+
See `EXAMPLES.md` Example 13 for a full walkthrough with a real Parkiwatch scenario. The bundled `eu-mdr.md` and `iso-13485.md` profiles inside the installed package are good starting templates -- copy one and edit it.
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## Web Dashboard
|
|
395
|
+
|
|
396
|
+
`python -m mneme.server` -- opens at `http://localhost:3141`
|
|
397
|
+
|
|
398
|
+
- **Dashboard** -- stats, per-client counts, activity log
|
|
399
|
+
- **Search** -- dual-layer results with source attribution
|
|
400
|
+
- **Wiki** -- browse all pages with rendered markdown
|
|
401
|
+
- **Entities** -- filterable table of extracted entities
|
|
402
|
+
- **Health** -- drift status, sync state
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## When You Need This
|
|
407
|
+
|
|
408
|
+
| Scale | Wiki alone | Wiki + Memvid |
|
|
409
|
+
|---|---|---|
|
|
410
|
+
| 5 docs | Plenty | Overkill |
|
|
411
|
+
| 50 docs | Fine | Starting to help |
|
|
412
|
+
| 500 docs | Grep takes 2-3s, misses semantic matches | 2ms, cross-client connections |
|
|
413
|
+
| 5,000 docs | Unusable | Still 2ms |
|
|
414
|
+
|
|
415
|
+
Start wiki-only. Add the memory layer when search gets slow.
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Project Structure
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
mneme/
|
|
423
|
+
sources/ Raw documents (immutable, never modified)
|
|
424
|
+
wiki/ Markdown knowledge pages (Obsidian-compatible)
|
|
425
|
+
schema/ entities.json, graph.json, tags.json
|
|
426
|
+
memvid/ .mv2 memory archives
|
|
427
|
+
core.py Engine (ingest, search, sync, drift, repair)
|
|
428
|
+
config.py Configuration
|
|
429
|
+
server.py Web dashboard
|
|
430
|
+
index.md Master page catalog
|
|
431
|
+
log.md Activity timeline
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Downstream Use
|
|
437
|
+
|
|
438
|
+
Mneme outputs plain files -- markdown and JSON. Any system can read them. The CLI is designed to be called programmatically by other applications.
|
|
439
|
+
|
|
440
|
+
**Next up:** Mneme as the knowledge backend for a QMS (Quality Management System) -- quality documentation, audit trails, compliance evidence, all searchable.
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Releasing (maintainers)
|
|
445
|
+
|
|
446
|
+
Mneme ships to PyPI as `mneme`. To cut a new release:
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
# 1. Bump the version in mneme/__init__.py and pyproject.toml
|
|
450
|
+
# 2. Install release tooling
|
|
451
|
+
pip install -e ".[release]"
|
|
452
|
+
|
|
453
|
+
# 3. Dry run to TestPyPI first
|
|
454
|
+
scripts/release.sh test # bash (macOS/Linux/WSL)
|
|
455
|
+
scripts\release.ps1 test # PowerShell (Windows)
|
|
456
|
+
|
|
457
|
+
pip install --index-url https://test.pypi.org/simple/ \
|
|
458
|
+
--extra-index-url https://pypi.org/simple/ mneme
|
|
459
|
+
|
|
460
|
+
# 4. Production
|
|
461
|
+
scripts/release.sh prod # bash
|
|
462
|
+
scripts\release.ps1 prod # PowerShell
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
The script cleans `dist/`, runs `python -m build`, validates with `twine check`, and uploads.
|
|
466
|
+
|
|
467
|
+
You'll need a PyPI API token in `~/.pypirc`:
|
|
468
|
+
|
|
469
|
+
```ini
|
|
470
|
+
[distutils]
|
|
471
|
+
index-servers =
|
|
472
|
+
pypi
|
|
473
|
+
testpypi
|
|
474
|
+
|
|
475
|
+
[pypi]
|
|
476
|
+
username = __token__
|
|
477
|
+
password = pypi-AgEI... # from https://pypi.org/manage/account/token/
|
|
478
|
+
|
|
479
|
+
[testpypi]
|
|
480
|
+
repository = https://test.pypi.org/legacy/
|
|
481
|
+
username = __token__
|
|
482
|
+
password = pypi-AgENd... # from https://test.pypi.org/manage/account/token/
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Credits
|
|
488
|
+
|
|
489
|
+
This project builds on two foundational ideas:
|
|
490
|
+
|
|
491
|
+
- **LLM Wiki pattern** by [Andrej Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) -- the insight that LLMs should build and maintain a persistent, compounding wiki instead of re-deriving answers from raw documents on every query
|
|
492
|
+
- **Memvid** by [Olow304/memvid](https://github.com/Olow304/memvid) -- single-file AI memory with sub-millisecond retrieval, no vector DB required
|
|
493
|
+
- **Original implementation** -- [tashisleepy/knowledge-engine](https://github.com/tashisleepy/knowledge-engine) -- the first version that fused both patterns into a dual-layer bridge
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## License
|
|
498
|
+
|
|
499
|
+
MIT
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
mneme/__init__.py,sha256=fkgN4aACg9LlJ-PZP0-S0v5vyAoqF7IqwP-wKeOJ5_Y,189
|
|
2
|
+
mneme/__main__.py,sha256=qZ-_7Z8Ht4UpvmHCpaKs7d4fBdX-EgikXlANl9bCkiI,108
|
|
3
|
+
mneme/config.py,sha256=Wwvx2FyNF2B710Kwc8rXm5cUID0iz_nkPwUwIwgMO8s,4376
|
|
4
|
+
mneme/core.py,sha256=DTj2vhND1n5r73lsgzU65cJyQmwkFfxvI2bYKXbh0xg,252977
|
|
5
|
+
mneme/server.py,sha256=yMualn8P3y8DWt0hmIpjp7awyokNlbaurXP4YdBc-l4,9501
|
|
6
|
+
mneme/ui.html,sha256=CfslMlpO_XSN5ixmvKW9rwSbBa0Kn1wnlYKD_Y87dbg,47414
|
|
7
|
+
mneme/profiles/eu-mdr.md,sha256=_5htKZbsCJ8GqoeqimROJ8_xCX9ZoZyaymuDuzxxzd0,11547
|
|
8
|
+
mneme/profiles/iso-13485.md,sha256=dg0nOqpX4GKTOy-bnXKzF2MCPO62Etl31K3-a4i-S8Q,7651
|
|
9
|
+
mneme/profiles/mappings/dds.json,sha256=p4SmOGG8lv4exkB8aS8U5tAahDlal2i_cP3niQqQmLE,741
|
|
10
|
+
mneme/profiles/mappings/requirements.json,sha256=YutMUw0veX4jqerpNZ2uK_JmPvVBB7kriEy8jKmJf24,790
|
|
11
|
+
mneme/profiles/mappings/risk-register.json,sha256=x5z4eid_5eebOMan85N23eqZuTTSxoPX5lrpR_Juw6k,875
|
|
12
|
+
mneme/profiles/mappings/test-cases.json,sha256=jkPWCLtr887xJ7b9mkR1u_siLk_3LzenxdFmcKBUUVQ,758
|
|
13
|
+
mneme/profiles/mappings/user-needs.json,sha256=15vSMETHpp01vXdkczV3JENsWbzp8F84MXMuDPjWPMo,633
|
|
14
|
+
mneme/templates/workspace/.gitignore,sha256=dUDl8hsUhviTljpg2h-EY36OxV9Y2W3LMFzHUFxq7a0,116
|
|
15
|
+
mneme/templates/workspace/AGENTS.md,sha256=07h2HE85IT4W6uNpYAHP1h59bMl2Nl-XisbbgxhaqJ8,28774
|
|
16
|
+
mneme/templates/workspace/README.md,sha256=XE9gBbY9SsHpsE5rms9Auva7e36zR8P20CiT5_kKH-g,778
|
|
17
|
+
mneme/templates/workspace/index.md,sha256=2j-glqiUur9qs0ZKH-o16xeTkyNkeoFiBUonhKuKSkg,223
|
|
18
|
+
mneme/templates/workspace/log.md,sha256=qvS2K-r2eB9V3Z2zXwOUxwr2I6dG-AafpTc8GDwEqHs,180
|
|
19
|
+
mneme/templates/workspace/inbox/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
mneme/templates/workspace/profiles/README.md,sha256=oExKhdLeC0DLdy3Z-e5C4eEHUqEPP_E7GSqJ_G41P0s,3072
|
|
21
|
+
mneme/templates/workspace/profiles/mappings/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
mneme/templates/workspace/schema/entities.json,sha256=cmw1y81XAi84OrlbuoXmJI-dY51Q-jV7yigbvzxhP0k,70
|
|
23
|
+
mneme/templates/workspace/schema/graph.json,sha256=DA3TNSbwEtugc_Pf6QPuuTRaEY-PDlcmGm9Mo0yF-zk,82
|
|
24
|
+
mneme/templates/workspace/schema/tags.json,sha256=htTzMGozXluVxUL-eHDzrQ-GVKNZ8ZPSte9uYT1tNhU,66
|
|
25
|
+
mneme/templates/workspace/sources/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
mneme/templates/workspace/wiki/_templates/page.md,sha256=Kb554giYgCH8doaN4KE4tlUaaJd6CNkaf79Xq_bXp1M,436
|
|
27
|
+
mneme_cli-0.4.0.dist-info/licenses/LICENSE,sha256=FJerDbT9tlujuNBel_OFb73yaLF3l8mtBQr_yeYqyO4,1073
|
|
28
|
+
mneme_cli-0.4.0.dist-info/METADATA,sha256=w2nm8Y2Oc22vvbioXx4Bc8WEMDClQNqqZnzfJW90VtE,18324
|
|
29
|
+
mneme_cli-0.4.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
30
|
+
mneme_cli-0.4.0.dist-info/entry_points.txt,sha256=_0R-tphaoSI7y5jCw1KKfoCahBuKz6MjDmIlE9eqYT0,42
|
|
31
|
+
mneme_cli-0.4.0.dist-info/top_level.txt,sha256=eGEDq8El6N5l47QO5ttbAnUOSRQvE02iS_eU6d5leYg,6
|
|
32
|
+
mneme_cli-0.4.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tolis Moustaklis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mneme
|