2023-07-21 05:34:25 +00:00
### Khoj Chat
#### Overview
- Creates a personal assistant for you to inquire and engage with your notes
2023-07-29 17:49:40 +00:00
- You can choose to use Online or Offline Chat depending on your requirements
2023-07-21 05:34:25 +00:00
- Supports multi-turn conversations with the relevant notes for context
- Shows reference notes used to generate a response
2023-07-21 07:05:44 +00:00
2023-07-29 17:49:40 +00:00
### Setup
#### Offline Chat
Offline chat works without internet but it is slower, lower quality and more compute intensive.
2023-07-21 05:34:25 +00:00
2023-07-29 17:49:40 +00:00
!> **Warning** : This will download a 3Gb+ Llama v2 chat model which can take some time
2023-07-21 07:05:44 +00:00
2023-07-29 17:49:40 +00:00
- Open your [Khoj settings ](http://localhost:42110/config/ ), click *Enable* on the Offline Chat card
2023-07-21 07:05:44 +00:00
2023-07-30 02:17:40 +00:00
![Configure offline chat ](https://user-images.githubusercontent.com/6413477/257021364-8a2029f5-dc21-4de8-9af9-9ba6100d695c.mp4 ':include :type=mp4' )
2023-07-21 05:34:25 +00:00
2023-07-29 17:49:40 +00:00
#### 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 notes to OpenAI for processing
1. Get your [OpenAI API Key ](https://platform.openai.com/account/api-keys )
2. Open your [Khoj Online Chat settings ](http://localhost:42110/config/processor/conversation ), add your OpenAI API key, and click *Save* . Then go to your [Khoj settings ](http://localhost:42110/config ) and click `Configure` . This will refresh Khoj with your OpenAI API key.
![Configure online chat ](https://user-images.githubusercontent.com/6413477/256998908-ac26e55e-13a2-45fb-9348-3b90a62f7687.mp4 ':include :type=mp4' )
### Use
2023-07-21 07:05:44 +00:00
1. Open [/chat ](http://localhost:42110/chat )
2023-07-29 17:49:40 +00:00
2. Type your queries and see Khoj respond using your notes as reference
2023-07-21 05:34:25 +00:00
2023-07-21 22:22:35 +00:00
![](./assets/khoj_chat_on_web.png ':size=400px')
2023-07-21 05:34:25 +00:00
2023-07-29 17:49:40 +00:00
#### Details
2023-07-21 05:34:25 +00:00
1. Your query is used to retrieve the most relevant notes, if any, using Khoj search
2023-07-29 17:49:40 +00:00
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