Skip to content

Mirror your Hjarni notes into an Obsidian vault

Hjarni is the AI-readable knowledge base. Obsidian is the offline-first vault. A one-way export keeps a mirror inside Obsidian.

Free to start. No credit card required.

What this unlocks

Workflows that actually use your context

Keep an offline Markdown mirror of your notes

Hjarni is hosted. A scheduled export to an Obsidian vault gives you a local Markdown mirror — open the laptop on a plane and the notes are still right there.

Use Obsidian's editor on Hjarni-managed notes

Read and search in Obsidian when that is the workflow you want. The mirror is one-way for now, so make changes in Hjarni — or treat the Obsidian copy as a scratch surface until you copy edits back through the API.

Use Obsidian's graph and plugins on a hosted knowledge base

Local graph view, Dataview queries, themes — Obsidian's plugin ecosystem is enormous. The mirror gives you Hjarni's MCP access without giving up Obsidian's local power tools.

Survive any one product going away

Hjarni's notes are Markdown. So are Obsidian's. The mirror is just a folder of .md files. If either product disappears, the other still has the notes.

Try Hjarni without giving up your vault

Coming from Obsidian? Run the regular import to move your vault into Hjarni once. The mirror script then sends a read-only copy back, so you can use Hjarni as the source of truth while Obsidian keeps showing the same notes locally.

Setup

Connect Obsidian in about two minutes

  1. 1

    Sign up for Hjarni and write a few notes — or import an existing vault from Settings → Import.

  2. 2

    Generate a personal API token at hjarni.com/account/api_tokens and store it in HJARNI_TOKEN.

  3. 3

    Create a Hjarni folder inside your Obsidian vault. The script writes one Markdown file per note into it.

  4. 4

    Save the script as ~/bin/hjarni-sync and schedule it: a cron entry like '*/15 * * * * ~/bin/hjarni-sync' refreshes the mirror every fifteen minutes.

  5. 5

    If you have more notes than one page of the API returns, wrap the curl call in a loop over the page parameter. The /docs/api page documents pagination.

Cron job pulling up to 100 Hjarni notes into a vault folder via the REST API

# Requires curl, jq, and a Hjarni API token in $HJARNI_TOKEN.
# One-way mirror: pulls one page of notes (up to 100 via per_page) and
# writes one Markdown file per note into ~/ObsidianVault/Hjarni/.
# For larger libraries, loop over the page parameter — see /docs/api.
VAULT="$HOME/ObsidianVault/Hjarni"
mkdir -p "$VAULT"
curl -s -H "Authorization: Bearer $HJARNI_TOKEN" \
  "https://hjarni.com/api/v1/notes?per_page=100" \
  | jq -c '.notes[]' \
  | while read -r note; do
      id=$(echo "$note" | jq -r .id)
      title=$(echo "$note" | jq -r .title | tr '/' '-')
      body=$(echo "$note" | jq -r .body)
      printf '%s\n' "$body" > "$VAULT/$id-$title.md"
    done

The mirror script calls Hjarni's REST API at https://hjarni.com/api/v1/notes and authenticates with a bearer token. Generate one at hjarni.com/account/api_tokens and export it as $HJARNI_TOKEN before the cron job runs.

Why use Obsidian as a mirror instead of the primary store

Obsidian's strength is local-first editing, a beautiful editor, and the plugin ecosystem. Its weak point for the AI workflow is the MCP server: there is no built-in one, and the community plugins require setup per machine, with no shared state between devices. Hjarni inverts that: the knowledge lives once, in the cloud, with a remote MCP server every AI client can read from.

Treating Obsidian as a one-way mirror gets you both: cloud-hosted knowledge that AI assistants reach over MCP, and a local Markdown vault you can read, search, and graph offline. If you stop using Hjarni, you still have the vault. If you stop using Obsidian, you still have the notes in Hjarni.

If you would rather move an existing vault into Hjarni instead, the regular import flow at /import/new accepts a ZIP of your Obsidian vault with folders, frontmatter, wiki-links, and attachments intact. Mirror and import solve different problems — mirror for ongoing read-only sync, import for a one-time move.

Common questions

Questions before you connect Obsidian

Is this two-way sync or one-way?

The script above is one-way: Hjarni → Obsidian. Two-way is doable with the same REST API (write changes from the vault back via PATCH /api/v1/notes/:id), but it is more careful work because you need a conflict policy. Start with one-way and add the reverse direction once you have a need.

What happens if I edit the same note in both places at once?

On a one-way pull, the next run overwrites the Obsidian copy with whatever is in Hjarni. Edit in Hjarni if you want the change to stick. If you want to edit in Obsidian, pause the script first, push the change back through the API, and then resume.

How is this different from importing my Obsidian vault?

Import is one-time: a ZIP of your vault becomes Hjarni notes, and from then on Hjarni is the source of truth. The mirror is ongoing: Hjarni stays the source of truth and Obsidian stays a read-only local copy.

Will wiki-links work in Obsidian after the mirror?

Not by default. Hjarni notes use [[id:Title]] wiki-links and the script writes raw note bodies, so Obsidian will see the literal [[42:My Note]] form. If you want clickable links inside Obsidian, add a small sed/awk step in the script to rewrite [[id:Title]] to [[Title]] before saving each file. Duplicate titles still need folder-qualified links.

Do I need an Obsidian plugin to make this work?

No. The script writes plain Markdown into a folder. Obsidian sees it the next time the vault is opened — no plugin, no configuration on the Obsidian side. Plugins like Templater or Dataview keep working on top.

Keep one source of truth, mirrored locally

Hjarni stays the place every AI assistant reads from. Obsidian holds the offline copy your editor and plugins love.

Write once. You both remember.

Free to start. No credit card required.

Give your AI a memory

Works with Claude and ChatGPT today. Gemini coming soon.