Vault AI Chat - Obsidian Plugin
An AI-powered chat assistant that lives inside your Obsidian vault. Ask questions, get answers based on your notes, and manage files directly from the chat interface.
Features
AI Chat
- Chat with AI right inside Obsidian
- AI reads your notes for context (RAG - Retrieval Augmented Generation)
- Supports multiple AI providers
- Streaming responses for real-time feedback
File Operations
Manage your vault directly from the chat with slash commands:
- Create files and folders
- Delete files and folders
- Append text to existing files
- Read and list files
AI-Powered Writing
- Generate complete notes with AI
- Save any AI response as a note
- Copy responses to clipboard
Installation
Option 1: Pre-built (Easy)
-
Download
vault-ai-chat-v1.1.1.zip -
Extract the zip file
-
Copy the 3 files (
main.js,manifest.json,styles.css) to:YourVault/.obsidian/plugins/vault-ai-chat/ -
Create the
vault-ai-chatfolder if it doesnβt exist -
Restart Obsidian
-
Go to Settings β Community Plugins β Enable βVault AI Chatβ
Option 2: Build from Source
See the Building from Source section below.
Configuration
- Open Obsidian Settings
- Go to βVault AI Chatβ in the left sidebar
- Choose your AI provider and enter your API key
- Select a model
- Click βTestβ to verify the connection
Supported Providers
| Provider | Description | Get API Key |
|---|---|---|
| OpenRouter | Access to many AI models (Claude, GPT-4, Llama, etc.) | openrouter.ai/keys |
| Google AI | Gemini models (2.0, 2.5) | aistudio.google |
| Ollama | Run AI locally on your computer (free!) | ollama.ai |
| MiniMax | MiniMax M2 models | platform.minimax.i |
| OpenAI Compatible | Any API that works like OpenAI (DeepSeek, Groq, Z.AI GLM, local LLMs) | Varies |
Commands Reference
File Operations
| Command | Aliases | What it does | Example |
|---|---|---|---|
/create <path> |
/new, /touch |
Creates an empty file | /create Projects/ideas |
/generate <title> |
/gen, /ai |
AI writes content for you | /generate Weekly Plan |
/delete <file> |
/rm |
Deletes a file | /delete old-draft |
/append <file> <text> |
/add |
Adds text to end of file | /append Journal.md Great day! |
/read <file> |
/cat |
Shows file contents | /read README |
/list [folder] |
/ls |
Lists files | /list Projects |
/save |
Saves last AI response | /save |
Folder Operations
| Command | Aliases | What it does | Example |
|---|---|---|---|
/mkdir <path> |
/folder |
Creates a folder | /mkdir Projects/2024 |
/rmdir <path> |
/deletefolder |
Deletes folder + contents | /rmdir Old Stuff |
Chat Commands
| Command | What it does |
|---|---|
/help |
Shows all commands |
/clear |
Clears chat history |
Usage Examples
Creating Files
/create quick-note β Creates quick-note.md in vault root
/create Projects/meeting-notes β Creates Projects/meeting-notes.md
/create Archive/2024/January β Creates file with nested folders
AI-Generated Content
/generate Weekly Planning β AI writes a weekly planning template
/generate Project Proposal β AI creates a project proposal
/generate Study Notes: Biology β AI writes study notes
Natural Language
You can also just ask naturally:
- βWrite a note about productivity tipsβ β AI generates content with a save button
- βCreate a meal plan for next weekβ β AI writes it, you click save
File Management
/mkdir Projects/2024/Q1 β Creates nested folder structure
/list Projects β Shows files in Projects folder
/read README β Displays README.md contents
/append Daily Log.md Had lunch β Adds text to Daily Log.md
/delete old-draft β Deletes old-draft.md (with confirmation)
/rmdir Archive/Old β Deletes folder and everything inside
Settings
Chat Settings
- Chat folder: Where saved chats go (default: βAI Chatsβ)
- Enhanced notes folder: Where AI-generated notes go (default: βEnhanced Notesβ)
- Max context files: How many of your notes the AI sees (1-20)
- Max tokens: Length of AI responses (500-8000)
- Temperature: Creativity level (0 = focused, 1 = creative)
Security Note
API keys are stored in your plugin settings. If you use Obsidian Sync, these may sync across devices. For sensitive keys, consider using the OpenAI Compatible option with environment variables.
Building from Source
Prerequisites:
- Node.js (version 16 or newer) - Download here
- A code editor (VS Code recommended)
- Basic familiarity with the command line/terminal
Step-by-Step Instructions
Step 1: Get the source code
# If you have the source zip, extract it to a folder
# Or clone from git if available
Step 2: Open a terminal/command prompt
- Windows: Press
Win + R, typecmd, press Enter - Mac: Press
Cmd + Space, typeTerminal, press Enter - Linux: Press
Ctrl + Alt + T
Step 3: Navigate to the plugin folder
cd path/to/vault-ai-chat
(Replace path/to/vault-ai-chat with the actual folder location)
Step 4: Install dependencies
npm install
This downloads all the required code libraries. It may take a minute.
Step 5: Build the plugin
npm run build
This compiles the TypeScript code into JavaScript that Obsidian can run.
Step 6: Copy to Obsidian
After building, youβll have these files:
main.jsmanifest.jsonstyles.css
Copy all three to your Obsidian vault:
YourVault/.obsidian/plugins/vault-ai-chat/
Step 7: Enable the plugin
- Restart Obsidian
- Go to Settings β Community Plugins
- Find βVault AI Chatβ and enable it
Development Mode (for making changes)
npm run dev
This watches for changes and rebuilds automatically.
Project Structure
vault-ai-chat/
βββ main.ts # Plugin entry point
βββ manifest.json # Plugin metadata
βββ styles.css # UI styling
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript configuration
βββ esbuild.config.mjs # Build configuration
βββ src/
βββ core/
β βββ provider.ts # LLM provider interface
β βββ providers/ # Provider implementations
β β βββ openrouter.ts
β β βββ google-ai.ts
β β βββ ollama.ts
β β βββ minimax.ts
β β βββ openai-compatible.ts
β βββ grounding/
β β βββ vault-search.ts # Searches your notes
β β βββ context-builder.ts
β βββ templates/
β βββ note-templates.ts
βββ storage/
β βββ settings.ts # Plugin settings
β βββ chat-persistence.ts # Saves chat history
βββ commands/
β βββ commands.ts # Obsidian commands
βββ ui/
βββ chat-view.ts # Main chat interface
βββ settings-tab.ts # Settings page
Troubleshooting
βNo AI provider configuredβ
β Go to Settings β Vault AI Chat and enter your API key
βAuthentication Errorβ
β Check that your API key is correct and has credit/quota
βModel Not Foundβ
β The model name may be wrong. Check the providerβs documentation.
Chat is slow
β Try a faster model (e.g., gemini-2.0-flash or gpt-3.5-turbo)
Responses are cut off
β Increase βMax tokensβ in settings
Plugin doesnβt appear
β Make sure all 3 files are in the plugin folder and restart Obsidian
Changelog
v1.1.1
- Fixed folder/file deletion on OneDrive and cloud-synced vaults
- Now uses trash instead of permanent delete (recoverable!)
- Better error messages with helpful tips
v1.1.0
/createnow creates empty files (use/generatefor AI content)- Added
/generatecommand for AI-written notes - Added
/rmdircommand to delete folders - Added
/touchalias for/create - Improved
/helpwith comprehensive command list
v1.0.x
- Initial release
- Chat interface with streaming
- Multiple AI provider support
- File operations (create, delete, append, read, list)
- Folder creation
- Save responses as notes
License
MIT License - feel free to use, modify, and distribute.
Credits
Built for Obsidian by Mark Allen.
Uses the Obsidian Plugin API and various AI provider APIs.


