๐Ÿค–AI RepoIndex
๐Ÿ”ง AI ProductivityOpen SourceFree

Khoj

AI second brain โ€” self-hosted RAG with web search, agents, and automation

4.7/ 5โญ 35,767 GitHub starsPythonAGPL-3.0

๐Ÿ“‹ Overview

Khoj is an open-source AI second brain that indexes your documents (markdown, PDFs, org-mode, Notion, Google Drive) and makes them searchable via natural language โ€” with built-in web search, custom agents, scheduling, and deep research. Unlike Obsidian AI or Notion AI (which lock you into their ecosystem), Khoj connects to your existing tools and works with any LLM (GPT-4, Claude, Gemini, Llama, Mistral, Qwen). It supports offline LLMs via Ollama/Llama.cpp for full data sovereignty, and the agent system can schedule automations, run deep research, and generate images. Available as a web app, Obsidian plugin, Emacs package, WhatsApp bot, and desktop app.

โœจ Key Features

  • โ€ข35K+ GitHub stars โ€” most popular open-source AI second brain
  • โ€ขMulti-source ingestion: markdown, PDFs, org-mode, Notion, Google Drive
  • โ€ขWorks with any LLM: GPT-4, Claude, Gemini, Llama, Mistral, Qwen
  • โ€ขOffline mode via Ollama/Llama.cpp โ€” full data sovereignty
  • โ€ขBuilt-in web search: Brave, DuckDuckGo, Perplexity
  • โ€ขAgent system: scheduled automations, deep research, image generation
  • โ€ขMulti-platform: web, Obsidian plugin, Emacs, WhatsApp, desktop

๐ŸŽฏ The Problem It Solves

Your knowledge is scattered across notes, docs, emails, and bookmarks โ€” traditional search finds keywords, not meaning. Khoj indexes everything into a vector DB and lets you ask natural language questions against your entire personal knowledge base, with web search fallback and agent-driven automation.

๐Ÿ”ง How It Works

Khoj ingests documents from multiple sources (local files, Notion, Google Drive, markdown, PDFs, org-mode), chunks and embeds them into a vector database, and serves retrieval-augmented generation (RAG) queries via any LLM. The agent system supports multi-step reasoning, scheduled automations (daily digests, research monitoring), and deep research (multi-source synthesis). Web search (Brave, DuckDuckGo) supplements your local knowledge. Offline mode uses Ollama/Llama.cpp for air-gapped deployments.

๐Ÿš€ Installation & Quick Start

Installation

docker run -p 42110:42110 ghcr.io/khoj-ai/khoj:latest

Quick Start

  1. docker compose up
  2. Point to your documents
  3. Ask questions
  4. Create search agents

โœ… Pros

  • โ€ขMost comprehensive document ingestion โ€” connects to everything
  • โ€ขAny LLM support โ€” no vendor lock-in
  • โ€ขOffline mode for air-gapped deployments
  • โ€ขBuilt-in web search supplements local knowledge
  • โ€ขAgent system with scheduled automations
  • โ€ขMulti-platform: Obsidian, Emacs, WhatsApp, desktop
  • โ€ขSelf-hosted is completely free

โŒ Cons

  • โ€ขSelf-hosting requires PostgreSQL + vector DB โ€” not lightweight
  • โ€ขUI is functional but not polished
  • โ€ขFree cloud tier has tight query limits
  • โ€ขComplex multi-step agents can be slow
  • โ€ขAGPL-3.0 license has commercial use restrictions

๐Ÿ’ฌ Practitioner Verdict

โ€œKhoj is the most practical AI knowledge base for power users โ€” the multi-source ingestion is best-in-class, the Obsidian/Emacs integrations are genuinely useful, and the offline LLM support is unmatched. The trade-off: self-hosting requires PostgreSQL and a vector DB, the UI is functional but not polished, and the free cloud tier has tight query limits. For researchers, writers, and anyone with a large personal knowledge base, Khoj is the default.โ€
1

Self-Hosted (Free)

Open source, MIT/Apache licensed. Run it yourself.

โญ Star & Clone on GitHub

Free forever. Your infrastructure, your data.

2

Khoj Cloud Free

Limited queries, basic features

Free
  • Limited queries
  • Basic agents
  • Community support
โ˜๏ธ Get Started with Khoj Cloud Free
2

Khoj Cloud Pro

Unlimited queries, priority

0/mo
  • Unlimited queries
  • Priority support
  • Advanced agents
โ˜๏ธ Get Started with Khoj Cloud Pro
2

Enterprise

SSO, VPC, dedicated

Custom
  • SSO
  • VPC
  • Dedicated support
โ˜๏ธ Get Started with Enterprise

๐Ÿ“Š Specifications

Language
Python
License
AGPL-3.0
Platform
Linux, macOS, Windows
Supported Models
REST API, CLI

๐Ÿ’ฐ Pricing Reality

Self-hosted is 100% free AGPL-3.0. Cloud: Free tier (limited queries), Pro 0/mo (unlimited queries, priority), Enterprise custom (SSO, VPC, dedicated). LLM API usage billed separately unless using offline models.

๐Ÿ‘ฅ Community Health

Stars35,767
Forks4,470
Contributors715
Health Score9/10

๐Ÿท๏ธ Tags

Open SourceFree