Khoj: your open-source AI second brain that runs locally or in the cloud
GitHub RepoImpressions1.2k
View on GitHub
@githubprojectsPost Author

Khoj: Your Open Source AI Second Brain That Runs Where You Want

If you've ever wanted an AI assistant that actually knows your notes, documents, and codebase without sending everything to a third party, you're not alone. Khoj is an open source tool that lets you build your own "second brain" — think of it as a personal AI that can answer questions using your own data, running either fully locally or in the cloud.

It's not trying to be another ChatGPT wrapper. It's a self-hostable semantic search and chat system that learns from your files, and it's surprisingly easy to set up.

What It Does

Khoj indexes your local files (Markdown, Org-mode, PDFs, plaintext, even code files) and lets you search or chat with them using natural language. You can ask questions like "What was that idea I had about microservices last month?" and it'll find the relevant note or document and answer based on it.

It runs as a web app, a desktop app, or even an Obsidian plugin. The core is a Python backend that handles indexing and querying, with multiple AI backends to choose from (OpenAI, GPT4All, or local models via Llama.cpp).

Why It's Cool

Local first, cloud optional. You can run everything on your own machine with no internet required if you use a local model. Or if you prefer, connect to OpenAI or another cloud provider. The choice is yours.

Works with your existing workflow. If you're already using Obsidian, Emacs, or just have a folder of Markdown files, Khoj can index them directly. No need to migrate your notes to another platform.

Actually private. Since you control where the data goes, you can keep sensitive work notes or personal documents entirely offline. No "we'll train on your data" surprises.

Multiple interfaces. Web UI, desktop app, Obsidian plugin, Emacs integration, even a REST API if you want to build your own front end.

Free and open source. MIT license, active community on GitHub, and the team seems genuinely focused on making a useful tool rather than a data collection service.

How to Try It

The easiest way to test it is with the desktop app. Download the latest release from the GitHub releases page for your OS (Windows, macOS, Linux). It comes with a bundled setup that includes a local model, so you can start immediately.

If you prefer the web version or want to self-host:

pip install khoj-assistant
khoj start --port 42110

Then open http://localhost:42110 in your browser. You'll need to configure at least one content source (point it to a folder of Markdown files, for example) and choose a model provider. The web UI walks you through it.

For the Obsidian plugin, search "Khoj" in the community plugins section of Obsidian and install it directly.

All instructions and detailed setup guides are in the README.

Final Thoughts

Khoj fills a real gap. Most "AI assistants" are either cloud-only and privacy-invasive, or they're too technical to set up. This one hits a sweet spot: it's powerful enough for a developer who wants to query their codebase or notes, but simple enough that a non-technical user can get started with the desktop app.

If you're tired of losing ideas in your own notes, or you want an AI that actually knows your work, give it a shot. It's one of those projects that makes you wonder why nobody built it sooner.


Found this interesting? Follow us on X (Twitter) @githubprojects for more developer tools and open source highlights.

Back to Projects
Last updated: June 4, 2026 at 05:52 AM