mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +00:00
We need the index file paths to make sense on the khoj backend server Having path of index on backend relative to current vault directory on frontend ignores the fact that the frontend maybe on a different machine than the khoj backend server Using unique index name per vault allows switching vaults without overwriting indices of other vaults created on khoj backend when khoj obsidian plugin is loaded on opening a different vault
Khoj Obsidian 🦅
Natural language search for your Obsidian notes using Khoj
Table of Contents
Features
- Natural: Advanced natural language understanding using Transformer based ML Models
- Local: Your personal data stays local. All search, indexing is done on your machine*
- Incremental: Incremental search for a fast, search-as-you-type experience
Demo
https://user-images.githubusercontent.com/6413477/210486007-36ee3407-e6aa-4185-8a26-b0bfc0a4344f.mp4
Description
- Install Khoj via
pipand start Khoj backend in non-gui mode - Install Khoj plugin via Community Plugins settings pane on Obsidian app
- Check the new Khoj plugin settings
- Let Khoj backend index the markdown files in the current Vault
- Open Khoj plugin on Obsidian via Search button on Left Pane
- Search "Announce plugin to folks" in the Obsidian Plugin docs
- Jump to the search result
Interface
Setup
1. Setup Backend
pip install khoj-assistant && khoj --no-gui
2. Setup Plugin
- Open Community plugins tab in Obsidian settings panel
- Click Browse and Search for Khoj
- Click Install, after that click Enable on the Khoj plugin
See official docs for details
Use
Click the Khoj search icon 🔎 on the Ribbon or Search for Khoj: Search in the Command Palette
Query Filters
Use structured query syntax to filter the natural language search results
- Word Filter: Get entries that include/exclude a specified term
- Entries that contain term_to_include:
+"term_to_include" - Entries that contain term_to_exclude:
-"term_to_exclude"
- Entries that contain term_to_include:
- Date Filter: Get entries containing dates in YYYY-MM-DD format from specified date (range)
- Entries from April 1st 1984:
dt:"1984-04-01" - Entries after March 31st 1984:
dt>="1984-04-01" - Entries before April 2nd 1984 :
dt<="1984-04-01"
- Entries from April 1st 1984:
- File Filter: Get entries from a specified file
- Entries from incoming.org file:
file:"incoming.org"
- Entries from incoming.org file:
- Combined Example
what is the meaning of life? file:"1984.org" dt>="1984-01-01" dt<="1985-01-01" -"big" -"brother"- Adds all filters to the natural language query. It should return entries
- from the file 1984.org
- containing dates from the year 1984
- excluding words "big" and "brother"
- that best match the natural language query "what is the meaning of life?"
Upgrade
1. Upgrade Backend
pip install --upgrade khoj-assistant
2. Upgrade Plugin
- Open Community plugins tab in Obsidian settings
- Click the Check for updates button
- Click the Update button next to Khoj, if available
Troubleshooting
- Open the Khoj plugin settings pane, in case you need to configure Khoj
- Toggle Enable/Disable Khoj, in case settings changes have not applied
Implementation
The plugin implements the following functionality to search your notes with Khoj:
- Open the Khoj search modal via left ribbon icon or the Khoj: Search command
- Render results as Markdown preview to improve readability
- Configure Khoj via the plugin setting tab on the settings page
- Set Obsidian Vault to Index with Khoj. Defaults to all markdown files in current Vault
- Set URL of Khoj backend
- Set Number of Search Results to show in Search Modal
- Allow user to trigger reranking of result to improve search quality
