Khoj
Open-source, self-hostable personal AI application for Q&A, research, and automation using personal documents and the web.
At a Glance & Reviews
Community Discussions (2)
- Show HN: Khoj – Chat offline with your second brain using Llama 2 2023-07-30 · 565 pts
- Khoj: An AI personal assistant for your digital brain 2023-07-08 · 155 pts
About Khoj
Khoj is a self-hostable, open-source personal AI assistant positioned as the user's second brain. It addresses the problem of personal documents, notes, and saved content being scattered across different places, retrievable only through keywords and memory when needed. It brings the user's own documents and the public web together under a single Q&A entry point: once materials are indexed, users can search, ask questions, and follow up in natural language, and can turn any online or local large model into a personal assistant, with data able to run entirely on their own machine. The project repository was created in August 2021 and uses the AGPL-3.0 license. According to the official website, it can scale seamlessly from a standalone assistant on a personal computer to cloud-scale enterprise deployments, offering cloud, enterprise on-premises, and hybrid deployment options.
Chatting with models is its core capability. The models listed officially as connectable include local options such as Llama, Qwen, Gemma, and Mistral, as well as online options such as GPT, Claude, Gemini, and DeepSeek. Users choose based on their privacy requirements and budget: when self-hosting, offline models can run locally via Ollama and similar tools for fully offline use, or users can enter API keys from providers such as OpenAI, Anthropic, and Gemini to use commercial models. The official documentation summarizes the chat experience as faster than browsing search results one by one, enabling iterative exploration of old notes between answers, and connecting retrieval with content generation, while explicitly supporting both online and offline models.
Semantic search over personal documents is the core feature that sets it apart from general-purpose chat products. The materials it can understand and index include images, PDFs, Markdown, Org-mode, Word documents, plain text files, Notion pages, and GitHub repositories. Once indexed, advanced semantic search finds passages by meaning rather than keywords, and when self-hosting, all search and indexing happen locally, with documents never leaving the user's own network. Search results are fed as context to the selected model to generate cited answers, and users can also use search mode to quickly locate source text in a search-as-you-type fashion. Continuous syncing of files and folders is handled by the desktop client, Obsidian plugin, or Emacs client, keeping the index updated as materials change rather than freezing it at the point of a one-time import.
The agent feature lets users customize dedicated assistants for different roles. According to the official introduction, each agent can be configured with a custom knowledge scope, persona prompt, chat model, and available tools—for example, restricting an agent to the user's own paper library and answering questions with a research-assistant persona and a designated model. The official documentation states that the server's host can configure agents for all users, while regular users can also create their own agents. Starting a message with a slash command opens an experimental research mode, letting the assistant conduct deeper web research around a question. Beyond conversations, Khoj can also generate images, read messages aloud, and play voice replies, extending Q&A into content generation and voice interaction.
Automation is another central thread. The official documentation explains that automation can repeatedly execute a query at a set time and frequency, with research results delivered by email to the user's inbox—well suited to turning recurring information tracking into a personal digest, such as summarizing news on a topic on a schedule, monitoring new developments in a field of interest, or generating a custom newsletter. Self-hosted users need to configure the Resend email service and authentication separately according to the official documentation before automated tasks can send emails; the automation page allows centralized configuration, sharing, and deletion of created tasks, with scheduling executed according to the user's local timezone.
In terms of access methods, Khoj offers more entry points than most similar products. Officially supported interfaces include the web app, desktop app, Obsidian plugin, Emacs package, mobile, and WhatsApp, allowing the same person to call the same assistant and the same index from their note-taking editor, browser, or chat app. Its architecture is officially described as modular and pluggable, with new data sources, front-end interfaces, and models all connectable—also the reason it can maintain so many client forms at once. For developers, a self-hosted instance is itself a programmable service, with models, access addresses, and feature toggles adjustable from the admin panel.
Getting started follows two paths: cloud or self-hosting. For a quick trial, users can open the official cloud app, register, and start using it directly without installation; the official Q&A explicitly states that it can be used right away without self-hosting. Self-hosting follows the official documentation via Docker or pip: with Docker, first download the docker-compose file from the official repository, set the admin password, Django secret key, and optional admin email in it, fill in API keys for any commercial models as needed, or enable the configuration pointing to a local Ollama instance, then run docker compose up in the directory containing the compose file to start it; after startup, opening the web interface on local port 42110 allows users to begin chatting and configuring models and folders to index. With pip, installation and upgrades are both managed using pip commands. Afterwards, select a chat model in the admin interface, then sync local folders using the desktop, Obsidian, or Emacs client, or upload files directly in the web app; once indexing completes, users can ask questions about their own materials.
There are three main typical scenarios. First, a long-term knowledge base: continuously syncing years of notes, papers, and project documents, and using semantic search and conversation to trace where a viewpoint came from or to synthesize a theme across multiple sources. Second, scheduled research briefings: setting topics of interest as automated tasks that research online daily or weekly and send results to the user's inbox, reducing repetitive manual news-checking. Third, privacy-sensitive internal document Q&A: pairing local models in offline or intranet environments to process materials that are inconvenient to send externally, with all indexing and inference kept on the user's own machine.
Regarding pricing, Khoj's open-source self-hosted version is free to use, while the official website also offers a cloud app and cloud, on-premises, and hybrid deployment options for enterprises. This article does not draw pricing conclusions for its cloud and enterprise offerings; please refer to the official website and official pages for details. API fees incurred when using online commercial models are charged by the model providers and are unrelated to Khoj itself; running fully locally, the main costs are the user's own hardware and electricity.
The official documentation states one important limitation of self-hosting: its Docker image currently does not support running offline chat models on a GPU, and inference is slower in this setup; users who want to run offline models on a GPU should install via the local Python package instead. In addition, self-hosted automated emails depend on external email service configuration—if not configured correctly, tasks can run but briefings will not be sent, which should be verified during deployment.
Compared with general-purpose chat products that only support cloud-based conversations, Khoj's difference lies in being open-source and fully self-hostable, while bringing personal document semantic search, custom agents, and scheduled automation into a single assistant, and meeting users where they already work through multiple entry points such as Obsidian, Emacs, desktop, web, and WhatsApp. Compared with tools that similarly focus on local document Q&A, it places greater emphasis on continuous syncing across sources and scheduled research delivery, rather than merely uploading a batch of files for one-time Q&A; people who choose it are typically those who already have a structured collection of notes and literature and are willing to pay a one-time deployment cost in exchange for a long-term, controllable personal knowledge entry point.