๐ง Memory Wiki Architecture
Overview
The Memory Wiki is a custom static site generator written in Python that converts flat markdown files with YAML frontmatter into a browsable HTML knowledge base. Designed for zero-maintenance operation โ content editing is just markdown in a git repo, and Cloudflare Pages handles deployment.
How It Works
Content Pipeline
- Source: Markdown files in
wiki/directory with YAML frontmatter - Parser: Python
markdownlibrary + manual YAML parsing - Renderer: Jinja2 templates generate static HTML pages
- Output: Flat HTML/CSS/JS files in
dist/directory - Deploy: Git push โ Cloudflare Pages auto-build โ global CDN
Build Process (generate.py)
The generator:
1. Cleans dist/ output directory
2. Walks wiki/ recursively, parsing all .md files
3. Extracts frontmatter (title, type, tags, dates) and body content
4. Builds session/entity/concept/daily data structures
5. Collects backlinks (pages that link to each page via wikilinks)
6. Generates a JSON search index for client-side Fuse.js
7. Renders templates:
- home: Hero section + stats bar + card grid + timeline
- subject_list: Entity/concept listing page
- subject_detail: Individual entity/concept page
- daily: Daily log listing with timeline
- daily_detail: Individual daily log page
- search: Fuse.js fuzzy search UI
- graph: D3.js interactive knowledge graph
8. Copies static assets from public/ recursively
URL Structure
All pages use clean URLs (no .html extensions) for Cloudflare Pages compatibility:
- / โ Homepage
- /subjects โ All entities and concepts
- /subjects/memory-wiki โ Specific entity page
- /daily โ Daily log listing
- /daily/2026-06-06 โ Specific daily log
- /search โ Client-side search
- /graph โ Knowledge graph
Key Design Decisions
| Decision | Rationale |
|---|---|
| Python over Node.js | esbuild crashes on Node v22 x86_64 |
{{ content }} over {% block %} |
Direct variable rendering for template.render() |
shutil.rmtree before build |
Prevents stale files from accumulating |
| Clean URLs | Cloudflare 308 redirects .html โ clean path |
| Single repo | Content + builder co-located simplifies CI/CD |
| Static site | No backend, no database, zero maintenance |
Client-Side Features
- Search: Fuse.js fuzzy matching on pre-generated JSON index
- Knowledge Graph: D3.js force-directed graph showing entity/concept connectivity
- Backlinks: Every page shows what links to it
- Breadcrumbs: Navigation trail visible on detail pages
Related
- memory-wiki entity
- mysticwolf6 user
- hermes-agent platform
- llm-wiki related concept