Local AI Companion
unlistedby Howie002
Local AI chat panel with vault tool access. Works with Ollama, LM Studio, or any OpenAI-compatible endpoint. Auto-detects installed models.
Local AI Companion
An Obsidian plugin that gives you a chat panel powered by your own local AI — with full tool access to your vault. Works out of the box with Ollama and LM Studio, and any OpenAI-compatible endpoint. The plugin auto-detects installed models so you can pick one from a dropdown instead of typing model names.
Features
- Chat Panel — right-sidebar chat with persistent conversation history, save/load, and live tool-call activity stream
- Vault Tools — read, write, append, search, link, tag, open, rename, and delete notes from inside the chat
- Multi-Provider — Ollama, LM Studio, or any OpenAI-compatible API on the same plugin
- Model Auto-Detect — one click to discover what's installed; pick from a dropdown
- Connection Test — verify your provider is reachable before you start a chat
- Local-First by default — nothing leaves your machine unless you explicitly point it at a remote endpoint
- Remote Support — optional Cloudflare Access service tokens, custom auth headers, API keys
- Safety Controls — write/delete confirmation modal, iteration cap, configurable system prompt
Available Agent Tools
The agent can call these tools against your vault:
| Tool | Purpose |
|---|---|
get_active_file | Get path + content of the currently open note |
read_file | Read a markdown file by path |
write_file | Create or overwrite a markdown file (confirmation required) |
append_file | Append text to a file (confirmation required) |
delete_file | Send a file to trash, or delete permanently (confirmation required) |
rename_file | Rename / move a file; updates internal links (confirmation required) |
list_markdown_files | List markdown files, optionally filtered by folder |
list_folders | List vault folder paths |
search_vault | Full-text search across markdown files; returns snippets |
recall_past_chats | Search saved Local AI Companion conversations for prior context |
open_file | Open a file in the editor (current pane or new pane) |
get_backlinks | List notes that link to a given file |
get_outgoing_links | List internal links and embeds out of a file |
get_tags | Vault-wide tag list with usage counts |
find_by_tag | Find notes with a given tag (inline or frontmatter) |
get_current_datetime | Current local date, time, weekday, and timezone |
Writes (write/append/delete/rename) prompt for confirmation by default; toggle in settings.
Installation
Prerequisites
- Obsidian 1.5+
- One of:
Quick start with Ollama
ollama pull llama3.1
ollama serve
Quick start with LM Studio
- Open LM Studio → My Models → download a tool-calling model (Llama 3.1 / Qwen 2.5 / Mistral instruct / Gemma)
- Developer tab → start the local server (default
http://127.0.0.1:1234) - Make sure the model is loaded
Build from source
git clone https://github.com/Howie002/local-ai-companion.git
cd local-ai-companion
npm install
npm run build
Install into Obsidian
Copy manifest.json, main.js, and styles.css into:
<your-vault>/.obsidian/plugins/local-ai-companion/
Then Settings → Community plugins → Local AI Companion → Enable.
Configuration
Open Settings → Local AI Companion.
- Provider — pick Ollama, LM Studio, or OpenAI-compatible. Switching auto-fills the default endpoint.
- Endpoint URL — adjust if your provider runs on a non-default port or remote host.
- API key — optional. Most local LM Studio setups don't need one.
- Detect — click to discover installed models; the dropdown that appears lets you pick one.
- Test — verifies connectivity and reports the number of models found.
- Tweak agent behavior, context window, file locations, system prompt, auth headers.
Usage
- Click the bot icon in the left ribbon, or
- Command palette → Open AI Companion panel
Example prompts
- "Summarize the active note and add an action-items list to the top."
- "Find all notes tagged
#project/alphaand list their backlinks." - "Search for everything that mentions 'Q4 budget' and gather it into a new note at
Reports/Q4 Budget Roundup.md." - "Rename
Inbox/note 3.mdtoProjects/Onboarding.mdand update any references."
Privacy and network access
This plugin is local-first by design but is also flexible enough to call remote endpoints if you choose to configure them. Here's exactly what hosts it can reach, and only when:
| When | Host reached |
|---|---|
| Always (default) | Your configured Endpoint URL — defaults to http://127.0.0.1:11434 (Ollama) or http://127.0.0.1:1234 (LM Studio). All chat, tool-call routing, and model auto-detection traffic goes here. |
| Only if you set them | Custom auth header value, Cloudflare Access service tokens, or an API key are attached to the same Endpoint URL requests. The plugin never sends them anywhere else. |
| Only if you change the Endpoint URL | A remote address you typed yourself (e.g. a Tailscale IP, a Cloudflare Tunnel hostname, or a hosted OpenAI-compatible endpoint). |
The plugin makes no telemetry calls, no analytics, no update checks, and no third-party API calls beyond your configured Endpoint URL. All vault reads/writes happen through Obsidian's API and never leave the local process. Conversation history is stored in data.json inside the plugin folder (gitignored — never tracked by source control by default).
If you point the Endpoint URL at a remote host, your prompts and any tool results that include note content will travel to that host. Choose your endpoint accordingly.
Development
npm run dev # esbuild watch mode
npm run build # production bundle
License
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.