Storage Layers
raw sources -> agent ingest -> Markdown wiki -> backlinks/graph -> MCP recall
\
-> direct memories -> review/update/archive
raw/, wiki/, and link-demo/ content out of git. The tracked root wiki is scaffolding; python3 link.py demo creates the product-story demo wiki.
Markdown remains the source of truth. Derived indexes can be rebuilt. Agents maintain the files, but the files stay inspectable in git, Obsidian, or any editor.
Three User Moves
Link deliberately separates knowledge from memory:
ingest raw/file.md into Link
remember that I prefer short release notes
query Link for the release process
Raw files do not silently personalize future agents. Ingest creates source-backed wiki knowledge. Explicit remember creates durable user or project memory.
Memory Lifecycle
A memory is a Markdown page with status, scope, source, review state, graph links, and local log entries. It can be proposed, remembered, reviewed, updated, archived, restored, explained, or forgotten.
Propose
Generate candidate memories from chat notes or raw captures without writing durable memory.
Approve
Save only the memories the user explicitly wants agents to carry forward.
Explain
Show why a memory exists, whether it is recall-ready, and what graph links support it.
Smart Query Packets
query_link is designed for agents. It returns a compact packet with relevant memory, ranked wiki pages, graph context, provenance, budget reports, estimated size, and follow-up actions.
Budget tiers keep context predictable:
small: fast, compact context for most questions.medium: more memory and page context for active tasks.large: broader context when the agent needs to plan or compare.
Graph Context
Link builds forward and reverse wikilinks so agents can inspect what links to a page and what that page references. Large graphs open as bounded overviews first, with explicit controls for type filters, search, neighborhood depth, and full-graph loading.
Scale Model
Link uses local caching, token indexes, bounded page APIs, bounded graph summaries, and optional in-memory SQLite FTS5 for fast search. If SQLite is unavailable, Link falls back to the token index.
link benchmark "agent memory"
link graph-summary "local memory" --limit 40 --depth 1
link validate
link rebuild-backlinks
Use link benchmark when a wiki starts to feel slow. It reports cache, search, query, graph payload, backend, and readiness recommendations.