Backlinks: which other notes should this note link to

Date: 2026-10-03  ·  Code: backlinks/backlinks.mjs  ·  Model: typesafe-ai/jev through the Vercel AI Gateway

1. What Jev decides

For each markdown note in a folder, which one other note the reader should open next, or none. One choice question per note. Every other note is an option; its title is the option name and its first line (cut to 160 characters) is the rubric. Notes the note already links to are left out. Jev returns a probability for each option; the three best at probability 0.15 or more become suggestions. The script writes backlinks/report.md and never edits a note.

2. The questions

The settings, from the top of backlinks.mjs.

// ---- Review these. Everything else is plumbing. ----
const MAX_NOTES = 255;     // Jev accepts 255 options; ponytail: run per sub-folder when a vault is larger
const NOTE_CHARS = 1500;   // characters of the note sent as the question
const DESC_CHARS = 160;    // characters of each other note sent as its option description
const MIN_P = 0.15;        // a suggestion needs at least this probability
const INSTRUCTIONS = "Which one other note is the most useful for the reader of this note to open next? Pick none if no note is closely related.";

3. Run it

node --env-file=.env backlinks/backlinks.mjs C:/path/to/notes --top 3
node --env-file=.env backlinks/backlinks.mjs --check

The note text goes to the gateway. The report is in .gitignore because it can contain your note titles.

4. The check, verbatim

sourdough starter → [["baking bread",0.99]]
kubernetes pods → [["docker containers",0.99]]
ok: both known pairs link

The check writes six synthetic notes to a temporary folder: sourdough starter, baking bread, kubernetes pods, docker containers, tomato gardening, cat care.

5. Findings

The check ran once on one machine on 2026-10-03 through the Vercel AI Gateway.