No description
Find a file
2026-07-12 15:39:07 +01:00
.github/workflows chore: add --legacy-peer-deps flag to release workflow 2026-05-17 13:54:32 +01:00
__mocks__ Implement local model support. 2026-07-04 12:16:08 +01:00
__tests__ refactor(ChatArea): extract message rendering into separate components 2026-07-11 14:04:19 +01:00
AIClasses feat: add artifact tracking system for agent file operations 2026-07-10 21:23:44 +01:00
AIPrompts Implement local model support. 2026-07-04 12:16:08 +01:00
Assets Compress plugin banner. 2026-06-01 00:30:39 +01:00
Components style: add smooth transition to artifact ellipse hover effect 2026-07-12 15:39:07 +01:00
Conversations feat: add file change summary cards to assistant messages 2026-07-11 13:49:44 +01:00
Enums feat: add artifact diff viewer and improve button styling 2026-07-12 15:14:44 +01:00
Helpers refactor: improve settings UI with icon grids and standardized helpers 2026-07-04 13:27:22 +01:00
Modals fix: adjust help modal banner position and hide overflow on mobile 2026-07-06 19:49:01 +01:00
Services feat: add artifact diff viewer and improve button styling 2026-07-12 15:14:44 +01:00
Stores refactor: convert ChatMode enum to string literals and improve state management 2026-05-05 20:54:34 +01:00
Styles feat: add artifact diff viewer and improve button styling 2026-07-12 15:14:44 +01:00
Types feat: add plan approval UI with user review workflow 2026-07-06 16:11:30 +01:00
Views feat: add artifact diff viewer and improve button styling 2026-07-12 15:14:44 +01:00
.editorconfig Initial commit 2025-08-25 12:41:08 +01:00
.gitignore feat: add interactive diff viewer with user approval workflow 2025-11-24 21:29:54 +00:00
.npmrc Initial commit 2025-08-25 12:41:08 +01:00
CONTRIBUTING.md docs: streamline contributing section and link to CONTRIBUTING.md 2026-05-31 21:03:22 +01:00
esbuild.config.mjs refactor: replace mammoth with native DOCX parser using fflate 2026-06-28 15:08:50 +01:00
eslint.config.js feat: add quick actions system with provider-aware model settings 2026-04-20 20:20:22 +01:00
global.d.ts refactor: replace mammoth with native DOCX parser using fflate 2026-06-28 15:08:50 +01:00
LICENSE feat: add help modal button to top bar and update license to MIT 2025-11-07 00:28:22 +00:00
main.ts feat: add artifact diff viewer and improve button styling 2026-07-12 15:14:44 +01:00
manifest.json Bump plugin version to 1.4.8 2026-07-06 20:38:24 +01:00
package-lock.json chore: update AI SDK and dev dependencies to latest versions 2026-07-12 15:16:42 +01:00
package.json chore: update AI SDK and dev dependencies to latest versions 2026-07-12 15:16:42 +01:00
README.md docs: update README to highlight restore file changes feature 2026-07-12 15:21:58 +01:00
tsconfig.json Address Obsidian plugin scanner warnings. 2026-06-28 15:31:07 +01:00
version-bump.mjs Initial commit 2025-08-25 12:41:08 +01:00
versions.json Initial commit 2025-08-25 12:41:08 +01:00
vitest.config.ts refactor: update tests for AIFunctionService and path alias changes 2025-12-30 21:58:54 +00:00

Vaultkeeper AI for Obsidian

A powerful AI assistant plugin that brings Claude, Gemini, OpenAI, Mistral, and local models directly into your Obsidian vault with intelligent note management capabilities.

License: MIT Obsidian Plugin

vaultkeeper-social-1280x640

New! Restore file changes - Every note the AI creates, edits, or deletes (including binary files like PDFs and images) can be reviewed and restored to its previous or original version straight from the diff viewer.

Features

  • Multi-Provider AI Support - Switch seamlessly between Claude (Anthropic), Gemini (Google), OpenAI, Mistral, and self-hosted local models
  • Three Chat Modes
    • 🔍 Read-Only Mode: AI can search, read, and list your notes safely
    • ✏️ Edit Mode: AI can create, edit, delete, and move notes and folders (when you need it)
    • 📋 Planning Mode: A three-agent workflow where a planning agent analyzes your vault and creates a step-by-step strategy before execution
  • Interactive Diff Viewer - Review and approve AI-proposed changes before they're applied with side-by-side diff view, or let the AI make changes without asking"
  • Restore File Changes - Revert any note the AI created, edited, or deleted (including binary files) back to its original or previous version
  • Plan Approval Workflow - In Planning Mode, review the AI's proposed plan and approve it, reject it, or suggest changes before execution begins
  • Smart Reference System - Mention tags (#), files (@), and folders (/) with autocomplete
  • Custom System Instructions - Create and switch between personalized AI behaviors
  • Conversation Management - Persistent chat history with automatic conversation naming
  • Privacy Controls - Exclude sensitive files and directories from AI access with glob patterns
  • Files Support (PDF, Documents, Images, etc) - Search through PDF and Office documents (DOCX, PPTX, XLSX) and allow AI to read binary files directly (PDFs, Office/ODF documents, images, etc)
  • AI Memory - Persist vault conventions, preferences, and workflows across sessions so the AI remembers how you work
  • Web Search - Toggle web search on per-message so the AI can look up current information
  • Web Viewer - Allow the AI to fetch and read web page content directly
  • Quick Actions - Lightweight, single-shot AI operations on selected text, available via right-click context menu and a dedicated editor toolbar button — both toggleable in settings and fully supported on mobile
  • Mobile Compatible - Full functionality on mobile devices with touch-friendly controls
  • Streaming Responses - See AI responses as they're generated
  • Local Model Support - Connect to a self-hosted, OpenAI-compatible server (LM Studio, Ollama, vLLM, etc.) for fully local, private inference
  • Local & Private - API keys stored locally, no data sent to third parties

Installation

Manual Installation

  1. Download the latest release from the Releases page
  2. Extract the files into your vault's .obsidian/plugins/vaultkeeper-ai/ directory
  3. Reload Obsidian
  4. Enable "Vaultkeeper AI" in Settings → Community Plugins

From Community Plugins

  1. Open Obsidian Settings
  2. Navigate to Community Plugins
  3. Search for "Vaultkeeper AI"
  4. Click Install, then Enable

Quick Start

  1. Add API Keys (or connect a local server): Open plugin settings and configure at least one provider:

  2. Select a Model: Choose your preferred AI model from the dropdown

  3. Start Chatting: Click the Vaultkeeper AI icon in the left sidebar to open the chat window

  4. Try the Reference System:

    • Type @ to reference files
    • Type # to reference tags
    • Type / to reference folders

Usage

Switch models anytime in the settings without losing your conversation context.

Chat Modes

The chat mode selector in the input toolbar lets you switch between three modes at any time.

Read-Only Mode (Default) 🔍

  • AI can search vault content (text based files, PDFs, and Office/ODF documents)
  • AI can read file contents (including binary files like PDFs, Office documents, and images)
  • AI can list directory structures
  • Cannot modify your notes

Edit Mode ✏️

Switch to Edit Mode when you need the AI to:

  • Create new notes
  • Edit existing content
  • Delete files
  • Move/rename files and folders
  • Create and delete folders

Planning Mode 📋

Switch to Planning Mode for complex, multi-step tasks. See the Planning Mode section below for full details.

Interactive Diff Viewer

When the AI proposes changes to your files in Agent Mode, an interactive diff viewer appears that lets you:

  • Review Changes: See a side-by-side comparison of the current file and proposed changes
  • Approve or Reject: Accept the changes to apply them, or reject to cancel
  • Provide Feedback: Suggest modifications before accepting by typing your feedback and clicking the suggestion button
  • Mobile Support: Touch-friendly Accept/Reject buttons on mobile devices

The diff viewer ensures you're always in control of what changes are made to your vault, providing transparency and safety when working with AI-generated edits.

Skipping Approval

You can toggle the agents ability to make changes without asking when in edit and planning mode. While enabled, proposed changes are applied immediately without the diff viewer prompt. Turn it off anytime to go back to reviewing every change.

Planning Mode

Planning Mode introduces a three-agent workflow that separates task planning, orchestration, and execution. When enabled, specialized agents collaborate to analyze your vault, create a detailed strategy, and execute changes with intelligent oversight between each step.

How It Works

  1. Enable Planning Mode: Click the planning mode button in the chat input toolbar (list icon)
  2. Submit Your Request: Send your message as normal
  3. Planning Phase: The planning agent analyzes your vault, exploring existing notes, organizational patterns, and relevant content
  4. Clarifying Questions: The planning agent may ask you questions to better understand your requirements
  5. Plan Display: A step-by-step plan appears above the chat showing what will be done
  6. Plan Approval: Review the plan and Approve it, Reject it, or suggest a change before execution begins (see Plan Approval below)
  7. Execution Phase: For each step, an execution agent performs the task while an orchestration agent monitors progress and decides whether to continue, adapt, or replan
  8. Completion: All steps are marked complete when finished

The Three Agents

  • Planning Agent: Explores your vault (read-only) and creates the execution strategy. Can search files, read content, and ask clarifying questions, but cannot modify anything.
  • Execution Agent: Performs individual steps from the plan. Has full access to vault operations (when in Agent Mode) and completes each task independently.
  • Orchestration Agent: Monitors progress between steps. After each step completes, it evaluates the result and decides whether to continue to the next step, request a replan, or abort the workflow. It can also pass context to subsequent steps based on what was learned.

Plan Visualization

  • Steps display in a collapsible panel above the chat
  • Status indicators show progress: pending, active (with spinner), or completed (green checkmark)
  • The view auto-scrolls to keep the active step visible
  • Expand/collapse to see the full plan or a compact view

Plan Approval

Before execution begins, the proposed plan opens in a dedicated view for your review:

  • Approve - Accept the plan as-is and move to the execution phase
  • Reject - Cancel the plan outright
  • Suggest a change - Type feedback describing what you'd like changed, and the planning agent replans with your feedback in mind rather than starting over from scratch

When to Use Planning Mode

Planning mode is especially useful for:

  • Complex multi-step tasks requiring vault exploration
  • Comprehensive changes across multiple files
  • Research tasks needing deep vault analysis
  • Tasks where you want to review the approach before execution
  • Uncertain requirements where clarifying questions help

Replanning

If issues arise during execution, the orchestration agent can request a replan. This returns to the planning phase with full context about what's already been completed and what went wrong, allowing the plan to intelligently adapt to new information discovered during execution.

Quick Actions

Quick Actions are one-click AI edits you run on the note you're currently editing, without opening the chat panel. Open the editor menu (right-click, or the command palette) and pick an action. Some actions work on your current selection if you have text selected, otherwise they apply to the whole note.

They're available in two ways:

  • Right-click context menu — select text in any markdown note and choose a Quick Action from the context menu
  • Editor toolbar button — a dedicated button appears in the editor header for one-click access

Both entry points are individually toggleable in Settings and are fully supported on mobile.

Available actions

  • Proofread — Corrects spelling, grammar, punctuation, and typos without rewriting for style or changing your voice. Works on the selection if you have one, otherwise the whole note.
  • Beautify — Improves clarity, flow, and readability and adds Markdown formatting (headings, bold, lists, blockquotes) where it helps. Works on the selection if you have one, otherwise the whole note.
  • Apply template — Restructures the note to match a template you choose, fitting your content to the template's headings and structure while preserving the information. If the file you pick doesn't look like a template, no changes are made.
  • Apply links — Scans the note for mentions of pages that already exist in your vault and wraps them in wikilinks. It only links existing pages and never invents new ones. Works on the selection if you have one, otherwise the whole note.
  • Apply tags — Chooses tags for the note from the tags that already exist in your vault and merges them into the frontmatter. It won't create new tags — only ones already in use elsewhere.
  • Suggest tags — Like Apply tags, but free to suggest new tags as well as reuse existing ones. Suggested tags are merged into the note's frontmatter.
  • Generate frontmatter — Infers YAML frontmatter for the note (aliases, tags, title, summary, created) from its content and merges it into any existing frontmatter.

AI Memory

The AI can retain information across conversation sessions — your vault conventions, tagging patterns, personal preferences, or any established workflows you've described.

How It Works

Memories are stored in a plain markdown file at Vaultkeeper AI/memories.md. The AI reads this at the start of each conversation and can update it during a session. You can view and edit this file directly at any time.

Settings

  • Enable Memories: Toggle memory on or off entirely
  • Read-Only Memories: The AI can recall past memories but cannot add or update them — useful if you want to manage the file yourself

Toggle web search on a per-message basis using the globe button in the chat input toolbar. When active, the AI can perform live web searches to answer questions requiring current or external information.

Web search is supported on all cloud providers (Claude, Gemini, OpenAI, and Mistral) but not on Local models. Mistral uses its native Agents API for search; Claude, Gemini, and OpenAI use their respective built-in search tools.

You can also disable web search access entirely from Settings if you prefer the AI to stay within your vault.

Web Viewer

When enabled, the AI can fetch and read the content of web pages — useful for summarising articles, pulling in documentation, or referencing any URL you share.

Web viewer access can be toggled on or off in Settings.

Local Models

Run Vaultkeeper AI entirely against a self-hosted, OpenAI-compatible server instead of a cloud provider — no API key required, and nothing leaves your machine.

Setup

  1. Select Local from the provider dropdown in Settings (under the "Self Hosted" group)
  2. Local URL: Enter your server's chat completions endpoint, e.g. http://localhost:1234/v1/chat/completions (LM Studio's default)
  3. API Key: Optional — only needed if your local server requires authentication
  4. Model: Type the name of the model to use, exactly as your server expects it
  5. Optionally set separate Planning Model and Quick Action Model names if you want lighter/faster models handling those roles

This works with LM Studio, Ollama, vLLM, and other servers that expose an OpenAI-compatible chat completions API.

What works

  • Streaming responses
  • Tool/function calling (vault search, file operations, etc.)
  • Quick Actions
  • Image attachments (inlined as base64)
  • PDF and Office/ODF document attachments (PDFs are automatically rasterized to images, since local models can't read raw PDF bytes) and text-based file attachments

Limitations

  • No web search (cloud-only feature)
  • Many local models need their chat template adjusted to reliably handle multi-turn tool-calling; check your server's documentation (e.g. LM Studio's prompt template settings) if tool use behaves unexpectedly

Reference System

Quickly provide context to the AI using the reference system:

Files - Type @ followed by the filename:

@meeting-notes What action items did we discuss?

Tags - Type # to reference tagged notes:

#project/alpha Show me all notes about project alpha

Folders - Type / to reference entire directories:

/Daily Notes Summarize this week's daily notes

The autocomplete dropdown appears automatically and supports:

  • Fuzzy search (type partial names)
  • Keyboard navigation (↑↓ arrows)
  • Visual preview with full paths

Custom System Instructions

Customize the AI's behavior with system instructions:

  1. Create markdown files in Vaultkeeper AI/User Instructions/
  2. Click the "User Instructions" button in the chat
  3. Select your custom instruction set
  4. The AI will follow these instructions for all interactions

Example use cases:

  • Research assistant mode
  • Creative writing partner
  • Code documentation helper
  • Academic note-taker

See EXAMPLE_INSTRUCTIONS.md in your vault for a template.

Conversation History

  • All conversations are automatically saved
  • Click the history icon to browse past conversations
  • Conversations are automatically named by AI based on content
  • Stored in Vaultkeeper AI/Conversations/ as JSON files

Configuration

Settings

API Keys

  • Add keys for Claude, Gemini, OpenAI, or Mistral
  • Keys stored locally in your vault
  • Never transmitted except to respective AI providers

Local Provider

  • Select Local from the provider dropdown to use a self-hosted, OpenAI-compatible server instead of a cloud provider
  • Local URL: The chat completions endpoint of your server (e.g. http://localhost:1234/v1/chat/completions)
  • API Key: Optional — only required if your server enforces authentication
  • Model, Planning Model, Quick Action Model: Free-text fields — enter the model name(s) exactly as your server expects them
  • See Local Models for full details and limitations

Model Selection

  • Choose from 15+ supported cloud models, or connect your own local model
  • Switch anytime without conversation loss

Planning Model

  • Select a separate model for the planning agent (used in Planning Mode)
  • Defaults to your provider's recommended model
  • Allows cost optimization by using a more capable model for planning and a faster/cheaper model for execution
  • The planning model dropdown updates to match your selected provider

Memory

  • Enable Memories: Allow the AI to read and update a persistent memory file (Vaultkeeper AI/memories.md) across sessions
  • Read-Only Memories: The AI can read memories but cannot modify them

Web Access

  • Enable Web Search: Allow the AI to perform live web searches (can also be toggled per-message in the chat toolbar)
  • Enable Web Viewer: Allow the AI to fetch and read web page content

Search Configuration

Fine-tune the balance between request size and agent performance:

  • Search Results Limit (default: 15)

    • Controls the maximum number of files returned in search operations
    • Lower values (5-10): Faster searches and reduced API costs
    • Higher values (20-30): Provide more context, potentially improving agent performance
    • Adjust based on your vault size and typical query complexity
  • Snippet Size Limit (default: 300 characters)

    • Sets the character limit for contextual snippets in search results
    • Lower values (100-200): Reduce request size for cost-conscious users
    • Higher values (400-600): Give the AI more context to understand file relevance
    • Balance between providing enough context and controlling costs

File Exclusions

Protect your privacy by preventing the AI from accessing sensitive files or directories:

  • How it works: Exclusions apply to all AI operations in both read-only and agent modes

  • Use glob patterns to specify what to exclude:

    • private/** - Exclude entire directories (all files in "private" folder)
    • *.secret.md - Exclude specific file patterns (any file ending in .secret.md)
    • journal/personal/** - Exclude nested directories
    • .obsidian/workspace.json - Exclude specific configuration files
  • Common use cases:

    • Personal journals or diary entries
    • Financial information
    • Work-related confidential notes
    • API keys or credentials stored in notes
    • Draft content you don't want analyzed
  • Privacy guarantee: Excluded files are completely inaccessible to the AI - they won't appear in searches, can't be read, and can't be modified even in agent mode

Custom Instructions Path

  • Customize where instruction files are stored
  • Default: Vaultkeeper AI/User Instructions/

Development

Prerequisites

  • Node.js v16 or higher
  • npm
  • Obsidian (for testing)

Setup

# Clone into your vault's plugin directory
cd /path/to/vault/.obsidian/plugins/
git clone https://github.com/andy-stack/vaultkeeper-ai.git
cd vaultkeeper-ai

# Install dependencies
npm install

# Build for development (with watch mode)
npm run dev

# Build for production
npm run build

Testing

The project uses Vitest for testing:

# Run all tests
npm test

Contributing

I'm currently not accepting contributions (pull requests are disabled), but bug reports and suggestions via GitHub Issues are always welcome. See CONTRIBUTING.md for details.

Privacy & Security

  • API Keys: Stored locally in your Obsidian vault, never transmitted to third parties
  • No External Servers: Direct communication with AI providers only
  • Fully Local Option: Use the Local provider with a self-hosted server to keep all inference on your own machine, with no cloud provider involved at all
  • File Exclusions: Protect sensitive information by excluding individual files or entire directories from AI access using glob patterns - excluded files are completely inaccessible in both read-only and agent modes
  • Local Storage: All conversations and settings stored in your vault
  • Open Source: Fully auditable codebase

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

This plugin is built on the shoulders of many excellent projects:

Platform & AI

Document Processing

  • fflate - Unzipping Office Open XML / OpenDocument files for text extraction (DOCX, PPTX, XLSX, ODT, ODP, ODS)
  • PDF text extraction via Obsidian's bundled PDF.js (loadPdfJs())

UI Framework

  • Svelte - Reactive UI components

Rich Content Rendering

  • KaTeX - Mathematical notation rendering
  • Shiki - Modern syntax highlighting

Diff & Code Review

  • diff - Text diffing library for change detection
  • diff2html - Beautiful side-by-side diff viewer

Utilities

  • fuzzysort - Fuzzy search for reference autocomplete
  • Zod - TypeScript-first schema validation
  • regex-parser - Parses a string as regular expression

Development

CSS

  • Loader - Animated streaming indicator adapted from original by Li-Deheng
  • Gradient Spinner - Animated spinner adapted from original by AlexWarnes

Note: Using a cloud provider (Claude, Gemini, OpenAI, or Mistral) requires an API key, and usage is billed by the respective provider according to their pricing — monitor your usage through provider dashboards. The Local provider requires no API key and no billing, since inference runs on your own server.