Obsidian Cards bulk ingest — 2026-07-05

Concept Search related

Obsidian Cards bulk ingest — 2026-07-05

What happened

User asked to ingest the ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/Digital Mind/Cards/ corpus (6,419 files; 4,270 MD + 1,444 HTML-only + scattered) into gbrain. After a 4-card cherry-pick that revealed ~25% of well-chosen cards were duplicates of existing brain pages, the user said: "go for full bulk option 3... ingest the files you think provide interesting context... don't worry about the flashcards, don't worry about HTML files, preserve citations and verify them, eliminate duplicates and redundancy, combine concepts if they think they overlap."

What was built

A deterministic Python sensor at ~/.hermes/scripts/obsidian_cards_to_brain.py (~430 lines) that:

  1. Walks all *.md files in the Cards corpus
  2. Skips course flashcards (per user directive — Uni/, flashcards/ tags) and date-prefixed journal entries (coaching session notes belong in calendar/scratchpad, not the brain)
  3. Strips Dataview queries (Obsidian-only, per user directive)
  4. Extracts @-citation anchors and preserves them in the inbox frontmatter as citation_anchors
  5. Detects overlap with existing brain pages via title-substring match; if found, marks the card as REDIRECT (writes a redirect stub with redirect_to: pointing to the canonical brain page)
  6. Writes to ~/brain/inbox/obsidian-cards/<slug>.md with frontmatter (source, title, aliases, tags, edited, date, citation_anchors, redirect_to) + body (Dataview-stripped, citations preserved as @citekey wikilinks)

A cron job (obsidian_cards_to_brain, id 11f29cb1a52e, every 6h) was registered for re-runs. State at ~/.hermes/profiles/build/state/sensors/obsidian_cards_to_brain.json is idempotent — re-runs skip already-processed cards.

The bulk run results (single execution, 2026-07-05T11:07:39Z)

| Outcome | Count | What it means | |---|---|---| | Wrote | 2,059 | Card had no brain overlap → wrote full body content to inbox | | Redirected | 609 | Card's title overlapped an existing brain page → wrote redirect stub with redirect_to: pointing to the canonical page (preserves wikilink chain) | | Skipped | 1,602 | Course flashcards (Uni/LFS, Uni/MBT, etc.) + date-prefixed coaching journals + empty-after-Dataview-strip + too-short (<200 chars) | | Failed | 0 | 100% success rate | | Total processed | 4,270 | All 4,270 source MD files processed |

The 22% redirect rate matches the cherry-pick prediction — the user has been writing atomic notes for 4+ years; the gbrain has 6 months of capture, so significant overlap was expected.

Citation preservation (verified)

What was registered to gbrain

After the inbox writes, ran gbrain put <slug> < file.md for all 2,664 files in parallel (4 workers, ~5.0 files/sec, 0 failures over ~9 min total). Verified state in gbrain.pages:

The dream cycle's next run will see these 2,664 inbox files and promote them. The 609 redirects will get their redirect_to: field honored during synthesis (the dream cycle reads the frontmatter redirect_to and treats the page as a duplicate-resolution pointer).

What this means for retrieval

Once the dream cycle promotes the inbox files:

What I did NOT do (per user directives)

Operational rules for future runs

Source