Obsidian
An Obsidian vault is a folder of Markdown files, so each note can go into the brain as one capture.
Frontmatter, tags and [[links]] stay in the text, and the brain reads them along with the rest of the
note when it decides which pages to connect.
What the script does
- Reads every note. It skips
.obsidian,.trashand other hidden folders, empty notes, and files that aren’t UTF-8 text. It lists any file it skips. - Labels each capture with the note’s path, such as
Projects/Launch plan, so every page shows which notes it came from. - Splits long notes. A note over 50,000 characters is cut at paragraph breaks into parts.
- Sets an
originReffrom the note’s path and a hash of its text. On a later run, the brain skips notes you haven’t changed and recompiles the ones you have.
It needs Python 3.9 or later, or Node 20.12 or later, and no packages.
Save the script
Copy one version into a file on your computer.
Run the import
Find the brain ID
List your brains and copy the id of the one to import into. To keep the vault separate from
everything else, create a new brain for it first.
Preview the import
Set your API key, then list what the script would send, without sending it:
In Windows PowerShell, set the key with $env:LIVING_BRAIN_API_KEY = "YOUR_API_KEY". If your API
key isn’t tied to one subject, also set LIVING_BRAIN_SUBJECT_ID. See
Authentication.
Pages appear over the next few minutes while the brain compiles. To find captures that failed, list the brain’s sources.
Keep the brain up to date
Run the script again whenever you like, by hand or on a schedule. The brain compiles only notes it hasn’t seen in their current form.
Renaming a note changes its path, so the brain treats it as a new note. The pages compiled from the old name stay until you remove them.
Attachments
The script reads only Markdown files, so images, PDFs and other attachments stay in the vault. To add a PDF, Word or PowerPoint file, send it by link. See Files and documents.