If your notes live in Obsidian, the open-source Khoj plugin lets you ask questions about them in plain English, search by meaning rather than exact words and find notes similar to the one you're reading. Pair it with a self-hosted Khoj server and a local Ollama model, and your vault stays on your own PC. This guide follows Khoj's official Obsidian and self-hosting documentation.
How it works
The Khoj plugin is a client: it sends your vault to a Khoj server, which indexes your notes and answers chat and search requests. That server can be Khoj's own cloud service or a copy running on your PC. Khoj's self-hosting docs say "Your data will never have to leave your private network" when you run it yourself, and with a local chat model from Ollama the AI side stays local too.
Khoj's docs list three main features in Obsidian:
Chat: "Find answers quickly, from your private notes or the public internet", with answers drawing on your notes and generated content.
Search: "Advanced natural language understanding using Transformer based ML Models" and incremental, search-as-you-type results.
Similar notes: "Find similar notes to the current one".
Behind the search, Khoj turns chunks of your notes into "meaning vectors" with a bi-encoder model and re-ranks the best matches with a slower, higher-quality cross-encoder. Our explainer on embedding vs reranker models covers that idea in more detail.
Before you start: run a Khoj server
For a private setup, you need Khoj running on your PC first. Our step-by-step guide on how to self-host Khoj with a local Ollama model covers installing WSL2 and Docker Desktop, editing Khoj's docker-compose.yml and connecting Ollama. Khoj's documentation recommends 16GB of VRAM for local chat models (8GB of RAM is the minimum), so a card such as the ASUS RTX 5060 Ti 16GB Dual OC matches the developers' recommendation.
Once it's running, check that the web app opens at http://localhost:42110 before setting up Obsidian.
Step 1: Install the Khoj plugin
In Obsidian, open Settings > Community plugins and search for Khoj.
Click Install, then Enable on the Khoj plugin page.
Step 2: Point the plugin at your own server
Open the Khoj plugin settings and, per Khoj's self-hosting instructions:
Set the Khoj URL field to your server's address. The default is http://127.0.0.1:42110.
Leave the Khoj API Key field empty if your server runs in anonymous mode (the Docker setup in Khoj's compose file does by default).
If you use Khoj's cloud service or a server with logins instead, generate an API key in the Khoj web app and paste it into the plugin's API key field. Khoj's general setup notes add that "localhost may not work in all cases", so stick with 127.0.0.1 in the plugin if localhost fails.
Step 3: Sync your vault
By default, the plugin syncs your vault with the Khoj server automatically on a regular schedule (Khoj's docs say "periodically"). To index it straight away, click Force Sync in the plugin settings.
Step 4: Chat with your notes
Click the Khoj chat icon on the ribbon, or run Khoj: Chat from the Command Palette, and ask questions in a natural way. Khoj's own example is "When did I file my taxes last year?". Answers come from the chat model you set up on your server, so with Ollama the replies are generated on your own PC. As with any language model, check important answers against the original notes.
Step 5: Search and find similar notes
Run Khoj: Search from the Command Palette (or use the search icon on the ribbon) for natural-language search across your vault. Khoj supports query filters if you want to narrow results.
Run Khoj: Find Similar Notes to see notes related to the one you have open, which is handy for linking ideas you'd forgotten about.
Troubleshooting
Khoj's Obsidian page gives three fixes:
Settings changes haven't applied: open the plugin settings and toggle Khoj off and on again.
Results are failing or out of date: click the Update button in the plugin settings to force the index to refresh.
Upgrading: in Community plugins, click Check for updates, then Update next to Khoj.
If the plugin can't reach your server at all, make sure Docker Desktop and the Khoj containers are running and that the URL is correct.
Khoj or a simpler Ollama plugin?
Khoj is a bigger setup than a plugin that talks to Ollama directly, because you need a Khoj server alongside Obsidian. In return you get semantic search across the whole vault, similar-note suggestions and the same knowledge base in Khoj's web app, desktop app and other clients. If you only want an AI to rewrite or summarise the note you're working on, our guide to using Ollama with Obsidian covers lighter options. For other note apps, see our best free note-taking apps for Windows.