explaingit

khoj-ai/khoj

Analysis updated 2026-06-20

34,411PythonAudience · generalComplexity · 3/5LicenseSetup · moderate

TLDR

Khoj is a self-hostable personal AI assistant that chats with your own documents, PDFs, and notes, and works with local or cloud AI models. Think of it as a private second brain that knows your files, not just the internet.

Mindmap

mindmap
  root((repo))
    AI Models
      Local via Ollama
      GPT and Claude
      Gemini and Llama
    Document Search
      PDFs and Word docs
      Markdown files
      Obsidian vaults
      Notion pages
    Custom Agents
      Custom persona
      Scoped documents
      Project roles
    Automations
      Scheduled research
      Web search
      Email newsletter
    Access Points
      Web interface
      Mobile and desktop
      Obsidian plugin
      WhatsApp
    Deployment
      Self-hosted Docker
      Cloud hosted
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Chat with your own PDFs, notes, and work documents using any AI model, without uploading files to a third-party service.

USE CASE 2

Build a private second brain that searches your Obsidian vault or Notion pages before answering questions.

USE CASE 3

Set up a daily automated briefing that researches topics on the web and emails you a summary newsletter.

USE CASE 4

Create specialized AI agents for different projects, each with its own persona and access to specific documents.

What is it built with?

PythonDockerOllamaPostgreSQLFastAPISemantic SearchObsidian PluginEmacs Plugin

How does it compare?

khoj-ai/khojfacebookresearch/detectron2posthog/posthog
Stars34,41134,45034,321
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/54/54/5
Audiencegeneralresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Easiest start is Docker. Requires choosing an AI model (Ollama for local, or an API key for cloud). Document indexing is configured after setup.

Open-source license, you can use, modify, and self-host it freely. Check the repo for exact license terms.

In plain English

Khoj is a self-hostable personal AI assistant that acts as a second brain, a single place to chat with AI models, search across your own documents, automate research tasks, and build custom AI agents. The core problem it addresses is that commercial AI assistants like ChatGPT only know what's in their training data: they cannot search your personal notes, PDFs, or work documents, and you cannot run them on your own hardware for privacy. Khoj bridges that gap. The system connects to a wide range of AI models, local models running on your machine through tools like Ollama, as well as cloud models like GPT, Claude, Gemini, or Llama, and lets you chat with whichever you prefer. Beyond plain conversation, Khoj indexes your documents (PDFs, Markdown files, Word documents, Notion pages, Obsidian vaults) and uses semantic search to find relevant passages before answering your question, so the AI can ground its answers in your actual files. You can create custom agents with a specific persona, a specific model, and a specific subset of your documents, essentially building a specialized assistant for different roles or projects. Scheduled automations let you set up recurring research tasks, for example, a daily briefing that searches the web, summarizes findings, and emails you a newsletter. Access is available through a web interface, a desktop app, a mobile app, Obsidian and Emacs plugins, and WhatsApp. You can self-host it on your own computer for complete privacy, or use the hosted cloud version at app.khoj.dev for a no-setup experience. You would use Khoj if you want an AI assistant that knows your personal knowledge base, respects your data privacy, and works with the AI model of your choice. It is a Python application, open-source under an open license, and deployable via Docker.

Copy-paste prompts

Prompt 1
I want to self-host Khoj using Docker so I can chat with my personal PDF and Markdown files. Walk me through the setup step by step, including how to index my documents folder.
Prompt 2
How do I connect Khoj to a local Ollama model instead of a cloud API like OpenAI, so all my data stays on my own machine?
Prompt 3
I use Obsidian for my notes. How do I install and configure the Khoj Obsidian plugin so I can ask questions across my entire vault?
Prompt 4
Help me create a Khoj scheduled automation that searches the web every morning for news on a topic I care about and sends me an email digest.
Prompt 5
I want to build a custom Khoj agent that acts as a project assistant and only has access to documents in one specific folder. How do I set that up?

Frequently asked questions

What is khoj?

Khoj is a self-hostable personal AI assistant that chats with your own documents, PDFs, and notes, and works with local or cloud AI models. Think of it as a private second brain that knows your files, not just the internet.

What language is khoj written in?

Mainly Python. The stack also includes Python, Docker, Ollama.

What license does khoj use?

Open-source license, you can use, modify, and self-host it freely. Check the repo for exact license terms.

How hard is khoj to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is khoj for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub khoj-ai on gitmyhub

Verify against the repo before relying on details.