Skip to main content
Khoj Chat is your intelligent conversation partner that combines the power of advanced language models with your personal knowledge base. Ask questions, brainstorm ideas, or get research assistance - all grounded in your documents when relevant.
Khoj Chat Interface

What Makes Khoj Chat Special

Context-Aware

Automatically retrieves relevant information from your documents using semantic search

Multi-Turn Conversations

Maintains context across messages for natural, flowing discussions

Source Citations

Shows exact references from your notes that informed each response

Online or Offline

Choose between cloud-based or local AI models based on your needs

Getting Started

1

Open Khoj Chat

Navigate to app.khoj.dev/chat in your browser
2

Ask Your Question

Type naturally - Khoj understands context and nuance. Try:
  • “What did I learn about machine learning last week?”
  • “Summarize my meeting notes from yesterday”
  • “Help me draft an email about project updates”
3

Review Sources

Click on any citation to see the exact document section Khoj referenced

Slash Commands

Control how Khoj responds by prefixing your message with these commands:
Forces Khoj to answer exclusively using your knowledge base, ignoring general knowledge.Example: /notes What did my dentist say about my treatment plan?
Use this when you want to be certain the answer comes from your notes
Prevents Khoj from searching your documents, relying only on the model’s training.Example: /general Explain quantum entanglement
Useful for factual questions unrelated to your personal information
Lets Khoj decide whether to use your notes or general knowledge (default behavior).Example: /default What are the best practices for documentation?
Researches current information online and incorporates it into the response.Example: /online What's the latest news on AI regulation?Learn more about Online Search →
Creates images based on your text description.Example: /image A serene mountain landscape at sunsetLearn more about Image Generation →
Generates visual diagrams using Excalidraw format.Example: /diagram Show the architecture of a microservices system
Generates and runs Python code for calculations or data analysis.Example: /code Calculate compound interest on $10,000 at 5% for 10 yearsLearn more about Code Execution →
Performs comprehensive research with multiple sources and deeper analysis.Example: /research What are the implications of quantum computing on cryptography?
Research mode takes longer but provides more thorough, well-sourced answers
Shows available commands and tips for using Khoj effectively.

File Filters

Limit which documents Khoj searches for relevant context.

Using the Sidebar (Web)

File Filters Panel
1

Open Filters Panel

Click the filter icon in the left sidebar of the chat interface
2

Select Documents

Check or uncheck specific files, folders, or document types
3

Chat Normally

Your filter selections apply to all messages in the current conversation

Using Query Filters

Add filter syntax directly in your message:
file:"project-notes.md" What were the action items?
dt>="last week" dt<="yesterday" Summarize my work
Full Query Filter Reference →

How It Works

1

Query Processing

Your question is analyzed to understand intent and extract key concepts
2

Retrieval (RAG)

Khoj searches your knowledge base using semantic similarity, finding contextually relevant passages even if they don’t contain exact keywords
3

Context Assembly

Retrieved notes, recent conversation history, and metadata are packaged together
4

Response Generation

The AI model generates a response using the assembled context and your query
5

Citation

Source documents are linked so you can verify and explore further
RAG (Retrieval-Augmented Generation) means Khoj first retrieves relevant information, then uses it to generate more accurate, grounded responses.

Best Practices

Instead of: “Tell me about the meeting”Try: “What decisions were made in yesterday’s product planning meeting?”
When you know which documents are relevant, filter to just those files for faster, more accurate results.
Follow up with clarifying questions. Khoj maintains conversation context:
  1. “Summarize my notes on machine learning”
  2. “What did I learn about neural networks specifically?”
  3. “Show me examples I saved”
Use multiple techniques in sequence:
  1. Start with /research for comprehensive information
  2. Ask /notes to see what you already know
  3. Use /code to perform calculations

Advanced Features

Vision Support

Khoj can analyze images you share in the conversation:
1

Upload Image

Click the image icon or drag and drop
2

Ask Questions

“What’s in this image?”, “Read the text from this screenshot”, “Describe this diagram”
Vision capabilities require compatible chat models (GPT-4V, Claude 3, Gemini Pro Vision, etc.)

Multi-Modal Conversations

Combine text, voice, and images in a single conversation:
You: [Image of whiteboard] What does this diagram show?
Khoj: This appears to be a system architecture diagram...
You: Can you convert this to a proper /diagram?
Khoj: [Generates Excalidraw diagram]

Self-Hosting Configuration

Self-hosted users can customize which AI models to use.See Setup Guide →
Fine-tune how many documents are retrieved and relevance thresholds.Navigate to: http://localhost:42110/server/admin/database/searchmodelconfig/

Troubleshooting

  • Ensure documents are synced (check the data sources page)
  • Try more specific queries
  • Use /notes to force document search
  • Verify file filters aren’t excluding relevant documents
  • Use the /notes command to focus on your knowledge
  • Add file filters to narrow the search scope
  • Provide more context in your question
  • Check your internet connection (for cloud models)
  • Consider using faster models in settings
  • Reduce the number of documents being searched with filters

Next Steps

Create Custom Agents

Build specialized AI assistants for different tasks

Try Voice Chat

Have spoken conversations with Khoj

Automate Research

Schedule recurring chats and receive insights via email

Share Conversations

Create public links to your chat sessions

Build docs developers (and LLMs) love