Initial open source release

This commit is contained in:
tv5171621-source
2026-06-15 02:47:14 +03:00
commit 5c59152c06
44 changed files with 1640 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
# Apple Vision OCR
On macOS, Mnemazine can use Apple's Vision framework for local OCR.
Compile:
```bash
swiftc -O skills/mnemazine/vision-ocr.swift -o .mnemazine/bin/vision-ocr
```
Run:
```bash
.mnemazine/bin/vision-ocr path/to/image.png
```
The OCR output is raw material. It should be refined before entering the vault.
+45
View File
@@ -0,0 +1,45 @@
# Architecture
Mnemazine has five layers.
## 1. Inbox
Raw files enter through `inbox/`.
Examples:
- screenshots;
- PDFs;
- exported web pages;
- markdown notes;
- transcripts;
- links saved as `.md` files.
## 2. Extraction
Extraction is local-first:
- direct text read;
- MarkItDown;
- Apple Vision OCR;
- Whisper;
- custom parsers.
Extraction is not knowledge yet.
## 3. Refinement
The agent or workflow decides:
- what the source is about;
- whether it contains one topic or many;
- which claims need external verification;
- which notes already exist and should be updated.
## 4. Vault
The vault contains finished knowledge. It is Obsidian-compatible markdown.
## 5. Graph And Reports
Graphify builds relationship maps. Weekly HTML reports make the memory readable and actionable.
@@ -0,0 +1,32 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720">
<rect width="1280" height="720" fill="#f8fafc"/>
<rect x="72" y="72" width="1136" height="576" rx="28" fill="#fff" stroke="#e5e7eb"/>
<text x="104" y="132" font-family="-apple-system,Segoe UI,sans-serif" font-size="42" font-weight="700" fill="#111827">Mnemazine: from raw input to memory</text>
<g font-family="-apple-system,Segoe UI,sans-serif">
<rect x="104" y="198" width="190" height="130" rx="14" fill="#ffffff" stroke="#d0d5dd"/>
<text x="128" y="246" font-size="24" font-weight="700" fill="#0039a6">Inbox</text>
<text x="128" y="282" font-size="17" fill="#475467">screenshots, PDFs,</text>
<text x="128" y="306" font-size="17" fill="#475467">links, transcripts</text>
<path d="M304 263h92" stroke="#0039a6" stroke-width="5" stroke-linecap="round"/>
<path d="M388 250l18 13-18 13" fill="none" stroke="#0039a6" stroke-width="5"/>
<rect x="416" y="198" width="190" height="130" rx="14" fill="#ffffff" stroke="#d0d5dd"/>
<text x="440" y="246" font-size="24" font-weight="700" fill="#0039a6">Extract</text>
<text x="440" y="282" font-size="17" fill="#475467">local OCR, parsers,</text>
<text x="440" y="306" font-size="17" fill="#475467">hash cache</text>
<path d="M616 263h92" stroke="#d52b1e" stroke-width="5" stroke-linecap="round"/>
<path d="M700 250l18 13-18 13" fill="none" stroke="#d52b1e" stroke-width="5"/>
<rect x="728" y="198" width="190" height="130" rx="14" fill="#ffffff" stroke="#d0d5dd"/>
<text x="752" y="246" font-size="24" font-weight="700" fill="#d52b1e">Verify</text>
<text x="752" y="282" font-size="17" fill="#475467">sources, GitHub,</text>
<text x="752" y="306" font-size="17" fill="#475467">official docs</text>
<path d="M928 263h92" stroke="#0039a6" stroke-width="5" stroke-linecap="round"/>
<path d="M1012 250l18 13-18 13" fill="none" stroke="#0039a6" stroke-width="5"/>
<rect x="1040" y="198" width="120" height="130" rx="14" fill="#ffffff" stroke="#d0d5dd"/>
<text x="1064" y="246" font-size="24" font-weight="700" fill="#111827">Vault</text>
<text x="1064" y="282" font-size="17" fill="#475467">final</text>
<text x="1064" y="306" font-size="17" fill="#475467">notes</text>
<rect x="162" y="420" width="956" height="96" rx="16" fill="#f9fafb" stroke="#e5e7eb"/>
<text x="196" y="462" font-size="23" font-weight="700" fill="#111827">Rule</text>
<text x="196" y="496" font-size="21" fill="#344054">Raw OCR never becomes memory until it is understood, checked, and rewritten.</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720">
<rect width="1280" height="720" fill="#f8fafc"/>
<rect x="0" y="0" width="1280" height="160" fill="#fff"/>
<rect x="0" y="160" width="1280" height="150" fill="#0039a6"/>
<rect x="0" y="310" width="1280" height="110" fill="#d52b1e"/>
<text x="72" y="118" font-family="-apple-system,Segoe UI,sans-serif" font-size="64" font-weight="800" fill="#111827">Mnemazine Weekly</text>
<text x="76" y="230" font-family="-apple-system,Segoe UI,sans-serif" font-size="28" fill="#ffffff">Readable weekly memory, not a raw changelog</text>
<g font-family="-apple-system,Segoe UI,sans-serif">
<rect x="72" y="470" width="340" height="172" rx="12" fill="#fff" stroke="#e5e7eb"/>
<text x="96" y="510" font-size="22" font-weight="700" fill="#111827">Local OCR before vision</text>
<text x="96" y="548" font-size="17" fill="#475467">Cheaper extraction. Stable cache.</text>
<rect x="96" y="590" width="82" height="34" rx="7" fill="#fff" stroke="#0039a6"/><text x="114" y="612" font-size="14" fill="#0039a6">Read</text>
<rect x="190" y="590" width="82" height="34" rx="7" fill="#fff" stroke="#d52b1e"/><text x="208" y="612" font-size="14" fill="#d52b1e">Work</text>
<rect x="284" y="590" width="82" height="34" rx="7" fill="#fff" stroke="#98a2b3"/><text x="302" y="612" font-size="14" fill="#475467">Forget</text>
<rect x="470" y="470" width="340" height="172" rx="12" fill="#fff" stroke="#e5e7eb"/>
<text x="494" y="510" font-size="22" font-weight="700" fill="#111827">Graph after ingest</text>
<text x="494" y="548" font-size="17" fill="#475467">New notes become navigable context.</text>
<rect x="494" y="590" width="82" height="34" rx="7" fill="#111827"/><text x="512" y="612" font-size="14" fill="#fff">Read</text>
<rect x="868" y="470" width="340" height="172" rx="12" fill="#fff" stroke="#e5e7eb"/>
<text x="892" y="510" font-size="22" font-weight="700" fill="#111827">Split long guides</text>
<text x="892" y="548" font-size="17" fill="#475467">One source can become many notes.</text>
<rect x="892" y="590" width="82" height="34" rx="7" fill="#fff" stroke="#0039a6"/><text x="910" y="612" font-size="14" fill="#0039a6">Read</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720">
<rect width="1280" height="720" fill="#ffffff"/>
<text x="72" y="98" font-family="-apple-system,Segoe UI,sans-serif" font-size="46" font-weight="800" fill="#111827">Graphify memory map</text>
<g stroke-width="3" stroke="#d0d5dd">
<line x1="318" y1="310" x2="528" y2="220"/><line x1="318" y1="310" x2="560" y2="430"/><line x1="528" y1="220" x2="780" y2="262"/><line x1="560" y1="430" x2="818" y2="450"/><line x1="780" y1="262" x2="818" y2="450"/><line x1="780" y1="262" x2="970" y2="330"/>
</g>
<g font-family="-apple-system,Segoe UI,sans-serif" font-size="18" font-weight="700">
<circle cx="318" cy="310" r="70" fill="#0039a6"/><text x="274" y="316" fill="#fff">OCR</text>
<circle cx="528" cy="220" r="82" fill="#f8fafc" stroke="#0039a6" stroke-width="4"/><text x="474" y="226" fill="#111827">Extraction</text>
<circle cx="560" cy="430" r="86" fill="#f8fafc" stroke="#d52b1e" stroke-width="4"/><text x="506" y="436" fill="#111827">Atomization</text>
<circle cx="780" cy="262" r="74" fill="#d52b1e"/><text x="742" y="268" fill="#fff">Sources</text>
<circle cx="818" cy="450" r="78" fill="#f8fafc" stroke="#0039a6" stroke-width="4"/><text x="772" y="456" fill="#111827">Skills</text>
<circle cx="970" cy="330" r="84" fill="#111827"/><text x="918" y="336" fill="#fff">Agents</text>
</g>
<text x="72" y="650" font-family="-apple-system,Segoe UI,sans-serif" font-size="24" fill="#475467">Graph context lets agents retrieve related knowledge without reading the whole vault.</text>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,27 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720">
<rect width="1280" height="720" fill="#f8fafc"/>
<text x="72" y="96" font-family="-apple-system,Segoe UI,sans-serif" font-size="48" font-weight="800" fill="#111827">Website ingestion</text>
<g font-family="-apple-system,Segoe UI,sans-serif">
<rect x="72" y="150" width="260" height="380" rx="14" fill="#fff" stroke="#e5e7eb"/>
<text x="104" y="205" font-size="28" font-weight="700" fill="#0039a6">Discover</text>
<text x="104" y="252" font-size="20" fill="#475467">robots.txt</text>
<text x="104" y="292" font-size="20" fill="#475467">sitemap.xml</text>
<text x="104" y="332" font-size="20" fill="#475467">same-origin links</text>
<rect x="394" y="150" width="260" height="380" rx="14" fill="#fff" stroke="#e5e7eb"/>
<text x="426" y="205" font-size="28" font-weight="700" fill="#d52b1e">Extract</text>
<text x="426" y="252" font-size="20" fill="#475467">title</text>
<text x="426" y="292" font-size="20" fill="#475467">headings</text>
<text x="426" y="332" font-size="20" fill="#475467">visible text</text>
<text x="426" y="372" font-size="20" fill="#475467">GitHub links</text>
<rect x="716" y="150" width="260" height="380" rx="14" fill="#fff" stroke="#e5e7eb"/>
<text x="748" y="205" font-size="28" font-weight="700" fill="#0039a6">Refine</text>
<text x="748" y="252" font-size="20" fill="#475467">meaning</text>
<text x="748" y="292" font-size="20" fill="#475467">verification</text>
<text x="748" y="332" font-size="20" fill="#475467">atom notes</text>
<rect x="1038" y="150" width="170" height="380" rx="14" fill="#111827"/>
<text x="1070" y="205" font-size="28" font-weight="700" fill="#fff">Vault</text>
<text x="1070" y="252" font-size="20" fill="#fff">final</text>
<text x="1070" y="292" font-size="20" fill="#fff">knowledge</text>
<path d="M342 340h40" stroke="#0039a6" stroke-width="5"/><path d="M664 340h40" stroke="#d52b1e" stroke-width="5"/><path d="M986 340h40" stroke="#0039a6" stroke-width="5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+20
View File
@@ -0,0 +1,20 @@
# Graphify
Install:
```bash
python3 -m pip install graphifyy
```
Update graph:
```bash
graphify update ~/Desktop/Mnemazine/vault
```
Graphify helps Mnemazine:
- find related notes;
- detect clusters;
- avoid duplicate concepts;
- build graph-aware context for agents.
+42
View File
@@ -0,0 +1,42 @@
# Installation
Install into one folder:
```bash
git clone https://github.com/7teenno1-art/Mnemazine.git "$HOME/Desktop/Mnemazine"
cd "$HOME/Desktop/Mnemazine"
bash install.sh
```
The installer creates:
- `inbox/`;
- `vault/`;
- `reports/`;
- `.mnemazine/cache/`;
- `.mnemazine/state/`;
- `.mnemazine/bin/`.
Open `vault/` in Obsidian.
## macOS
On macOS, the installer tries to compile Apple Vision OCR:
```bash
swiftc -O skills/mnemazine/vision-ocr.swift -o .mnemazine/bin/vision-ocr
```
If this fails, install Xcode Command Line Tools:
```bash
xcode-select --install
```
## Python
Python dependencies are installed into `.venv/`. This keeps the system local to the Mnemazine folder.
## Agent Skills
If Codex or Claude skill folders exist, the installer copies portable skills there. If they do not exist, nothing breaks.
+18
View File
@@ -0,0 +1,18 @@
# Obsidian
Open this folder as an Obsidian vault:
```text
~/Desktop/Mnemazine/vault
```
Recommended folders:
- `00 System`;
- `01 Concepts`;
- `02 Tools`;
- `03 Agents`;
- `04 Projects`;
- `99 Archive`.
Mnemazine notes are plain markdown. Obsidian is optional, but useful for backlinks, search, and manual editing.
+26
View File
@@ -0,0 +1,26 @@
# Website Ingestion
Run:
```bash
node scripts/mnemazine-ingest-site.mjs --url https://example.com --apply --graphify --max-pages 40
```
The parser discovers pages through:
- `robots.txt`;
- sitemap links;
- `sitemap.xml`;
- same-origin links on the seed page.
For every page it extracts:
- title;
- headings;
- visible text;
- GitHub links;
- source URL.
The output is a markdown note with verification status. The note is not considered perfect final knowledge until it is reviewed and split if needed.
Authentication is intentionally excluded from the default parser. Public open-source users should not leak browser sessions, cookies, or private dashboards into a knowledge pipeline.
+41
View File
@@ -0,0 +1,41 @@
# Token Economics
Mnemazine reduces token use by keeping repeated, mechanical, and already-known work outside the model context.
## Local Work Costs Zero Model Tokens
These operations can happen without LLM calls:
- file listing;
- hashing;
- duplicate detection;
- OCR;
- PDF extraction;
- transcription;
- graph update;
- quality gate checks.
## Hash Cache
Every inbox file receives a SHA-256 hash. If the same file appears again, Mnemazine can skip it.
## Atomization
A long guide often contains many unrelated ideas. Storing it as one giant note forces future prompts to read too much. Splitting it into atoms lets an agent retrieve only the relevant part.
## Graphify Retrieval
Graphify helps retrieve related context through graph structure. That is cheaper than placing a whole vault into a prompt.
## Final Notes
Final notes are smaller than raw OCR because they remove:
- duplicate text;
- navigation;
- boilerplate;
- broken OCR;
- irrelevant screenshots;
- repeated introductions.
The result is a vault that becomes cheaper to query over time.
+23
View File
@@ -0,0 +1,23 @@
# Weekly HTML Brief
Generate:
```bash
node scripts/mnemazine-weekly-brief-html.mjs
```
The report appears in:
```text
~/Desktop/Mnemazine/reports
```
The default report language is Russian because the first public release was designed around Russian reading flow. The template can be localized.
Card states:
- `Прочитал` means keep the note;
- `В работу` means convert the note into an action;
- `Забыть` means remove or archive it.
The browser stores state locally.