### Install Khoj Assistant (Quick Start) Source: https://github.com/khoj-ai/khoj/wiki/Install-Khoj-on-Windows-🪟 Install the Khoj assistant package using pip. This is the primary command for the quick start installation. ```bash pip install khoj-assistant ``` -------------------------------- ### Start Khoj (Quick Start) Source: https://github.com/khoj-ai/khoj/wiki/Install-Khoj-on-Windows-🪟 Launch the Khoj application after installation. This command assumes Khoj has been successfully installed. ```bash khoj ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/desktop/README.md Installs all development dependencies for the project. Run this before starting the application. ```bash yarn install ``` -------------------------------- ### Setup Development Environment and Git Hooks Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Install Khoj, set up Git hooks for automatic code formatting and type checking on commit and push. Use the `--full` flag to also install Khoj Desktop and Obsidian client apps. ```shell ./scripts/dev_setup.sh ``` -------------------------------- ### Minimal Install Khoj.el with use-package Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/clients/emacs.md Configure Khoj.el using the `use-package` macro for minimal setup, including binding a key for quick access. Assumes MELPA Stable. ```elisp ;; Install Khoj client from MELPA Stable (use-package khoj :ensure t :pin melpa-stable :bind ("C-c s" . 'khoj) :config (setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY" khoj-server-url "https://app.khoj.dev")) ``` -------------------------------- ### Setup Khoj with Docker Source: https://context7.com/khoj-ai/khoj/llms.txt Sets up Khoj using Docker for multi-user, production-ready deployment. Requires creating a configuration directory, downloading docker-compose.yml, and editing it with secure credentials and API keys. Then, start the services with 'docker-compose up'. ```bash mkdir ~/.khoj && cd ~/.khoj wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml # Edit docker-compose.yml: # KHOJ_ADMIN_PASSWORD= # KHOJ_DJANGO_SECRET_KEY= # OPENAI_API_KEY= # or ANTHROPIC_API_KEY / GEMINI_API_KEY # # Uncomment OPENAI_BASE_URL to use Ollama on the host docker-compose up ``` -------------------------------- ### Run the Application Locally Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/desktop/README.md Starts the Khoj AI desktop application. Ensure all dependencies are installed first. ```bash yarn start ``` -------------------------------- ### Install WSL2 and Docker on Windows Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install WSL2 and Docker Desktop with WSL2 backend on Windows. Restart your machine after WSL2 installation. ```shell # Run in PowerShell wsl --install ``` -------------------------------- ### Start Local Development Server Source: https://github.com/khoj-ai/khoj/blob/master/documentation/README.md Starts a local development server for live preview. Changes are reflected without server restart. ```bash $ yarn start ``` -------------------------------- ### Direct Install Khoj.el Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/clients/emacs.md Install the Khoj Emacs client directly and set your API key and server URL. This is the most straightforward installation method. ```elisp ;; Install Khoj.el M-x package-install khoj ; Set your Khoj API key (setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY") (setq khoj-server-url "https://app.khoj.dev") ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/web/README.md Installs all necessary dependencies for the project using Bun. Run this command first to set up your development environment. ```bash bun install ``` -------------------------------- ### Install LiteLLM Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/advanced/litellm.md Install LiteLLM with the necessary proxy dependencies. This command is used to set up the LiteLLM proxy server. ```bash pip install litellm[proxy] ``` -------------------------------- ### Install Khoj using Quelpa in Emacs Source: https://github.com/khoj-ai/khoj/blob/master/tests/data/org/interface_emacs_readme.org Install the khoj package using Quelpa, specifying the URL for the khoj.el file. Ensure Quelpa and quelpa-use-package are installed. ```elisp (use-package khoj :quelpa (khoj :fetcher url :url "https://raw.githubusercontent.com/khoj-ai/khoj/master/interface/emacs/khoj.el") :bind ("C-c s" . 'khoj)) ``` -------------------------------- ### Install ToDesktop CLI Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/desktop/README.md Installs the ToDesktop command-line interface globally. This is a prerequisite for deploying the Electron app. ```bash yarn global add @todesktop/cli ``` -------------------------------- ### Install Dependencies and Build Plugin Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/obsidian/README.md Run these commands in the `src/interface/obsidian` directory to install project dependencies and build the Obsidian plugin. ```bash yarn install yarn build ``` -------------------------------- ### Run Docker Compose Source: https://github.com/khoj-ai/khoj/blob/master/src/khoj/app/README.md Use this command to start the Khoj application using Docker Compose. Ensure you have Docker and Docker Compose installed. ```bash docker-compose up ``` -------------------------------- ### Start Khoj Docker with Ollama Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/advanced/ollama.mdx Run this command in the directory containing your Khoj docker-compose.yml file after uncommenting OPENAI_BASE_URL. This starts Khoj and integrates it with your host's Ollama. ```bash # run below command in the directory where you downloaded the Khoj docker-compose.yml docker-compose up ``` -------------------------------- ### Install Khoj Server (Pip - Windows CPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Windows using CPU. ```shell # Install Khoj py -m pip install 'khoj[local]' ``` -------------------------------- ### Install Dependencies Source: https://github.com/khoj-ai/khoj/blob/master/documentation/README.md Installs project dependencies using Yarn. ```bash $ yarn ``` -------------------------------- ### Start Khoj with Docker Compose Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Start the Khoj server using Docker Compose. Ensure you are in the same directory as your docker-compose.yml file. ```shell cd ~/.khoj docker-compose up ``` -------------------------------- ### Install Docker and Docker Compose on MacOS Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Use Homebrew to install Docker and Docker Compose on MacOS. Ensure Docker Desktop is also installed. ```shell brew install --cask docker brew install docker-compose ``` -------------------------------- ### Install Khoj Server (Pip - Windows Vulkan GPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Windows, enabling VULKAN GPU acceleration. Set the CMAKE_ARGS environment variable before installation. ```shell # 1. To use VULCAN GPU $env:CMAKE_ARGS = "-DGGML_VULKAN=on" # 2. Install Khoj py -m pip install 'khoj[local]' ``` -------------------------------- ### Install Khoj Project Source: https://github.com/khoj-ai/khoj/blob/master/tests/data/org/main_readme.org Clone the repository, create a Conda environment, and activate it to set up the project. ```shell git clone https://github.com/khoj-ai/khoj && cd khoj conda env create -f environment.yml conda activate khoj ``` -------------------------------- ### Install Khoj Server (Pip - Linux Vulkan GPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Linux, enabling VULKAN GPU acceleration. Set CMAKE_ARGS and FORCE_CMAKE before installation. ```shell CMAKE_ARGS="-DGGML_VULKAN=on" FORCE_CMAKE=1 python -m pip install 'khoj[local]' ``` -------------------------------- ### Start LiteLLM Proxy with Mistral Tiny Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/advanced/litellm.md Start the LiteLLM proxy server, specifying the model to use and optionally dropping parameters. Ensure your Mistral API key is exported as an environment variable. ```bash export MISTRAL_API_KEY= litellm --model mistral/mistral-tiny --drop_params ``` -------------------------------- ### Install Rust for Tokenizer Dependency Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Use these commands to install Rust if `pip install khoj` fails due to the `tokenizers` dependency requiring Rust compilation. This is a common fix for build errors. ```shell brew install rustup rustup-init source ~/.cargo/env ``` -------------------------------- ### Install Khoj and Dependencies (Windows) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Clones the Khoj repository, sets up a Python virtual environment, and installs all necessary dependencies including extras for development on Windows. ```shell # Get Khoj Code git clone https://github.com/khoj-ai/khoj && cd khoj # Create, Activate Virtual Environment python3 -m venv .venv && .venv\Scripts\activate # Install Khoj for Development uv sync --all-extras ``` -------------------------------- ### Install Khoj and Dependencies (Linux) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Clones the Khoj repository, sets up a Python virtual environment, and installs all necessary dependencies including extras for development on Linux. ```shell # Get Khoj Code git clone https://github.com/khoj-ai/khoj && cd khoj # Create, Activate Virtual Environment python3 -m venv .venv && source .venv/bin/activate # Install Khoj for Development uv sync --all-extras ``` -------------------------------- ### Install Khoj Server (Pip - Windows NVIDIA GPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Windows, enabling NVIDIA (CUDA) GPU acceleration. Set the CMAKE_ARGS environment variable before installation. ```shell # 1. To use NVIDIA (CUDA) GPU $env:CMAKE_ARGS = "-DGGML_CUDA=on" # 2. Install Khoj py -m pip install 'khoj[local]' ``` -------------------------------- ### Install Khoj with Production Dependencies Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/advanced/authentication.mdx Use this command to install the production version of the Khoj package, which is required for Google OAuth integration. ```bash pip install khoj[prod] ``` -------------------------------- ### Start Khoj Application Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Run the Khoj application with verbose logging enabled. ```bash khoj -vv ``` -------------------------------- ### Install Khoj Package Source: https://github.com/khoj-ai/khoj/blob/master/tests/data/markdown/main_readme.md Install the Khoj package using pip. Ensure Python 3 and Miniconda are set up as dependencies. ```bash pip install khoj ``` -------------------------------- ### Install Khoj with Pip (Linux CPU) Source: https://context7.com/khoj-ai/khoj/llms.txt Installs Khoj for Linux systems with CPU-only support using pip. Assumes local, single-user, anonymous access. ```bash pip install 'khoj[local]' ``` -------------------------------- ### Start Khoj Server Source: https://github.com/khoj-ai/khoj/blob/master/src/khoj/app/README.md Starts the Khoj application server using FastAPI with Django as the ORM backend. The '--anonymous-mode' flag bypasses authentication for local development. ```bash python3 src/khoj/main.py --anonymous-mode ``` -------------------------------- ### Install Khoj and Dependencies (MacOS) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Clones the Khoj repository, sets up a Python virtual environment, and installs all necessary dependencies including extras for development on MacOS. ```shell # Get Khoj Code git clone https://github.com/khoj-ai/khoj && cd khoj # Create, Activate Virtual Environment python3 -m venv .venv && source .venv/bin/activate # For MacOS or zsh users run this uv sync --all-extras ``` -------------------------------- ### Install Khoj with Pip (macOS Apple Silicon) Source: https://context7.com/khoj-ai/khoj/llms.txt Installs Khoj with Metal support for macOS Apple Silicon using pip. Assumes local, single-user, anonymous access. ```bash CMAKE_ARGS="-DGGML_METAL=on" pip install 'khoj[local]' ``` -------------------------------- ### Run Docker Compose Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Start the Khoj server and database using Docker Compose in detached mode. ```shell docker-compose up -d ``` -------------------------------- ### Start Khoj Server Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Start the Khoj server with an embedded database and anonymous mode enabled. This command is used after installing Khoj via pip. ```shell USE_EMBEDDED_DB="true" khoj --anonymous-mode ``` -------------------------------- ### Set Ollama Environment Variable for Pip Install Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/advanced/ollama.mdx Before starting Khoj with pip, set the OPENAI_BASE_URL environment variable to point to your Ollama instance. Then, start Khoj in anonymous mode. ```bash export OPENAI_BASE_URL="http://localhost:11434/v1/" khoj --anonymous-mode ``` -------------------------------- ### Standard Install Khoj.el with custom indexing Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/clients/emacs.md Set up Khoj.el with `use-package`, specifying custom directories and files to be indexed. This allows for more targeted indexing of your notes. ```elisp ;; Install Khoj client from MELPA Stable (use-package khoj :ensure t :pin melpa-stable :bind ("C-c s" . 'khoj) :config (setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY" khoj-server-url "https://app.khoj.dev" khoj-index-directories '("~/docs/org-roam" "~/docs/notes") khoj-index-files '("~/docs/todo.org" "~/docs/work.org"))) ``` -------------------------------- ### Build and Serve Production Files Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/web/README.md Builds the project for production and serves the static files. This is useful for testing the production build locally before deployment. ```bash bun export ``` -------------------------------- ### Install Khoj with Pipx Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install Khoj using pipx to avoid dependency conflicts with other Python packages. This is recommended when encountering issues during pip installation. ```shell pipx install khoj ``` -------------------------------- ### Build and Serve Production Files (Windows) Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/web/README.md Builds the project for production and serves the static files. This command is specifically for Windows users. ```bash bun windowsexport ``` -------------------------------- ### Build the Electron App Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/desktop/README.md Triggers builds for all platforms after prompting for login. Ensure the ToDesktop CLI is installed and configured. ```bash todesktop build ``` -------------------------------- ### Get Notion Configuration Source: https://context7.com/khoj-ai/khoj/llms.txt Get the current Notion integration configuration. ```APIDOC ## GET /api/content/notion ### Description Get current Notion configuration. ### Method GET ### Endpoint /api/content/notion ### Request Example ```bash curl -s "http://localhost:42110/api/content/notion" \ -H "Authorization: Bearer " ``` ``` -------------------------------- ### Build Front-end Assets Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Navigates to the web interface directory, installs front-end dependencies using Bun, and exports the production build of the front-end assets. ```shell cd src/interface/web/ bun install bun export ``` -------------------------------- ### Upgrade Khoj Installation Source: https://context7.com/khoj-ai/khoj/llms.txt Provides commands to upgrade Khoj installations, both for pip and Docker. ```bash pip install --upgrade khoj # pip ``` ```bash docker-compose up --build # Docker ``` -------------------------------- ### Install Khoj Server (Pip - Linux AMD GPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Linux, enabling AMD (ROCm) GPU acceleration. Set CMAKE_ARGS and FORCE_CMAKE before installation. ```shell CMAKE_ARGS="-DGGML_HIPBLAS=on" FORCE_CMAKE=1 python -m pip install 'khoj[local]' ``` -------------------------------- ### Install Khoj Server (Pip - Linux NVIDIA GPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Linux, enabling NVIDIA (CUDA) GPU acceleration. Set CMAKE_ARGS and FORCE_CMAKE before installation. ```shell CMAKE_ARGS="-DGGML_CUDA=on" FORCE_CMAKE=1 python -m pip install 'khoj[local]' ``` -------------------------------- ### Install Khoj Server (Pip - Windows AMD GPU) Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/get-started/setup.mdx Install the Khoj server package with local support on Windows, enabling AMD (ROCm) GPU acceleration. Set the CMAKE_ARGS environment variable before installation. ```shell # 1. To use AMD (ROCm) GPU $env:CMAKE_ARGS = "-DGGML_HIPBLAS=on" # 2. Install Khoj py -m pip install 'khoj[local]' ``` -------------------------------- ### Run Development Server Source: https://github.com/khoj-ai/khoj/blob/master/src/interface/web/README.md Starts the Next.js development server. This command allows for hot-reloading and live updates as you edit your code. ```bash bun dev ``` -------------------------------- ### Install Postgres with PgVector on Debian/Ubuntu Source: https://github.com/khoj-ai/khoj/blob/master/src/khoj/app/README.md Installs PostgreSQL and the PgVector extension on Debian or Ubuntu systems. This is a prerequisite for the Khoj database. ```bash sudo apt install -y postgresql-common sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh sudo apt install postgres-16 postgresql-16-pgvector ``` -------------------------------- ### Run Development Server for Obsidian Plugin Source: https://github.com/khoj-ai/khoj/blob/master/documentation/docs/contributing/development.mdx Execute this command in the `src/interface/obsidian` directory to start the development server. It will continuously rebuild the plugin as code changes are made. ```shell yarn dev ```