Relink

From tonydzi/second-brain-starter-kit · View interactive version

Relink is an AI agent skill from the GitHub repository tonydzi/second-brain-starter-kit. Weave a new node (concept, framework, theory, project, principle) into the whole vault graph rather than just creating a note. Mode A links one new node against the vault by top-K retrieval, with the LLM judging only those candidates; mode --deep finds orphaned islands and wires them in. Backup befo

How to use this skill

Skill file

/relink — wire the important stuff into the graph (don't just add a note)

🧒 When reporting to a non-technical operator: end with a child-simple "In plain words" recap in their language.

The principle (canon: concept-creation-rules.md §11): an important new idea that only exists as a note is an island, not part of the Second Brain. It must be integrated into the knowledge graph. Mirror of [[no-orphan-notes-rule]] (passive "≥1 inbound"); this is the active "maximize meaningful connectivity for important nodes" side.

Architecture law (from the DR): retrieval first → judgment second → writing last. The LLM never decides links by reading the whole vault; it gets a bounded, diverse candidate pool, then types relations and proposes edits. Less hallucination, explainable, repeatable.

What counts as "important" (don't run for every note)

A NEW: concept · mental model · framework · theory · term · project · philosophy · research cluster · personal principle · knowledge-organization system. Threshold = §1 of concept-creation-rules (≥3 recurrences, noun-entity, domain-bound). Routine notes → passive no-orphan check, not this.

⚠️ Token law — channels FIND, LLM JUDGES (never scan all 154k notes)

The operator's law ([[vault-data-architecture]]): cheap tools first; the LLM judges only the top-K.


Mode A — integrate ONE new node (default)

Input: the new note's path/name (or freshly pasted text → first save via obsidian-ingest, then relink).

1. Extract entities (cheap — read ONLY the new note)

List: canonical concepts · aliases/acronyms · key claims · related domains · possible parent/child concepts · candidate MOCs. (LLM + the note's own frontmatter; no vault scan.)

2. Gather candidates from 3 channels (NOT scan-all)

3. Fuse + rank P0–P3

Fuse the channels (RRF-style — don't add raw scores from different rankers). Soft ranking heuristic:

≈ 0.35·semantic + 0.20·lexical + 0.15·entity_overlap + 0.20·hub/MOC_fit + 0.10·freshness (zero freshness if evergreen).

No link without evidence. Low confidence → defer, don't write.

4. Type each accepted link (closed vocabulary)

defines · defined_by · extends · depends_on · contrasts · example_of · evidence_for · method_for · same_cluster · moc_member · see_also. Write it as a short gloss after the link: - [[Target]] — method_for: <one phrase why>.

5. Build the change-set (PREVIEW — don't write yet)

For each edit produce an internal record {path, target_type: heading|frontmatter, target: "Related", operation: append_once, text, dedupe_key: "source::target::relation"}.

6. Backup → apply (idempotent)

7. QA → reindex → report


Mode B — `--deep` (deep relink: whole vault → islands)

Monthly/on-command sweep over the ALREADY-COMPUTED orphan list (not a fresh full scan).

  1. python "$IMPORTS_ROOT/orphan-scan/orphan_scan.py" → refresh orphans.csv / orphans-by-folder.csv ([[vault-orphan-baseline]]).
  2. python "$IMPORTS_ROOT/orphan-scan/build_dashboard.py" → $OBSIDIAN_VAULT/_Dashboards/Vault-Orphans.html (the operator works by eye).
  3. Also surface: orphan clusters · missing MOC membership · alias gaps · high-centrality notes (high incoming_counts) without a hub · stale MOCs. Run top island clusters through Mode A steps 2–7. Loop-until-dry (stop at intentional orphans: archives, raw originals).
  4. Dupes/near-dupes found → hand to skill dedup (don't merge here).
  5. New MOC may be proposed here for a stable 5+ note cluster with no hub. Report what got woven in + what was deliberately left.

Mode C — relink a whole THEME / topic cluster ("relink everything about X")

Between A and B: the operator names a TOPIC, not one note. Run Mode A steps 2–7 with the THEME's entities as the query (RAG + namesearch + grep on theme terms → judge top-K). Then, before proposing links:

1. Import-corpus MOC — holds the operator's OWN raw data (TG export, email archive) e.g. _Health-MOC, _Perepiska-s-Ottsom-MOC

2. Thematic 90_MOCs/ MOC — holds external/field knowledge, parent MOC-index e.g. MOC-Biohacking-Longevity, MOC-Family-Life

3. Identity-layer _Self-Bible-MOC — holds the "this is who I am" view (cofounder of digital twin) e.g. PhD-as-scholar, family-as-influence

Safety (hard gates)

Rejected complications (don't re-pitch — see [[relink-mechanism]] / [[declined-decisions]])

The DR suggested, and we declined for AK-47: a Local REST API + MCP plugin (Edit targets sections fine), a new vector DB (have e5+reranker), spaCy 3-layer NER (LLM+namesearch suffice), a JSON-schema validation runtime, and a full link-adjacency graph engine (hub counts are enough for v1).

See also

<!--kit-footer-->


Like this skill? It is part of second-brain-starter-kit: the second brain we built for ourselves and run every day at Palo Alto AI Research Lab. Install the whole set with npx skills add tonydzi/second-brain-starter-kit. Everything is open source and free, so take what you need.

Flagships worth a look on their own: secondop-panel (a second opinion from a panel of external models), claude-memory-tidy (stop your agent's memory from rotting), telegram-mcp-kit (your own Telegram over MCP in about 15 minutes).

Author: Anton Dziatkovskii, Palo Alto AI Research Lab. Telegram @tonydzi - WhatsApp +1 341 222 9178 - X @Tony_Stef_

Engineers: want to test-drive this setup? Message me. I hand out free starter seeds to engineers who test and report back, and custom skill requests are welcome.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.