Skip to content

How-to

Import an Obsidian vault

Bulk-import a markdown directory and (optionally) keep it live-synced.

You have an existing Obsidian vault (or any directory of markdown files). This recipe gets it into a memory in one shot, and — on Unix — keeps it live-synced as you edit.

Terminal window
quaid init ~/memory.db
quaid import ~/Documents/Obsidian --db ~/memory.db

import walks the directory, infers type from a PARA-style folder layout (project(s)/, area(s)/, resource(s)/, archive(s)/) when frontmatter doesn’t declare it, and writes one page per .md file. Numeric prefixes such as 1-projects/ are stripped before inference. SHA-256 idempotency means re-running on the same content is a no-op.

Terminal window
quaid import ~/Documents/Obsidian --validate-only --db ~/memory.db

Prints what would be written, with parse errors and frontmatter warnings, but doesn’t touch the database. Useful as a sanity check on a large vault before committing.

Attach the vault as a collection so the watcher follows your edits:

Terminal window
quaid collection add notes ~/Documents/Obsidian --writable
quaid serve # the watcher runs inside `serve`

While serve is running, the file watcher debounces edits (QUAID_WATCH_DEBOUNCE_MS, default 1500 ms) and reconciles them against file_state. Pages added, modified, or deleted on disk are reflected in the memory without re-running import.

See Manage collections for the full vault-sync surface.

import respects your existing frontmatter. Recognized fields:

  • title — required (falls back to first H1, then filename).
  • type — required (or inferable from path).
  • tags, summary, links, related — preserved. related may be a single string or a YAML list.

Unknown fields are stored verbatim in pages.frontmatter and round-tripped on export.

[[other-page]] links inside the body are parsed during import into links rows with source_kind = 'wiki_link'. They show up in memory_backlinks and the graph traversal as soon as the import completes.

  • You added new files: re-run import. SHA-256 dedup keeps unchanged pages untouched.
  • You moved files: re-run import with --validate-only first. Moved pages may need explicit slug remapping.
  • You’re using vault-sync: don’t re-import; the watcher handles it.

If you ever want to leave (or migrate to a new model — see Switch embedding models):

Terminal window
quaid export ~/Documents/Obsidian-export --db ~/memory.db
quaid export ~/Documents/Obsidian-export --raw --db ~/memory.db # byte-exact

--raw writes the original ingested bytes for every page (preserves frontmatter ordering and whitespace). Without it, the export is the canonicalized form.