Skip to main content

Obsidian Plugin

The Khoj plugin for Obsidian lets you chat with and search your notes directly from your Obsidian vault. Your notes are automatically synced and indexed for instant access. Obsidian Khoj Demo

Features

Chat

  • Faster answers: Find answers quickly from your private notes or the public internet
  • Assisted creativity: Smoothly weave across retrieving answers and generating content
  • Iterative discovery: Iteratively explore and re-discover your notes

Search

  • Natural language: Advanced natural language understanding using Transformer-based ML models
  • Incremental search: Fast, search-as-you-type experience
  • Context-aware: Searches within your Obsidian vault

Find Similar Notes

Discover notes similar to the one you’re currently reading.

Auto-Sync

Your Obsidian vault is automatically synced periodically with Khoj.

Installation

1

Open Community Plugins

In Obsidian, navigate to SettingsCommunity plugins.
2

Search for Khoj

Click Browse and search for “Khoj” or visit the Khoj plugin page.
3

Install and Enable

  1. Click Install on the Khoj plugin page
  2. Click Enable to activate the plugin
See the official Obsidian Plugin Docs for more details on installing community plugins.

Configuration

Khoj Cloud Setup

1

Generate API Key

Go to the Khoj Web App Settings and generate an API key.
2

Open Plugin Settings

In Obsidian, go to SettingsCommunity pluginsKhoj settings.
3

Enter API Key

Paste your API key in the Khoj API Key field and save.
4

Force Sync (Optional)

Click Force Sync to immediately sync your vault with Khoj.
By default, your vault is automatically synced periodically. Force sync is useful for immediate indexing after installation.

Self-Hosted Setup

If you’re running your own Khoj server, follow these configuration steps.
1

Open Plugin Settings

Navigate to SettingsCommunity pluginsKhoj.
2

Set Server URL

Configure the Khoj URL field:
http://127.0.0.1:42110
3

API Key (Optional)

Leave the Khoj API Key field empty if your server runs in anonymous mode:
khoj --anonymous-mode
Otherwise, generate and enter an API key from your self-hosted instance.

Usage

Chat

Access Khoj chat directly from Obsidian:
Click the Khoj chat icon 💬 on the Ribbon (left sidebar).
Ask questions in a natural, conversational style:
When did I file my taxes last year?
See the Chat Features documentation for advanced chat capabilities and tips.
Perform natural language search across your vault:
1

Open Search

Press Ctrl/Cmd + P and run Khoj: Search.
2

Enter Query

Type your search query in natural language.Examples:
  • “My life goals for 2023”
  • “Notes about machine learning”
  • “What is the meaning of life?”
3

View Results

Khoj will display relevant notes and sections from your vault.

Query Filters

Use advanced filters to refine your search:
"project ideas" file:"work"
Learn more about query filters in the Query Filters documentation.

Find Similar Notes

Discover related content while reading:
1

Open a Note

Navigate to any note in your vault.
2

Run Command

Press Ctrl/Cmd + P and run Khoj: Find Similar Notes.
3

Browse Results

Khoj will display notes with similar content or themes.
This is great for discovering connections between notes and exploring your knowledge graph.

Keyboard Shortcuts

Set up custom keyboard shortcuts for quick access:
  1. Go to SettingsHotkeys
  2. Search for “Khoj”
  3. Assign shortcuts to your preferred commands:
CommandSuggested ShortcutDescription
Khoj: ChatCtrl/Cmd + K, COpen chat
Khoj: SearchCtrl/Cmd + K, SOpen search
Khoj: Find Similar NotesCtrl/Cmd + K, FFind similar

Sync Behavior

Understanding how sync works helps you get the most out of the Khoj plugin.

Automatic Sync

  • Your vault is automatically synced periodically in the background
  • New notes and changes are detected and indexed automatically
  • No manual intervention required for day-to-day use

Manual Sync

Use Force Sync when you need immediate indexing:
  1. Open plugin settings
  2. Click Force Sync
  3. Wait for confirmation
Useful scenarios:
  • After installing the plugin
  • After importing many new notes
  • When search results seem stale
Force syncing a large vault may take several minutes. The plugin will notify you when complete.

Troubleshooting

  1. Open the Khoj plugin settings
  2. Verify your API key is correct
  3. Toggle Disable then Enable on the plugin
  4. Try restarting Obsidian
  1. Open plugin settings
  2. Click Force Sync to refresh the index
  3. Wait for sync to complete
  4. Try your search again
For Khoj Cloud:
  • Verify the Khoj URL is set to https://app.khoj.dev
  • Check your internet connection
  • Verify your API key is valid
For self-hosted:
  • Ensure your Khoj server is running
  • Verify the server URL and port
  • Check firewall settings
For large vaults (1000+ notes):
  • Initial sync may take several minutes
  • Subsequent syncs are incremental and faster
  • Close and reopen Obsidian if sync appears stuck
  • Check the Obsidian developer console for errors (Ctrl/Cmd + Shift + I)

Updating the Plugin

1

Check for Updates

Go to SettingsCommunity plugins and click Check for updates.
2

Update Khoj

If an update is available, click Update next to the Khoj plugin.
3

Restart (Optional)

Restart Obsidian if prompted to complete the update.
Enable automatic updates in Obsidian settings to always have the latest features and bug fixes.

Privacy and Data

Khoj Cloud

Your notes are encrypted in transit (HTTPS) and indexed securely on Khoj’s servers. See our Privacy Policy for details.

Self-Hosted

When self-hosting, all data remains on your infrastructure. You have complete control over your notes and index.

Next Steps

Chat Features

Explore advanced chat capabilities

Search

Master natural language search

Query Filters

Learn advanced search syntax

Desktop App

Sync other files and folders

Build docs developers (and LLMs) love