AI coding agent embedded in your Obsidian vault. Get intelligent assistance for reading, writing, editing, and searching your notes — with full agentic capabilities including file operations, bash commands, and multi-step workflows.
- 🤖 Multi-Provider LLM Support — Anthropic Claude, OpenAI GPT, Google Gemini, Groq, OpenRouter, and any OpenAI-compatible endpoint (Ollama, LM Studio, etc.)
- 📁 Vault-Aware Tools — Read, write, edit, and search files within your vault with full context awareness
- 💻 Bash Execution — Run shell commands with configurable safety blocklist
- 🔍 Smart Search — Grep and find across your entire vault
- 🧠 Thinking Modes — Adjustable reasoning levels (off, minimal, low, medium, high)
- 📎 File Context — Attach files as context with @mention, auto-detect active note
- 💬 Conversation History — Persistent chat sessions with easy switching
- 🎨 Streaming UI — Real-time token streaming with thinking visualization and tool execution feedback
- Download the latest release from the Releases page
- Extract to your Obsidian vault:
.obsidian/plugins/obsidian-agent/ - Enable the plugin in Obsidian Settings → Community Plugins
# Clone the repository
git clone https://github.com/Sailfishc/obsidian-agent.git
cd obsidian-agent
# Install dependencies
pnpm install
# Build
pnpm run build
# Copy to Obsidian vault
cp main.js manifest.json styles.css /path/to/your/vault/.obsidian/plugins/obsidian-agent/- Click the bot icon in the left ribbon
- Use the command palette:
Obsidian Agent: Open chat view - Use the command:
Obsidian Agent: New chat
| Command | Description |
|---|---|
Read file.md |
Read and analyze a file |
Edit file.md to... |
Modify file contents |
Create file.md with... |
Create a new file |
Search for "keyword" |
Grep across vault |
Find all *.md files |
Find files by pattern |
Run ls -la |
Execute bash command |
- Active Note: Automatically attached when you start a chat (shown as a pill above input)
- @mention: Type
@to attach additional files or folders as context - Remove Context: Click the × on any context pill
| Shortcut | Action |
|---|---|
Enter |
Send message |
Shift+Enter |
New line |
Escape |
Cancel streaming |
-
Go to Settings → Obsidian Agent
-
Select your provider:
- Anthropic — Claude models (recommended)
- OpenAI — GPT-4, GPT-3.5
- Google — Gemini models
- Custom OpenAI — Ollama, LM Studio, or any OpenAI-compatible API
-
Enter your API key (or set environment variables like
ANTHROPIC_API_KEY)
For local models (Ollama, LM Studio, etc.):
- Select Custom OpenAI as provider
- Set Base URL:
http://localhost:11434/v1(Ollama) orhttp://localhost:1234/v1(LM Studio) - Set Model ID: Your model name (e.g.,
llama3.2,qwen2.5-coder) - API Key can be left empty for local endpoints
Adjust reasoning depth:
- Off — No thinking, fastest response
- Minimal — Brief reasoning
- Low — Quick analysis
- Medium — Balanced (default)
- High — Deep reasoning
Block dangerous bash commands. Default blocked:
rm -rfchmod 777chmod -R 777
Add more commands in settings.
Alternatively, set API keys via environment variables:
export ANTHROPIC_API_KEY=sk-...
export OPENAI_API_KEY=sk-...
export GOOGLE_API_KEY=...
export GROQ_API_KEY=...# Install dependencies
pnpm install
# Development watch mode
pnpm run dev
# Production build
pnpm run build
# Type checking
pnpm run typecheck
# Run tests
pnpm test
# Test watch mode
pnpm run test:watchUse the provided deploy script (update VAULT_PATH first):
./deploy.shOr manually copy build artifacts:
cp main.js manifest.json styles.css /path/to/vault/.obsidian/plugins/obsidian-agent/Then reload Obsidian: Cmd+R (macOS) or Ctrl+R (Windows/Linux).
Built on pi-mono libraries:
@mariozechner/pi-agent-core— Stateful agent with tool execution@mariozechner/pi-ai— Multi-provider LLM streaming@mariozechner/pi-coding-agent— Coding tools (read, write, edit, bash, grep, find, ls)
src/
├── main.ts # Plugin entry point
├── core/
│ ├── agent/
│ │ └── AgentService.ts # pi-mono Agent wrapper
│ ├── tools/
│ │ └── vaultTools.ts # Vault-scoped tools
│ ├── prompts/
│ │ └── systemPrompt.ts # System prompt builder
│ ├── security/
│ │ └── blocklist.ts # Bash command filtering
│ └── storage/
│ └── ConversationStore.ts # Conversation persistence
└── features/
├── chat/
│ ├── ChatView.ts # Main chat UI
│ ├── rendering/ # Stream and message rendering
│ └── ui/ # Input, context pills, conversation list
└── settings/
└── SettingsTab.ts # Settings UI
MIT License — see LICENSE for details.
