Knowledge Engineering · 2026 · Solo build

WikiWeave

Your Markdown vault's hidden connections — found by a browser-local TF-IDF engine and written into your actual files with one click.

The problem

Personal knowledge bases fragment over time. You write a note about transformer attention and separately note recurrent state compression but never realize the connection until you've written both five times. Manual cross-referencing at scale is infeasible. AI-based linkers require cloud uploads or plugins. WikiWeave reads your actual local Markdown files via the File System Access API, computes TF-IDF cosine similarity for every note pair in-browser without uploading anything, renders the connection landscape as an interactive force-directed graph, and writes confirmed [[wikilinks]] directly into your source files — a consequential, file-level change, not a report or export.

Architecture

Key decisions

01

Custom TF-IDF engine from first principles

No external NLP or embedding libraries. Tokenisation strips frontmatter delimiters, heading syntax, code fence blocks, existing wikilinks, and a 200-word stop list, then lowercases and normalises. IDF is computed across the whole corpus before any per-note TF-IDF vector. Cosine similarity is a sparse dot-product — only terms present in both documents are multiplied, keeping the O(n²) pass tractable for 200–500 notes without WebWorker threads.

02

Chunked similarity via requestIdleCallback

All-pairs O(n²) similarity over 400 notes is ~80,000 comparisons. Running it synchronously blocks the main thread for hundreds of milliseconds. Instead, pairs are batched into 50-comparison idle callbacks. The UI shows a live progress indicator and the graph begins rendering as soon as the first batch completes. This keeps the app responsive without the complexity of a shared-memory Worker and Atomics.

03

File System Access API write-back with exact offset management

Confirmed links are written into the source .md file by opening a FileSystemFileHandle writable stream, reading existing content, and appending a blank-line-guarded [[TargetNote]] wikilink at the end. The implementation checks for existing links before writing to prevent duplicates, and uses streaming writes rather than in-memory replace to avoid corrupting surrounding content. This is a real file mutation — the user's knowledge base changes, not a UI state update.

04

Explore surface — connection discovery is non-linear

The primary interaction is exploring an emergent graph, not submitting a form or inspecting a single result. Nodes are freely draggable, edges are filterable by similarity threshold, and the user confirms links one at a time. This is an Explore surface: the value is in the discovery itself, and the graph layout must make clusters and isolated notes equally legible.

Metrics

31
TDD unit tests across tokenizeMarkdown, computeIdf, computeTfIdf, cosineSimilarity, rankSimilarPairs, insertWikilink, buildCorpus — all written before implementation
0
external NLP or embedding libraries — custom TF-IDF from first principles
0
server calls — all analysis and write-back run in the browser
0
bytes uploaded — File System Access API reads files locally without copying them