2024-01-07 14:58:15 +00:00
---
sidebar_position: 2
---
# Chat
2024-06-18 06:44:59 +00: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 02:57:01 +00:00
< img src = "https://assets.khoj.dev/vision_chat_example.png" alt = "Chat on Web" style = {{width: ' 400px ' } } / >
2024-01-07 14:58:15 +00:00
2023-11-19 01:25:52 +00:00
### Overview
2024-06-18 06:44:59 +00:00
- Creates a personal assistant for you to inquire and engage with your notes or online information as needed
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-11-16 23:26:03 +00:00
### Setup (Self-Hosting)
2024-09-12 02:57:01 +00:00
See [the setup guide ](/get-started/setup.mdx ) to configure your chat models.
2023-07-29 17:49:40 +00:00
### Use
2023-08-28 17:43:17 +00:00
1. Open Khoj Chat
2023-11-16 23:26:03 +00:00
- **On Web**: Open [/chat ](https://app.khoj.dev/chat ) in your web browser
2023-08-28 17:43:17 +00: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 19:02:23 +00: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 05:34:25 +00:00
2023-07-29 17:49:40 +00:00
#### Details
2024-09-12 02:57:01 +00:00
1. Your query is used to retrieve the most relevant notes, if any, using Khoj search using RAG.
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
2023-08-28 17:43:17 +00:00
2024-06-18 06:44:59 +00: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 02:57:01 +00:00
< img src = "/img/file_filters_conversation.png" alt = "Conversation File Filter" style = {{width: ' 400px ' } } / >
2024-06-18 06:44:59 +00:00
2023-08-28 17:43:17 +00: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 14:58:15 +00: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 17:43:17 +00:00
- **/help**: Use /help to get all available commands and general information about Khoj
2024-06-20 06:38:01 +00:00
- **/summarize**: Can be used to summarize 1 selected file filter for that conversation. Refer to [File Summarization ](summarization ) for details.