khoj/docs/chat.md
2023-10-22 19:04:23 -07:00

3 KiB

Khoj Chat

Overview

  • Creates a personal assistant for you to inquire and engage with your notes
  • You can choose to use Online or Offline Chat depending on your requirements
  • Supports multi-turn conversations with the relevant notes for context
  • Shows reference notes used to generate a response

Setup

Offline Chat

Offline chat stays completely private and works without internet. But it is slower, lower quality and more compute intensive.

System Requirements:

  • Open your Khoj settings and click Enable on the Offline Chat card

Configure offline chat

Online Chat

Online chat requires internet to use ChatGPT but is faster, higher quality and less compute intensive.

!> Warning: This will enable Khoj to send your chat queries and query relevant notes to OpenAI for processing

  1. Get your OpenAI API Key
  2. Open your Khoj Online Chat settings, add your OpenAI API key, and click Save. Then go to your Khoj settings and click Configure. This will refresh Khoj with your OpenAI API key.

Configure online chat

Use

  1. Open Khoj Chat
    • On Web: Open /chat in your web browser
    • On Obsidian: Search for Khoj: Chat in the Command Palette
    • On Emacs: Run M-x khoj <user-query>
  2. Enter your queries to chat with Khoj. Use slash commands and query filters to change what Khoj uses to respond

Details

  1. Your query is used to retrieve the most relevant notes, if any, using Khoj search
  2. These notes, the last few messages and associated metadata is passed to the enabled chat model along with your query to generate a response

Commands

Slash commands allows you to change what Khoj uses to respond to your query

  • /notes: Limit chat to only respond using your notes, not just Khoj's general world knowledge as reference
  • /general: Limit chat to only respond using Khoj's general world knowledge, not using your notes as reference
  • /default: Allow chat to respond using your notes or it's general knowledge as reference. It's the default behavior when no slash command is used
  • /help: Use /help to get all available commands and general information about Khoj