Mindket

Khoj

Newversion 2 · updated
GitHub trending
Star38.1k

Overview

Khoj’s AGPL-3.0 personal AI app that answers from the web and from your own notes and documents. The setup notes cover running it with Docker or pip, picking a chat model, and using it from Obsidian, Emacs, the Desktop app, the web and WhatsApp.

Khoj is an open-source project on GitHub in the Productivity category, listed by Mindket. It is free. This is version 2, last updated on . Install it from GitHub as its README says. Get Mindket’s setup notes on your Mindket account, as a zip.

At a glance

Runs in
  • The web app at http://localhost:42110, which you can install as a progressive web app on a desktop or a phone
  • An Obsidian plugin that syncs your vault and adds chat, search and a find-similar command
  • An Emacs package, khoj.el, for chat and search
  • A Desktop companion app that keeps your files and folders in sync
Start with
mkdir ~/.khoj && cd ~/.khoj
wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml

Platform

GeminiAI chat
DockerContainer
macOSOperating system
WindowsOperating system
LinuxOperating system

About

What it is

Khoj is a personal AI app that answers from your own documents and from the web. Its README says it “smoothly scales up from an on-device personal AI to a cloud-scale enterprise AI”. You run the server yourself with Docker or pip, then reach it from a browser, Obsidian, Emacs, a Desktop companion app or your phone. A WhatsApp bot runs on Khoj Cloud. The README also names Khoj Cloud and an Enterprise option. These notes cover the self-hosted route.

  1. You start the server with Docker or pip
  2. You set a chat model key, or pick models at first run
  3. Your notes sync from a client, or you upload files
  4. A question finds the closest notes by meaning
  5. Those notes and your question go to the chat model

Who it suits

People with a pile of notes, PDFs and documents who want to ask questions of them in plain language, and who would rather run the app on their own machine. Obsidian and Emacs users get plugins that sync their notes. Skip it if you want a one-click install. The self-hosted route needs Docker or Python, a chat model and a few settings in docker-compose.yml or at pip’s first run.

Who uses it, and how
IndustryWho uses itHow they use itExample
Note takingObsidian usersSync a vault with the plugin and ask questions of it in chatAn Obsidian user installs the plugin, clicks Force Sync and asks the page’s example, “When did I file my taxes last year?”
Org-mode and EmacsPeople who keep notes in org filesPoint the package at their org folders and search or chat from the keyboardAn Emacs user sets khoj-index-directories to an org-roam folder and presses C-c s s to search it in plain language.
Study and researchStudents and researchers with PDFsUpload documents and ask about them, or go deeper on a topicA student drags a PDF into the chat window, asks about it, then tries /research to go deeper.
Small teamsAdmins who host Khoj for othersTurn on logins and share an agent that has its own personalityAn admin removes --anonymous-mode, sets up magic links and marks a custom agent public so every user on the server sees it.
Privacy-minded usersPeople who keep notes off hosted modelsRun an offline model through OllamaSomeone runs ollama pull llama3.1, uncomments OPENAI_BASE_URL in docker-compose.yml and starts Khoj, as the Ollama page’s first-run steps say.

Where to use it

Khoj is a server plus clients that talk to it. The docs name these.

  • The web app at http://localhost:42110, which you can install as a progressive web app on a desktop or a phone
  • An Obsidian plugin that syncs your vault and adds chat, search and a find-similar command
  • An Emacs package, khoj.el, for chat and search
  • A Desktop companion app that keeps your files and folders in sync
  • A WhatsApp bot on Khoj Cloud’s number, which needs a Khoj Cloud account for your own data. The page gives no way to point it at your own server
  • Chat models from OpenAI, Anthropic and Gemini with your own key, or any OpenAI compatible server such as Ollama
What it runs on
RouteInstallWhat the docs ask for
Docker on macOSDocker Desktop with Compose, or HomebrewThe compose file from Khoj’s repository
Docker on WindowsWSL2, then Docker Desktop with the WSL2 backendCommands run in a WSL2 terminal
Docker on LinuxDocker Desktop, or Docker Engine and Compose from your package managerThe same compose file
pippython -m pip install 'khoj[local]' on macOS Intel or Linux, py -m pip install 'khoj[local]' in PowerShell on WindowsPython 3.10 to 3.12 per PyPI. Apple silicon and GPU builds set CMAKE_ARGS first

How to set it up

Get it saves a zip of Mindket’s setup notes in your downloads folder, with a page for each route and client from Khoj’s docs. The main route is Docker.

What you need first
NeedDetail
Docker or PythonDocker with Compose, plus WSL2 on Windows, or Python with pip for the pip route
A chat modelA key for OpenAI, Anthropic or Gemini, an OpenAI compatible server such as Ollama, or an offline model
For offline modelsAt least 8 GB of RAM with 16 GB of VRAM recommended, and at least 5 GB of free disk
SecretsKHOJ_ADMIN_PASSWORD and KHOJ_DJANGO_SECRET_KEY set to something secure
Free ports42110 for Khoj and 5900 for the computer container, both published by the compose file
  1. Make a folder and download the compose file.
  2. Open it and set the admin password and the secret key, then either one chat model key or OPENAI_BASE_URL for Ollama.
  3. Run docker-compose up and wait for the log line that says Khoj is ready to engage.
  4. Restart the server once, then open http://localhost:42110.
mkdir ~/.khoj && cd ~/.khoj
wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml
cd ~/.khoj
docker-compose up

On Windows, the page runs these in a WSL2 terminal. The pip route uses two lines instead. The first installs the server on macOS Intel or Linux without a GPU (the Windows, Apple silicon and GPU lines are in setup/pip.md). The second starts it without a login, and the page gives no separate Windows form of it.

python -m pip install 'khoj[local]'
USE_EMBEDDED_DB="true" khoj --anonymous-mode

How to use it

Open http://localhost:42110 and chat. Khoj answers from your notes when they are relevant, and from its general knowledge when they are not. Slash commands change that.

Slash commands in chat
CommandWhat it does
/notesAnswers only from your notes
/generalAnswers only from general knowledge
/onlineAdds online information to the prompt
/researchGoes deeper on a topic
/codeGenerates and runs simple Python
/imageGenerates an image

To get notes in, drag files into the chat window, use the Desktop app, Obsidian or Emacs, or connect a Notion workspace. Query filters narrow a search or a chat. This one is the page’s own example.

what is the meaning of life? file:"1984.org" dt>="1984-01-01" dt<="1985-01-01" -"big" -"brother"

It limits the answer to entries from 1984.org that carry a 1984 date and leave out the words big and brother.

Example

You keep notes in an Obsidian vault and run Khoj in Docker on the same computer. You install the Khoj plugin, set its Khoj URL to http://127.0.0.1:42110 and leave the API key empty, because the compose file starts the server in anonymous mode. You click Force Sync, then run Khoj: Chat from the command palette and type the page’s example question.

When did I file my taxes last year?

The Chat page says Khoj uses your question to find the most relevant notes. It passes them with the last few messages and some metadata to your chat model, and it shows the reference notes it used.

For newcomers and experts

If you are new. Khoj has two halves. The server keeps an index of your documents and talks to an AI model. A client, such as the web page or Obsidian, is where you type. Start with the Docker route, one API key and a few files dragged into the chat window. Then open the admin panel at http://localhost:42110/server/admin. Use localhost there, not 127.0.0.1, to avoid a CSRF error.

For experts. Search runs in two passes. A bi-encoder turns chunks of your documents and your query into meaning vectors, and a slower cross-encoder re-ranks the closest ones. The SearchModelConfig page in the admin panel swaps the bi-encoder for a HuggingFace model, an OpenAI embedding model or any OpenAI compatible endpoint. A different bi-encoder means re-indexing every document.

ServerChatSettings sets the default chat model, and the same model runs every intermediate step, such as intent detection and web search. Web search defaults to the SearXNG container in the compose file. The file names four paid services as options for web search and page reading: Serper, Olostep, Firecrawl and Exa. Code runs in the Terrarium sandbox on your machine, for free, or in E2B’s remote sandbox when you set E2B_API_KEY. The Code Execution page says E2B is not free.

For several users, drop --anonymous-mode and set up magic links or Google sign-in. Google sign-in needs the khoj-cloud image or khoj[prod]. The Performance page says its search and indexing figures were last measured in 2022, so treat them as old.

Good to know

Most of Khoj runs where you put it, and a few paths reach out.

  • Accounts: the self-hosted server needs no Khoj Cloud account, only the admin account you set in docker-compose.yml or create at pip’s first run. A hosted model from OpenAI, Anthropic or Gemini needs your own API key, and the WhatsApp bot needs a Khoj Cloud account for your own data
  • What leaves your machine: the Chat page says your question, the notes it found, the last few messages and some metadata go to the chat model you enabled. With a hosted model, that text goes to its provider. An offline model keeps it local
  • Usage data: self-hosted Khoj sends anonymized usage metadata, such as the client and the content types, unless you set KHOJ_TELEMETRY_DISABLE=True. The Telemetry page says it sends no personal information and nothing from your content
  • Logins: the compose file and the pip line start in anonymous mode, with no login. Before you reach Khoj from another device, set KHOJ_DOMAIN, set real passwords and add authentication
  • Placeholders: the compose file ships the admin password as password, the secret key as secret and the database password as postgres. Change them
  • Removing: docker-compose down --volumes also removes the database volume, so it deletes your data
  • Limits: the LM Studio page says Khoj no longer works with it, and the Github integration page says it is unmaintained and may be deprecated
  • License: AGPL-3.0. The LICENSE file is the standard version 3 text with the Free Software Foundation’s notice and no named copyright holder. Read it before you distribute or host a changed version

README and files

README

Khoj: setup notes

This kit holds setup notes only. Mindket wrote them. Khoj itself, its server and its clients come from the Khoj team's repository: https://github.com/khoj-ai/khoj

These notes are not made or endorsed by the Khoj team. The README says Khoj is "a personal AI app to extend your capabilities" and that it "smoothly scales up from an on-device personal AI to a cloud-scale enterprise AI." The documentation is at https://docs.khoj.dev

License: GNU Affero General Public License v3.0. GitHub lists it as AGPL-3.0, and the LICENSE file (https://github.com/khoj-ai/khoj/blob/master/LICENSE) is the standard version 3 text with the Free Software Foundation's notice and no named copyright holder. These notes do not explain the license: read it before you distribute or host a changed version.

The README and the docs also point to Khoj Cloud (https://app.khoj.dev) and an Enterprise option. These notes cover running Khoj yourself, with notes on its clients. Where a client page describes the cloud app, the note says so.

What installs

  • The Khoj server, from the khoj package on PyPI or from the Docker image ghcr.io/khoj-ai/khoj:latest. It serves the web app at http://localhost:42110 and a settings area called the admin panel.
  • With Docker Compose, the compose file also starts a PostgreSQL database with pgvector, a code sandbox (Terrarium), a SearXNG web search service and a Khoj "computer" container. See setup/docker.md.
  • With pip, the khoj[local] package, which the page starts with USE_EMBEDDED_DB="true" set. See setup/pip.md.
  • Optional clients that talk to your server: an Obsidian plugin, an Emacs package, a Desktop companion app and a web app you can install as a progressive web app. Khoj also runs a WhatsApp bot on Khoj Cloud, and the docs do not connect it to a self-hosted server. Source: https://docs.khoj.dev/features/all-features

What you need first

  • For Docker: Docker with Docker Compose. On Windows, WSL2 and Docker Desktop with the WSL2 backend. Source: https://docs.khoj.dev/get-started/setup
  • For pip: Python and pip. The PyPI entry (https://pypi.org/pypi/khoj/json) lists >=3.10,<3.13 for its Python version and the classifiers Python 3.10, 3.11 and 3.12. The setup page also points to llama-cpp-python's backend notes if the install hits a llama-cpp problem.
  • A chat model. Khoj talks to OpenAI, Anthropic or Gemini with your own API key, to a model server that speaks the OpenAI API (the docs name Ollama, LiteLLM and others), or to an offline model. The setup page lists these needs for the offline route: at least 8 GB of RAM (16 GB of VRAM recommended) and at least 5 GB of disk. See setup/chat-models.md.
  • Nothing else is required to chat. Search, notes sync, web search, code and voice each have their own settings.

Main install command

Docker is the first route the page gives. From a terminal (on Windows, a WSL2 terminal), make a folder and download the compose file:

mkdir ~/.khoj && cd ~/.khoj
wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml

Set the passwords and a chat model key in the file as setup/docker.md describes, then start it:

cd ~/.khoj
docker-compose up

The page says setup is complete when the server log shows 🌖 Khoj is ready to engage. Then open http://localhost:42110. The page also says to restart your Khoj server after the first run so every setting is applied. Source: https://docs.khoj.dev/get-started/setup

Per-platform notes

  • setup/docker.md: the Docker route on macOS, Windows and Linux, what the compose file runs, upgrade and removal
  • setup/pip.md: the pip route for macOS, Windows and Linux, GPU options, first run, auto start and troubleshooting
  • setup/chat-models.md: OpenAI, Anthropic, Gemini, offline models, Ollama, LiteLLM and other OpenAI-compatible servers
  • setup/obsidian.md: the Obsidian plugin
  • setup/emacs.md: the Emacs package
  • setup/desktop-and-web.md: the Desktop companion app, the web app, installing it as a progressive web app and uploading files
  • setup/whatsapp.md: the WhatsApp bot
  • setup/documents-and-search.md: ways to get your notes in, Notion, GitHub, search settings and query filters
  • setup/remote-and-login.md: reaching your server from another device, magic links, Google sign-in and Tailscale
  • setup/agents-automations-and-code.md: custom agents, automations by email, code execution and voice

Update or remove

To update the pip install, the Self-Host page gives:

pip install --upgrade khoj

For Docker, from the folder that holds your docker-compose.yml, the page gives:

cd ~/.khoj
docker-compose up --build

To remove the server, the page gives these for pip:

pip uninstall khoj
dropdb khoj -U postgres

For Docker, it gives the line below and says it removes the server containers, networks, images and volumes. Volumes hold the database, so this deletes your data.

docker-compose down --volumes

Clients are removed in the usual way for their app. Source: https://docs.khoj.dev/get-started/setup

Usage data

The Telemetry page says self-hosted Khoj collects high level, anonymized metadata: the client (Web, Emacs, Obsidian), API usage (Search, Chat), the configured content types (Github, Org and so on) and request metadata such as host and referrer. It says no personal information and nothing from or about your content is sent, and it links to the code in the repository's src/telemetry folder. To opt out, set this environment variable to True in your shell or in docker-compose.yml. Source: https://docs.khoj.dev/miscellaneous/telemetry

KHOJ_TELEMETRY_DISABLE=True

Where your data goes

The Self-Host page says your data never has to leave your private network, and that you can even use Khoj without an internet connection on a personal computer. The Chat page says a question is used to find the most relevant notes, and that those notes, the last few messages and some metadata go to the chat model you enabled along with the question. So with OpenAI, Anthropic or Gemini as the model, that text goes to the provider. With an offline or local model, it stays on your machine. This is Mindket's reading of those two pages. Sources: https://docs.khoj.dev/get-started/setup and https://docs.khoj.dev/features/chat

Sources

Files
README.md  7 KB
setup/agents-automations-and-code.md  6 KB
setup/chat-models.md  8 KB
setup/desktop-and-web.md  3 KB
setup/docker.md  5 KB
setup/documents-and-search.md  5 KB
setup/emacs.md  4 KB
setup/obsidian.md  2 KB
setup/pip.md  4 KB
setup/remote-and-login.md  6 KB
setup/whatsapp.md  1 KB

11 files, 51 KB, downloaded as a zip.

What’s new

  • Version 2 · 2026-11-09

    Updated by Mindket to the current version of this kit.

  • Version 1 · 2026-11-03

Reviews

No ratings yet

Write a review

No reviews yet.

What people say

Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.

110Show HN: Khoj – Chat offline with your second brain using Llama 2Hi folks, we're Debanjum and Saba. We created Khoj as a hobby project 2+ years ago because: (1) Search on the desktop sucked; we just had keyword search on the desktop vs google for the internet; and (2) Natural language search models had become good and easy to run on consumer hardware by this…565 points · 150 repliesTECH Overload🧠 FOSS Highlight: Khoj AI second brain — your private ChatGPT over your docs. Any local or cloud LLM. • Llama, GPT, Claude, Gemini • PDFs, Notion, Markdown RAG • Custom agents & automations • Web, Obsidian, WhatsApp 36k⭐ AGPL-3.0 Your AI, your data github.com/khoj-ai/khoj #FOSS #OpenSource #AI3 likes@RoundtableSpaceYou can build an AI that understands your own digital life without handing everything to one giant app 1. Khoj https://t.co/3iJs3WJSpD 2. Mem0 https://t.co/NsdbOI49NV 3. Paperless-ngx https://t.co/ZTgfIhhhj8 4. RAGFlow https://t.co/xRPHcBgQ25 5. Open WebUI https://t.co/SP0ZFyzl1g This one stack…r/opensourcevietnamTRỢ LÝ AI TỰ CHỦ BIẾT ĐỌC TÀI LIỆU VÀ TỰ NGHIÊN CỨU WEB: KHOJ LÀ SECOND BRAIN MÃ NGUỒN MỞ HOÀN HẢO CHO RESEARCHERtmshaplandAsk HN: Local RAG with private knowledge baseCheck out Khoj. https://github.com/khoj-ai/khojxanI found these github.com/khoj-ai/khoj github.com/brianpetro/o... github.com/logancyang/o...1 like · 1 reply@launch_llama14 open source AI repos you can build a business on: 1. Vercel AI SDK 2. Open WebUI 3. Dify 4. Flowise 5. Langflow (my personal fav) 6. RAGFlow 7. Mem0 8. Lobe Chat 9. Khoj 10. Ollama 11. Browser Use 12. Firecrawl 13. n8n 14. Vercel AI Chatbot Links in the reply 👇r/LocalLLMHow I Fixed Khoj + Ollama + Qwen2.5-VL 7B on Linux: Docker/UFW Timeout + Missing ChatModel + Booting AgentsgtirloniAsk HN: Looking for a simple note taking toolRelevant for OP's requirement of AI: https://github.com/khoj-ai/khojCVE AlertsCVE-2026-13508 - khoj-ai khoj Conversation Sharing api_chat.py authorization CVE ID : CVE-2026-13508 Published : June 28, 2026, 9:45 p.m. | 2 hours, 14 minutes ago Description : A flaw has been found in khoj-ai khoj up to 2.0.0-beta.28. This impacts an unknown function o...@RehanTemkar10 GITHUB REPOS FOR RUNNING A PRIVATE AI ASSISTANT ON YOUR MAC: 1. Open Interpreter https://t.co/3nFVt9m5Dc 2. PrivateGPT https://t.co/YXPhd4H4Q2 3. goose https://t.co/VaQNkojEAv 4. LocalAI https://t.co/9xHw2dgmoa 5. Fabric https://t.co/1ysyCKUu98 6. Vane (formerly Perplexica)…vunderbaShow HN: I made an app to use local AI as daily driverThere are already several RAG chat open source solutions available. Two that immediately come to mind are: Danswer https://github.com/danswer-ai/danswer Khoj https://github.com/khoj-ai/khoj

Searched

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar projects

See all in Productivity

Hermes Agent

NousResearch · Kit

Nous Research’s open source agent that you run in a terminal, in a desktop app or from a chat app. It keeps memory, writes skills from experience, runs schedul…

New261k

Dify

langgenius · Kit

LangGenius’s open-source platform for building LLM apps: visual workflows, RAG, model management and agents with a sandbox. Its difyctl tool and skill let Clau…

New161k

OpenHands Agent Canvas

OpenHands · Kit

OpenHands’ open source, self-hosted control center for coding agents. One browser app runs the OpenHands agent, Claude Code, Codex, Gemini CLI, Pi or OpenCode…

New92.8k