2024-01-07 15:58:15 +01:00
---
sidebar_position: 2
---
# Chat
2024-06-18 08:44:59 +02:00
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.
2024-09-12 04:57:01 +02:00
< img src = "https://assets.khoj.dev/vision_chat_example.png" alt = "Chat on Web" style = {{width: ' 400px ' } } / >
2024-01-07 15:58:15 +01:00
2023-11-19 02:25:52 +01:00
### Overview
2024-06-18 08:44:59 +02:00
- Creates a personal assistant for you to inquire and engage with your notes or online information as needed
2023-07-29 19:49:40 +02:00
- You can choose to use Online or Offline Chat depending on your requirements
2023-07-21 07:34:25 +02:00
- Supports multi-turn conversations with the relevant notes for context
- Shows reference notes used to generate a response
2023-07-21 09:05:44 +02:00
2023-11-17 00:26:03 +01:00
### Setup (Self-Hosting)
2024-09-12 04:57:01 +02:00
See [the setup guide ](/get-started/setup.mdx ) to configure your chat models.
2023-07-29 19:49:40 +02:00
### Use
2023-08-28 19:43:17 +02:00
1. Open Khoj Chat
2023-11-17 00:26:03 +01:00
- **On Web**: Open [/chat ](https://app.khoj.dev/chat ) in your web browser
2023-08-28 19:43:17 +02:00
- **On Obsidian**: Search for *Khoj: Chat* in the [Command Palette ](https://help.obsidian.md/Plugins/Command+palette )
- **On Emacs**: Run `M-x khoj <user-query>`
2024-01-07 20:02:23 +01:00
2. Enter your queries to chat with Khoj. Use [slash commands ](#commands ) and [query filters ](/miscellaneous/advanced#query-filters ) to change what Khoj uses to respond
2023-07-21 07:34:25 +02:00
2023-07-29 19:49:40 +02:00
#### Details
2024-09-12 04:57:01 +02:00
1. Your query is used to retrieve the most relevant notes, if any, using Khoj search using RAG.
2023-07-29 19:49:40 +02: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
2023-08-28 19:43:17 +02:00
2024-06-18 08:44:59 +02:00
#### Conversation File Filters
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/advanced#query-filters ) to limit the notes used in the chat response.
2024-09-12 04:57:01 +02:00
< img src = "/img/file_filters_conversation.png" alt = "Conversation File Filter" style = {{width: ' 400px ' } } / >
2024-06-18 08:44:59 +02:00
2023-08-28 19:43:17 +02:00
#### 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
2024-01-07 15:58:15 +01:00
- **/online**: Use online information and incorporate it in the prompt to the LLM to send you a response.
- **/image**: Generate an image in response to your query.
2023-08-28 19:43:17 +02:00
- **/help**: Use /help to get all available commands and general information about Khoj
2024-06-20 08:38:01 +02:00
- **/summarize**: Can be used to summarize 1 selected file filter for that conversation. Refer to [File Summarization ](summarization ) for details.