Local AI Companion

unlisted

by Howie002

Local AI chat panel with vault tool access. Works with Ollama, LM Studio, or any OpenAI-compatible endpoint. Auto-detects installed models.

Updated 19d agoMIT
View on GitHub

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:

ToolPurpose
get_active_fileGet path + content of the currently open note
read_fileRead a markdown file by path
write_fileCreate or overwrite a markdown file (confirmation required)
append_fileAppend text to a file (confirmation required)
delete_fileSend a file to trash, or delete permanently (confirmation required)
rename_fileRename / move a file; updates internal links (confirmation required)
list_markdown_filesList markdown files, optionally filtered by folder
list_foldersList vault folder paths
search_vaultFull-text search across markdown files; returns snippets
recall_past_chatsSearch saved Local AI Companion conversations for prior context
open_fileOpen a file in the editor (current pane or new pane)
get_backlinksList notes that link to a given file
get_outgoing_linksList internal links and embeds out of a file
get_tagsVault-wide tag list with usage counts
find_by_tagFind notes with a given tag (inline or frontmatter)
get_current_datetimeCurrent 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:
    • Ollama running locally with a tool-calling model
    • LM Studio with the Developer → Local Server running
    • any OpenAI-compatible endpoint

Quick start with Ollama

ollama pull llama3.1
ollama serve

Quick start with LM Studio

  1. Open LM Studio → My Models → download a tool-calling model (Llama 3.1 / Qwen 2.5 / Mistral instruct / Gemma)
  2. Developer tab → start the local server (default http://127.0.0.1:1234)
  3. 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.

  1. Provider — pick Ollama, LM Studio, or OpenAI-compatible. Switching auto-fills the default endpoint.
  2. Endpoint URL — adjust if your provider runs on a non-default port or remote host.
  3. API key — optional. Most local LM Studio setups don't need one.
  4. Detect — click to discover installed models; the dropdown that appears lets you pick one.
  5. Test — verifies connectivity and reports the number of models found.
  6. 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/alpha and 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.md to Projects/Onboarding.md and 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:

WhenHost 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 themCustom 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 URLA 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

MIT

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.