mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Update docs with setup instructions for Offline and Online Chat
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<p align="center"><img src="src/khoj/interface/web/assets/icons/khoj-logo-sideways.svg" width="230" alt="Khoj Logo"></p>
|
<p align="center"><img src="src/khoj/interface/web/assets/icons/khoj-logo-sideways.svg" width="230" alt="Khoj Logo"></p>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[](https://github.com/khoj-ai/khoj/actions/workflows/test.yml)
|
[](https://github.com/khoj-ai/khoj/actions/workflows/test.yml)
|
||||||
[](https://github.com/khoj-ai/khoj/pkgs/container/khoj)
|
[](https://github.com/khoj-ai/khoj/pkgs/container/khoj)
|
||||||
[](https://pypi.org/project/khoj-assistant/)
|
[](https://pypi.org/project/khoj-assistant/)
|
||||||
@@ -25,11 +25,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
Khoj is a desktop application to search and chat with your notes, documents and images. <br />
|
Khoj is a desktop application to search and chat with your notes, documents and images.<br />
|
||||||
It is an offline-first, open source AI personal assistant.
|
It is an offline-first, open source AI personal assistant accessible from your Emacs, Obsidian or Web browser.<br />
|
||||||
|
It works with jpeg, markdown, notion, org-mode, pdf files and github repositories.<br />
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
|
|||||||
43
docs/chat.md
43
docs/chat.md
@@ -1,36 +1,37 @@
|
|||||||
### Khoj Chat
|
### Khoj Chat
|
||||||
#### Overview
|
#### Overview
|
||||||
- Creates a personal assistant for you to inquire and engage with your notes
|
- Creates a personal assistant for you to inquire and engage with your notes
|
||||||
- Uses [ChatGPT](https://openai.com/blog/chatgpt) and [Khoj search](/#/search). [Offline chat](https://github.com/khoj-ai/khoj/issues/201) is coming soon.
|
- You can choose to use Online or Offline Chat depending on your requirements
|
||||||
- Supports multi-turn conversations with the relevant notes for context
|
- Supports multi-turn conversations with the relevant notes for context
|
||||||
- Shows reference notes used to generate a response
|
- Shows reference notes used to generate a response
|
||||||
|
|
||||||
!> **Warning**: This will enable Khoj to send your query and note(s) to OpenAI for processing
|
### Setup
|
||||||
|
#### Offline Chat
|
||||||
|
Offline chat works without internet but it is slower, lower quality and more compute intensive.
|
||||||
|
|
||||||
#### Setup
|
!> **Warning**: This will download a 3Gb+ Llama v2 chat model which can take some time
|
||||||
- Get your [OpenAI API Key](https://platform.openai.com/account/api-keys)
|
|
||||||
- Add your OpenAI API to Khoj by using either of the two options below:
|
|
||||||
|
|
||||||
- Open your [Khoj 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.
|
- Open your [Khoj settings](http://localhost:42110/config/), click *Enable* on the Offline Chat card
|
||||||
|
|
||||||
- Set `openai-api-key` field under `processor.conversation` section in your `khoj.yml` @ `~/.khoj/khoj.yml` to your [OpenAI API key](https://beta.openai.com/account/api-keys) and restart khoj:
|

|
||||||
```diff
|
|
||||||
processor:
|
|
||||||
conversation:
|
|
||||||
- openai-api-key: # "YOUR_OPENAI_API_KEY"
|
|
||||||
+ openai-api-key: sk-aaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhh
|
|
||||||
model: "text-davinci-003"
|
|
||||||
chat-model: "gpt-3.5-turbo"
|
|
||||||
conversation-logfile: "~/.khoj/processor/conversation/conversation_logs.json"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Use
|
#### 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.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
### Use
|
||||||
1. Open [/chat](http://localhost:42110/chat)
|
1. Open [/chat](http://localhost:42110/chat)
|
||||||
2. Type your queries and see response by Khoj from your notes
|
2. Type your queries and see Khoj respond using your notes as reference
|
||||||
|
|
||||||
#### Demo
|
|
||||||

|

|
||||||
|
|
||||||
### Details
|
#### Details
|
||||||
1. Your query is used to retrieve the most relevant notes, if any, using Khoj search
|
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 ChatGPT along with your query for a response
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user