mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
35b469e488
- No Khoj server setup required to start using Khoj from Obsidian, Emacs - Use tabs for install, upgrade in Emacs with different package managers - Use default subtitles in Khoj Docs - Deduplicate query filters, remove backend setup instructions in plugin pages - Remove stale Setup demo on Khoj Obsidian plugin docs
3.6 KiB
3.6 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 (Self-Hosting)
Offline Chat
Offline chat stays completely private and works without internet using open-source models.
System Requirements:
- Minimum 8 GB RAM. Recommend 16Gb VRAM
- Minimum 5 GB of Disk available
- A CPU supporting AVX or AVX2 instructions is required
- A Mac M1+ or Vulcan supported GPU should significantly speed up chat response times
- Open your Khoj offline settings and click Enable on the Offline Chat configuration.
- Open your Chat model options and add a new option for the offline chat model you want to use. Make sure to use
Offline
as its type. We currently only support offline models that use the Llama chat prompt format. We recommend usingmistral-7b-instruct-v0.1.Q4_0.gguf
.
!> Note: Offline chat is not supported for a multi-user scenario. The host machine will encounter segmentation faults if multiple users try to use offline chat at the same time.
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
- Get your OpenAI API Key
- Open your Khoj Online Chat settings. Add a new setting with your OpenAI API key, and click Save. Only one configuration will be used, so make sure that's the only one you have.
- Open your Chat model options and add a new option for the OpenAI chat model you want to use. Make sure to use
OpenAI
as its type.
Use
- 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>
- Enter your queries to chat with Khoj. Use slash commands and query filters to change what Khoj uses to respond
Details
- Your query is used to retrieve the most relevant notes, if any, using Khoj search
- 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