chat.md
1 --- 2 sidebar_position: 2 3 --- 4 5 # Chat 6 7 You can configure Khoj to chat with you about anything. When relevant, it'll use any notes or documents you shared with it to respond. It acts as an excellent research assistant, search engine, or personal tutor. 8 9 <img src="https://assets.khoj.dev/vision_chat_example.png" alt="Chat on Web" style={{width: '400px'}}/> 10 11 ### Overview 12 - Creates a personal assistant for you to inquire and engage with your notes or online information as needed 13 - You can choose to use Online or Offline Chat depending on your requirements 14 - Supports multi-turn conversations with the relevant notes for context 15 - Shows reference notes used to generate a response 16 17 ### Setup (Self-Hosting) 18 See [the setup guide](/get-started/setup.mdx) to configure your chat models. 19 20 ### Use 21 1. Open Khoj Chat 22 - **On Web**: Open [/chat](https://app.khoj.dev/chat) in your web browser 23 - **On Obsidian**: Search for *Khoj: Chat* in the [Command Palette](https://help.obsidian.md/Plugins/Command+palette) 24 - **On Emacs**: Run `M-x khoj <user-query>` 25 2. Enter your queries to chat with Khoj. Use [slash commands](#commands) and [query filters](/miscellaneous/query-filters) to change what Khoj uses to respond 26 27 28 #### Details 29 1. Your query is used to retrieve the most relevant notes, if any, using Khoj search using RAG. 30 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 31 32 #### Conversation File Filters 33 You can use conversation file filters to limit the notes used in the chat response. To do so, use the left panel in the web UI. Alternatively, you can also use [query filters](/miscellaneous/query-filters) to limit the notes used in the chat response. 34 35 <img src="/img/file_filters_conversation.png" alt="Conversation File Filter" style={{width: '400px'}}/> 36 37 #### Commands 38 Slash commands allows you to change what Khoj uses to respond to your query 39 - **/notes**: Limit chat to only respond using your notes, not just Khoj's general world knowledge as reference 40 - **/general**: Limit chat to only respond using Khoj's general world knowledge, not using your notes as reference 41 - **/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 42 - **/online**: Use online information and incorporate it in the prompt to the LLM to send you a response. 43 - **/image**: Generate an image in response to your query. 44 - **/help**: Use /help to get all available commands and general information about Khoj 45 - **/diagram**: Generate a diagram in response to your query. This is built on [Excalidraw](https://excalidraw.com/). 46 - **/code**: Generate and run very simple Python code snippets. Refer to [Code Execution](code_execution) for details. 47 - **/research**: Go deeper in a topic for more accurate, in-depth responses.