Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
We have query filters already built in to Khoj. Oftentimes, users will want to limit their conversations to a specific file/files.
To start with, add support for limiting the query to set of files.
If a user has uploaded a file within that conversation session, automatically set that as part of the file filter.
UI Changes
Here's some inspiration for the file picker potentially. You'll want a dropdown with a list of all the files the user's uploaded to the Khoj instance. Here's a basic tutorial on dropdowns with filters:
You can add it in underneath the Connected notice.
Backend Changes
In the backend, you'll want to modify this conversation object and add a field which will consist of a list of strings holding the file filters:
Describe the feature you'd like
We have query filters already built in to Khoj. Oftentimes, users will want to limit their conversations to a specific file/files.
To start with, add support for limiting the query to set of files.
If a user has uploaded a file within that conversation session, automatically set that as part of the file filter.
UI Changes
Here's some inspiration for the file picker potentially. You'll want a dropdown with a list of all the files the user's uploaded to the Khoj instance. Here's a basic tutorial on dropdowns with filters:
You can add it in underneath the Connected notice.
Backend Changes
In the backend, you'll want to modify this conversation object and add a field which will consist of a list of strings holding the file filters:
To apply this change, you'll have to run
python3 src/khoj/manage.py makemigrations
to create the new field in the Postgres DB.If a query lands on
api_chat
and its associated conversation has a query filter, you'll want to go ahead and add in those filters explicitly in the extract references method. Use the query filter documentation and the syntax in the unit tests to understand how to do this.