A fully private AI assistant plugin for Obsidian that runs entirely on your machine. Works offline, keeps your data private, and connects to any OpenAI-compatible model.
Features:
- Local AI integration (Ollama, vLLM, llama.cpp, or any OpenAI-compatible endpoint)
- Fully private—no data leaves your vault
- Rich text manipulation: explain, expand, rewrite, summarize, and create notes
- Optional web search grounding via SearXNG for context-aware responses
- Per-note and vault-wide chat history
- Token-by-token streaming UI for real-time responses
- Works on macOS and Linux (desktop only)
-
Download the plugin from GitHub Releases
-
Extract to your vault's plugin directory
- Locate your vault's
.obsidian/plugins/folder - Create a new directory:
.obsidian/plugins/obsidian-ai-assistant/ - Copy the following files from the release into that directory:
main.jsmanifest.jsonstyles.css
- Locate your vault's
-
Enable the plugin
- Open Obsidian and go to Settings → Community plugins → Installed plugins
- Find Obsidian AI Assistant and toggle it on
If you want to build the plugin yourself:
-
Clone the repository
git clone https://github.com/SuperSonnix71/obsidian-ai-assistant.git cd obsidian-ai-assistant -
Install dependencies
npm install
-
Build the plugin
npm run build
-
Copy the built files to your vault
mkdir -p /path/to/your/vault/.obsidian/plugins/obsidian-ai-assistant/ cp main.js manifest.json styles.css /path/to/your/vault/.obsidian/plugins/obsidian-ai-assistant/
-
Reload Obsidian and enable the plugin in Community plugins
Choose one of the following:
# Install from https://ollama.ai
ollama pull llama2
ollama serveDefault: http://localhost:11434
python -m vllm.entrypoints.openai.api_server \
--model meta-llama/Llama-2-7b-hf \
--port 8000Access at: http://localhost:8000
./server -m model.gguf -p 8000Access at: http://localhost:8000
- Open Obsidian and enable the Obsidian AI Assistant plugin
- Go to Settings → Obsidian AI Assistant
- Select your provider (Ollama, OpenAI-compatible, etc.)
- Enter the base URL (e.g.,
http://localhost:11434for Ollama) - Choose a model from the dropdown (auto-populated for Ollama)
- Adjust temperature if desired (default: 0.7)
- Explain selection – Understand selected text
- Expand selection – Add more detail or context
- Rewrite selection – Available styles: Formal, Casual, Active Voice, Bullet Points
- Caption selection – Generate a caption for the selection
- Summarize selection – Condense selected text
- Chat (this note) – Persistent conversation with the current note as context
- Search vault for notes – Find notes by title, aliases, headings, tags, or description (clickable wikilinks)
- Research & Create Note – Generate a new note based on web research results
All commands are accessible via:
- Command Palette (Cmd/Ctrl + P)
- Editor context menu (right-click)
- Plugin modal (toggle from ribbon icon or command palette)
- Base URL:
http://localhost:11434(default) - Model selection: Automatically populated from
/api/tags - Temperature: 0.0 (deterministic) to 1.0 (creative)
- Base URL: Endpoint of your server (e.g.,
http://localhost:8000) - API Key (optional): Some servers may require this
- Model: Manually specify or auto-fetch from
/v1/models - Temperature: Adjustable per request
Enable optional web search to augment AI responses with current information:
- Enable Web Search in plugin settings
- Set Search URL Template: Default is SearXNG (
https://searx.be/search?q=%s&format=json) - Results are injected into the LLM context as quoted, attributed snippets
Recommended: Self-host [SearXNG] for full privacy.
Configure how long conversations are kept:
- Per-note max messages: Default 80
- Vault-wide max messages: Default 400
- Max message character limit: 20,000
- Provider Layer (
src/providers/) – Normalizes requests across Ollama and OpenAI-compatible servers - History Layer (
src/history/) – Manages per-note and vault-wide chat persistence - Editor Integration (
src/editor/) – Handles text selection, insertion, and replacement - UI Layer (
src/ui/) – Obsidian Modal with React + shadcn/ui components - Web Search (
src/websearch/) – Integrates external search results
- Obsidian API – Plugin framework
- TypeScript – Type-safe development
- Svelte – UI components
- Tailwind CSS – Styling
- esbuild – Bundling
-
Development mode (watch + rebuild on changes)
npm run dev
-
Production build
npm run build
-
Local deployment (copy to vault)
./deploy.sh
-
Type checking
npm run svelte-check
src/
├── main.ts # Plugin entry point
├── commands/ # Command definitions and execution
├── editor/ # Text selection and insertion logic
├── history/ # Chat persistence and retention
├── providers/ # LLM provider integrations
│ ├── ollama.ts # Ollama API client
│ ├── openai_compatible.ts # OpenAI-compatible servers
│ └── transport/ # HTTP and streaming utilities
├── settings/ # Configuration and defaults
├── types/ # TypeScript interfaces
├── ui/ # Obsidian Modal and UI components
│ └── svelte/ # Svelte components
└── websearch/ # Web search integration
- Zero cloud integration – All processing happens locally
- Vault privacy – No data is sent outside your machine
- Open source – Fully auditable code
- Web search – Results are treated as untrusted; prompts explicitly instruct the model to quote and attribute sources
- Verify Ollama is running:
ollama serve(should be athttp://localhost:11434) - Check the plugin settings for correct base URL
- Ensure no firewall is blocking localhost connections
- For Ollama: Run
ollama pull <model-name>first - For OpenAI-compatible: Ensure
/v1/modelsendpoint is accessible - Check browser console (Obsidian → Ctrl+Shift+I) for detailed errors
- Verify the search URL is correct and accessible
- Test the URL manually:
https://your-searxng/search?q=test&format=json - Ensure it returns valid JSON
- Reduce Modal Width/Height in settings
- Lower history retention limits if chat slows down
- Consider running a smaller, faster model
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes
- Push to the branch and open a Pull Request
For major changes, please open an issue first to discuss what you'd like to change.
MIT License – See LICENSE for details
Built by SuperSonnix71
