You already have an Obsidian vault stuffed with half-baked ideas, and you’re running an OpenClaw agent that lives on Slack. The missing piece is glue: you want to toss a thought into chat and have it land in the right Markdown file, complete with backlinks and a timestamp. This guide shows the exact wiring I use in production.
Why pair OpenClaw with Obsidian for PKM?
Obsidian is a local-first graph of Markdown files. OpenClaw is an event-driven AI agent that can read your chat, poke the filesystem, and run shell commands. Together they become a second brain that actually keeps up instead of another inbox you forget about.
- Offline ownership: your vault stays on disk, under Git.
- 800+ tool integrations via Composio if you want Google Calendar links, GitHub issue refs, etc.
- Full LLM context: OpenClaw can embed note content, search it semantically, and decide where to file new ideas.
Preparing the vault for external writes
1. Pick a predictable folder structure
Your agent needs deterministic paths. Mine looks like:
📂 vault/
├─ 📂 00-inbox/
├─ 📂 01-projects/
├─ 📂 02-references/
└─ 📂 99-daily/
Create 00-inbox/ if it doesn’t exist—this is where raw captures land.
2. Enable Obsidian’s Daily Notes core plugin
Settings → Core Plugins → Daily notes. Set the folder to 99-daily and filename format to YYYY-MM-DD. Our agent will append to that file.
3. Git tracking
Add a barebones .gitignore to ignore .obsidian/ (binary cache). You’ll appreciate versioning once the agent starts editing files.
Installing the OpenClaw Obsidian integration plugin
No official plug-and-play exists yet, but the community module openclaw-obsidian-fs (MIT-licensed) does 90% of the job. It’s a thin wrapper around Node’s fs/promises plus a handful of helper methods.
1. Upgrade Node and OpenClaw
# Node 22 is mandatory
nvm install 22
nvm use 22
# OpenClaw 2.7 or later has the new AgentFileSystem API
npm i -g openclaw@2.7.0
2. Scaffold a fresh agent
openclaw init my-knowledge-bot
cd my-knowledge-bot
Choose any LLM provider. I’m on gpt-4-o via OpenAI.
3. Add the Obsidian helper
npm i openclaw-obsidian-fs@0.3.1
Directory layout now contains clawfile.js. That’s your agent manifesto.
4. Mount the vault
Inside clawfile.js:
import { ObsidianFS } from 'openclaw-obsidian-fs';
const vaultPath = process.env.OBSIDIAN_VAULT || '/Users/peter/Notes/vault';
const obsidian = new ObsidianFS({ path: vaultPath });
export default {
tools: {
fs: obsidian // exposes readFile, writeFile, appendDaily, etc.
}
};
Give the daemon permission to access the folder. On macOS Ventura you’ll get the usual security dialog the first time the agent writes.
Creating, searching, and linking notes with OpenClaw
Agent prompts matter
OpenClaw agents behave like little REPLs. The system prompt defines how they reason about the vault. Mine:
You are a knowledge secretary. Always:
1. Search existing notes before creating a new one.
2. Use #tags and [[wikilinks]] sparingly—only if context exists.
3. Never delete user content.
1. Full-text + vector search
openclaw-obsidian-fs exposes search(text) which returns file paths ranked by cosine similarity (it uses a local MiniLM index so nothing leaves disk).
const matches = await tools.fs.search('distributed tracing');
Inside the agent you reference it as:
{% tool fs.search %} distributed tracing {% endtool %}
2. Creating a note
If similarity < 0.75, the agent calls writeFile:
await tools.fs.writeFile('01-projects/opentelemetry.md', content);
Include frontmatter for Obsidian metadata:
---
created: "{{timestamp}}"
source: "slack"
---
{{body}}
3. Linking suggestions
The agent runs tools.fs.listBacklinks(filePath) and proposes [[link]] insertions. I throttle to max 5 per note to avoid spam.
Automating the daily note with OpenClaw
Cron syntax
OpenClaw’s scheduler accepts cron-parser strings. In clawfile.js:
export default {
...,
schedules: [
{
cron: '0 6 * * *', // 06:00 local time
task: 'appendDailySummary'
}
],
tasks: {
async appendDailySummary(tools) {
const summary = await tools.llm.chat(`Summarize yesterday's inbox notes in three bullets`);
await tools.fs.appendDaily(`## Review\n${summary}\n`);
}
}
};
appendDaily creates the file if absent, so Obsidian opens it seamlessly when you start typing later.
Chat-to-vault capture workflow
This is the flow that finally made me stop emailing notes to myself.
- You send a direct message to your agent on Slack/Telegram:
idea "Inference speed drops when token > 6k. Investigate quantization." - OpenClaw receives the
message.newevent, strips theideakeyword, and callstools.fs.writeInbox(). - Every 30 minutes another scheduled task,
processInbox, clusters similar ideas and auto-merges them into project files. - Obsidian’s graph instantly shows the new nodes; if you’re running the app, it hot-reloads.
Code skeleton
export default {
...,
events: {
'slack.message.new': async ({ body }, tools) => {
if (!body.text.startsWith('idea')) return;
const idea = body.text.replace(/^idea\s+/, '');
await tools.fs.writeInbox(idea);
return `Captured: ${idea}`;
}
},
schedules: [
{ cron: '*/30 * * * *', task: 'processInbox' }
],
tasks: {
async processInbox(tools) {
const items = await tools.fs.readInbox();
for (const { text } of items) {
const { filePath, position } = await tools.agent.classifyAndFile(text);
await tools.fs.appendToFile(filePath, `\n${text}\n`, position);
}
await tools.fs.clearInbox();
}
}
};
The classifyAndFile helper uses embeddings + regex heuristics; tweak to taste.
Security and rollback
Letting an LLM write files sounds reckless. A few guardrails:
- Git commits per task: wrap every write in
git add -A && git commit -m "claw: $TASK". If the agent goes rogue,git revert. - Read-only mode toggle: env var
OBSIDIAN_RO. In company contexts you might block writes entirely. - Diff storytelling: post the
git diffback to Slack so you can eyeball changes.
Troubleshooting common snags
Agent can’t see the vault on macOS
Grant Full Disk Access to the terminal app running claw daemon. SIP sandboxing blocks Node otherwise.
CRLF vs LF line endings
If you edit notes on mobile (iOS Obsidian uses CRLF) you might get ugly diffs. Run git config core.autocrlf input in the vault.
Race conditions editing the same note
Obsidian holds a file lock only during write. The agent could collide if you’re typing simultaneously. Until a proper file watch integration exists, I’ve just trained myself to hit ⌘S often; Git will refuse to commit if timestamps changed mid-task.
Next step: clone the starter repo and personalize
I pushed the full template described above (MIT) at github.com/pspdfkit-labs/openclaw-obsidian-starter. Clone it, set OBSIDIAN_VAULT, and run:
claw daemon
Send yourself idea read Pat Helland’s "Immutability Changes Everything". Flip to Obsidian and watch the note appear. Iterate from there—most tweaks are prompt engineering, not code.