Lurker News
Hi folks, we're Debanjum and Saba. We created Khoj as a hobby project 2+ years ago because: (1) Search on the desktop sucked; we just had keyword search on the desktop vs google for the internet; and (2) Natural language search models had become good and easy to run on consumer hardware by this point.

Once we made Khoj search incremental, I completely stopped using the default incremental search (C-s) in Emacs. Since then Khoj has grown to support more content types, deeper integrations and chat (using ChatGPT). With Llama 2 released last week, chat models are finally good and easy enough to use on consumer hardware for the chat with docs scenario.
Khoj is a desktop application to search and chat with your personal notes, documents and images. It is accessible from within Emacs, Obsidian or your Web browser. It works with org-mode, markdown, pdf, jpeg files and notion, github repositories. It is open-source and can work without internet access (e.g on a plane).
Our chat feature allows you to extract answers and create content from your existing knowledge base. Example: "What was that book Trillian mentioned at Zaphod's birthday last week". We personally use the chat feature regularly to find links, names and addresses (especially on mobile) and collate content across multiple, messy notes. It works online or offline: you can chat without internet using Llama 2 or with internet using GPT3.5+ depending on your requirements.
Our search feature lets you quickly find relevant notes, documents or images using natural language. It does not use the internet. Example: Search for "bought flowers at grocery store" will find notes about "roses at wholefoods".
Quickstart:

  pip install khoj-assistant && khoj
See https://docs.khoj.dev/#/setup for detailed instructions

We also have desktop apps (in beta) at https://github.com/khoj-ai/khoj/releases/tag/0.10.0 if you want to try them out.
Please do try out Khoj and let us know if it works for your use cases? Looking forward to the feedback!

Comments (150) 37 threads

Earlier comments
smcleod2 replies#
I've been playing with Khoj for the past day - it's really neat, well done!

A few observations:
1. Telemetry is enabled by default, and may contain the API and chat queries. I've logged an issue for this along with some suggestions here: https://github.com/khoj-ai/khoj/issues/389
2. It would be advantageous to have configuration in the UI rather than baking it's YAML into the container image. (added a note on that in the aforementioned issue on Github).
3. It's not clear if you can bring your own models, e.g. can I configure a model from huggingface/gpt4all? if so, will it be automatically downloaded based on the name or should I put the .bin (and yaml?) in a volume somewhere?
4. AMD GPU/APU acceleration (CLBLAS) would be really nice, I've logged an issue for this feature request as well. https://github.com/khoj-ai/khoj/issues/390

sabaimran#
Thanks for the feedback! Much appreciated.

I responded in the issue, but I'll paste here as well for those also curious:
Khoj does not collect any search or chat queries. As mentioned in the docs, you can see our telemetry server[1]. If you see anything amiss, point it out to me and I'll hotfix it right away. You can see all the telemetry metadata right here[2].
[1]: https://github.com/khoj-ai/khoj/tree/master/src/telemetry
[2]: https://github.com/khoj-ai/khoj/blob/master/src/khoj/routers...
Configuration with the `docker-compose` setup is a little bit particular, see the issue^ for details.
Thanks for the reference points for GPU integration! Just to clarify, we do use GPU optimization for indexing, but not for local chat with Llama. We're looking into getting that working.

tmzt#
Would it be possible to support a custom URL for the local model, such as running ./server in ggml would give you?

This may be more difficult if you are pre-tokenizing the search context.
Very cool project.

LanternLight831 reply#
It's funny that you mention `C-s`, because `isearch-forward` is usually used for low-latency literal matches. In what workflow can Khoj offer acceptable latency or superior utility as a drop-in replacement for isearch? Is there an example of how you might use it to navigate a document?
1101 reply#
That's (almost) exactly what khoj search provides a search-as-you-type experience but with a natural language (instead of keyword) search interface.

My workflow looks like: 1. Search with Khoj search[1]: `C-c s s` RET 2. Use speed key to jump to relevant entry[2]: with `n n o 2`
[1]: `C-c s` is bound to `khoj` transient menu [2] https://orgmode.org/manual/Speed-Keys.html

Blackthorn1 reply#
Can you elaborate on that a little bit? When you search like that, what do you type in to find stuff in a programming language source file? I'd like to better understand this workflow, it seems interesting and I might be missing out.
110#
Firstly, my previous statement needs quite a lot of clarification:

Khoj works more like an incremental, natural language version of org-agenda-search (or projectile) rather than isearch.
You've to configure which files it should index first. You can then use natural language to search those files with a search-as-you-type experience.
This is not the same as isearch that just searches the current file for keyword matches.
Second, khoj doesn't index source code and the default search models don't work well with code files.
But yeah someone should implement a natural language isearch as a standalone tool (as suggested by parent comment). It'd be super-useful

RomanHauksson1 reply#
Awesome work, I've been looking for something like this. Any plans to support Logseq in the future?
btbuildem1 reply#
Heads up, docker build fails with:

#12 2.017 ERROR: Could not find a version that satisfies the requirement pyside6>=6.5.1 (from khoj-assistant) (from versions: none)
#12 2.017 ERROR: No matching distribution found for pyside6>=6.5.1
------
executor failed running [/bin/sh -c sed -i 's/dynamic = \["version"\]/version = "0.0.0"/' pyproject.toml && pip install --no-cache-dir .]: exit code: 1

sabaimran1 reply#
Darn, I've seen this error a couple of times. Can you drop a couple of details in this Github issue? https://github.com/khoj-ai/khoj/issues/391

I'm particularly interested in your OS/build environment.

btbuildem#
Sure thing! I left a comment.

The "buildx" flag gets me past that one, and to the next error:
#0 12.37 ERROR: Could not find a version that satisfies the requirement gpt4all>=1.0.7 (from khoj-assistant) (from versions: 0.1.5, 0.1.6, 0.1.7)
#0 12.37 ERROR: No matching distribution found for gpt4all>=1.0.7

Load more comments