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, visibility, source, review state, optional review_after and expires_at dates, 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.
Re-check
Use review_after when a memory should come back to the inbox after a date instead of staying trusted forever.
Expire
Use expires_at for temporary context that should leave default recall after a date while staying inspectable.
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 all-data loading for search/filtering.
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.
lnk benchmark "agent memory"
lnk graph-summary "local memory" --limit 40 --depth 1
lnk validate
lnk rebuild-backlinks
Use lnk benchmark when a wiki starts to feel slow. It reports cache time, persistent-cache reuse, search, query, graph payloads, backend, and readiness recommendations.