mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Simplify setup, features since Khoj cloud in docs
- No Khoj server setup required to start using Khoj from Obsidian, Emacs - Use tabs for install, upgrade in Emacs with different package managers - Use default subtitles in Khoj Docs - Deduplicate query filters, remove backend setup instructions in plugin pages - Remove stale Setup demo on Khoj Obsidian plugin docs
This commit is contained in:
137
docs/emacs.md
137
docs/emacs.md
@@ -1,6 +1,6 @@
|
||||
<h1><img src="./assets/khoj-logo-sideways-500.png" width="200" alt="Khoj Logo">Emacs</h1>
|
||||
<h1><img src="./assets/khoj-logo-sideways-500.png" width="200" alt="Khoj Logo"> Emacs</h1>
|
||||
|
||||
> An AI personal assistance for your digital brain
|
||||
> An AI copilot for your Second Brain in Emacs
|
||||
|
||||
<img src="https://stable.melpa.org/packages/khoj-badge.svg" width="150" alt="Melpa Stable Badge">
|
||||
<img src="https://melpa.org/packages/khoj-badge.svg" width="150" alt="Melpa Badge">
|
||||
@@ -10,14 +10,13 @@
|
||||
|
||||
|
||||
## 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**: 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
|
||||
- **Chat**
|
||||
- **Faster answers**: Find answers faster than search
|
||||
- **Iterative discovery**: Iteratively explore and (re-)discover your notes
|
||||
- **Assisted creativity**: Smoothly weave across answer retrieval and content generation
|
||||
|
||||
## Interface
|
||||
#### Search
|
||||
@@ -27,79 +26,76 @@
|
||||

|
||||
|
||||
## Setup
|
||||
- *Make sure [python](https://realpython.com/installing-python/) and [pip](https://pip.pypa.io/en/stable/installation/) are installed on your machine*
|
||||
1. Generate an API key on the [Khoj Web App](https://app.khoj.dev/config#clients)
|
||||
2. Add below snippet to your Emacs config file, usually at `~/.emacs.d/init.el`
|
||||
|
||||
- *khoj.el attempts to automatically install, start and configure the khoj server.*
|
||||
If this fails, follow [these instructions](/setup) to manually setup the khoj server.
|
||||
|
||||
### Direct Install
|
||||
<!-- tabs:start -->
|
||||
|
||||
#### **Direct Install**
|
||||
*Khoj will index your org-agenda files, by default*
|
||||
|
||||
```elisp
|
||||
;; Install Khoj.el
|
||||
M-x package-install khoj
|
||||
|
||||
; Set your Khoj API key
|
||||
(setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY")
|
||||
```
|
||||
|
||||
### Minimal Install
|
||||
Add below snippet to your Emacs config file.
|
||||
Indexes your org-agenda files, by default.
|
||||
#### **Minimal Install**
|
||||
*Khoj will index your org-agenda files, by default*
|
||||
|
||||
```elisp
|
||||
;; Install Khoj Package from MELPA Stable
|
||||
(use-package khoj
|
||||
:ensure t
|
||||
:pin melpa-stable
|
||||
:bind ("C-c s" . 'khoj))
|
||||
```
|
||||
|
||||
- Note: Install `khoj.el` from MELPA (instead of MELPA Stable) if you installed the pre-release version of khoj
|
||||
- That is, use `:pin melpa` to install khoj.el in above snippet if khoj server was installed with `--pre` flag, i.e `pip install --pre khoj-assistant`
|
||||
- Else use `:pin melpa-stable` to install khoj.el in above snippet if khoj was installed with `pip install khoj-assistant`
|
||||
- This ensures both khoj.el and khoj app are from the same version (git tagged or latest)
|
||||
|
||||
### Standard Install
|
||||
Add below snippet to your Emacs config file.
|
||||
Indexes the specified org files, directories. Sets up OpenAI API key for Khoj Chat
|
||||
|
||||
```elisp
|
||||
;; Install Khoj Package from MELPA Stable
|
||||
;; Install Khoj client from MELPA Stable
|
||||
(use-package khoj
|
||||
:ensure t
|
||||
:pin melpa-stable
|
||||
:bind ("C-c s" . 'khoj)
|
||||
:config (setq khoj-org-directories '("~/docs/org-roam" "~/docs/notes")
|
||||
khoj-org-files '("~/docs/todo.org" "~/docs/work.org")
|
||||
khoj-openai-api-key "YOUR_OPENAI_API_KEY")) ; required to enable chat
|
||||
:config (setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY"))
|
||||
```
|
||||
|
||||
### With [ Straight.el](https://github.com/raxod502/straight.el)
|
||||
Add below snippet to your Emacs config file.
|
||||
Indexes the specified org files, directories. Sets up OpenAI API key for Khoj Chat
|
||||
#### **Standard Install**
|
||||
*Configures the specified org files, directories to be indexed by Khoj*
|
||||
|
||||
```elisp
|
||||
;; Install Khoj Package using Straight.el
|
||||
(use-package khoj
|
||||
:after org
|
||||
:straight (khoj :type git :host github :repo "khoj-ai/khoj" :files (:defaults "src/interface/emacs/khoj.el"))
|
||||
:bind ("C-c s" . 'khoj)
|
||||
:config (setq khoj-org-directories '("~/docs/org-roam" "~/docs/notes")
|
||||
khoj-org-files '("~/docs/todo.org" "~/docs/work.org")
|
||||
khoj-openai-api-key "YOUR_OPENAI_API_KEY" ; required to enable chat)
|
||||
```
|
||||
;; Install Khoj client from MELPA Stable
|
||||
(use-package khoj
|
||||
:ensure t
|
||||
:pin melpa-stable
|
||||
:bind ("C-c s" . 'khoj)
|
||||
:config (setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY"
|
||||
khoj-org-directories '("~/docs/org-roam" "~/docs/notes")
|
||||
khoj-org-files '("~/docs/todo.org" "~/docs/work.org")))
|
||||
```
|
||||
|
||||
#### **Straight.el**
|
||||
*Configures the specified org files, directories to be indexed by Khoj*
|
||||
|
||||
```elisp
|
||||
;; Install Khoj client using Straight.el
|
||||
(use-package khoj
|
||||
:after org
|
||||
:straight (khoj :type git :host github :repo "khoj-ai/khoj" :files (:defaults "src/interface/emacs/khoj.el"))
|
||||
:bind ("C-c s" . 'khoj)
|
||||
:config (setq khoj-api-key "YOUR_KHOJ_CLOUD_API_KEY"
|
||||
khoj-org-directories '("~/docs/org-roam" "~/docs/notes")
|
||||
khoj-org-files '("~/docs/todo.org" "~/docs/work.org")))
|
||||
```
|
||||
|
||||
<!-- tabs:end -->
|
||||
## Use
|
||||
### Search
|
||||
See [Khoj Search](/search) for details
|
||||
1. Hit `C-c s s` (or `M-x khoj RET s`) to open khoj search
|
||||
|
||||
2. Enter your query in natural language
|
||||
|
||||
e.g "What is the meaning of life?", "My life goals for 2023"
|
||||
2. Enter your query in natural language<br/>
|
||||
E.g *"What is the meaning of life?"*, *"My life goals for 2023"*
|
||||
|
||||
### Chat
|
||||
See [Khoj Chat](/chat) for details
|
||||
1. Hit `C-c s c` (or `M-x khoj RET c`) to open khoj chat
|
||||
|
||||
2. Ask questions in a natural, conversational style
|
||||
|
||||
E.g "When did I file my taxes last year?"
|
||||
|
||||
See [Khoj Chat](/#/chat) for more details
|
||||
2. Ask questions in a natural, conversational style<br/>
|
||||
E.g *"When did I file my taxes last year?"*
|
||||
|
||||
### Find Similar Entries
|
||||
This feature finds entries similar to the one you are currently on.
|
||||
@@ -108,7 +104,6 @@ This feature finds entries similar to the one you are currently on.
|
||||
|
||||
### Advanced Usage
|
||||
- Add [query filters](https://github.com/khoj-ai/khoj/#query-filters) during search to narrow down results further
|
||||
|
||||
e.g `What is the meaning of life? -"god" +"none" dt>"last week"`
|
||||
|
||||
- Use `C-c C-o 2` to open the current result at cursor in its source org file
|
||||
@@ -121,31 +116,21 @@ This feature finds entries similar to the one you are currently on.
|
||||

|
||||
Hit `C-c s` (or `M-x khoj`) to open the khoj menu above. Then:
|
||||
- Hit `t` until you preferred content type is selected in the khoj menu
|
||||
|
||||
`Content Type` specifies the content to perform `Search`, `Update` or `Find Similar` actions on
|
||||
- Hit `n` twice and then enter number of results you want to see
|
||||
|
||||
`Results Count` is used by the `Search` and `Find Similar` actions
|
||||
- Hit `-f u` to `force` update the khoj content index
|
||||
|
||||
The `Force Update` switch is only used by the `Update` action
|
||||
|
||||
## Upgrade
|
||||
### Upgrade Khoj Backend
|
||||
```bash
|
||||
pip install --upgrade khoj-assistant
|
||||
```
|
||||
### Upgrade Khoj.el
|
||||
Use your Emacs package manager to upgrade `khoj.el`
|
||||
<!-- tabs:start -->
|
||||
|
||||
- For `khoj.el` from MELPA
|
||||
- Method 1
|
||||
- Run `M-x package-list-packages` to list all packages
|
||||
- Press `U` on `khoj` to mark it for upgrade
|
||||
- Press `x` to execute the marked actions
|
||||
- Method 2
|
||||
- Run `M-x package-refresh-content`
|
||||
- Run `M-x package-reinstall khoj`
|
||||
#### **With MELPA**
|
||||
1. Run `M-x package-refresh-content`
|
||||
2. Run `M-x package-reinstall khoj`
|
||||
|
||||
- For `khoj.el` from Straight
|
||||
- Run `M-x straight-pull-package khoj`
|
||||
#### **With Straight.el**
|
||||
- Run `M-x straight-pull-package khoj`
|
||||
|
||||
<!-- tabs:end -->
|
||||
|
||||
Reference in New Issue
Block a user