Mirror of khoj from Github
Find a file
sabaimran fdf78525b4
Part 2: Add web UI updates for basic agent interactions (#675)
* Initial pass at backend changes to support agents
- Add a db model for Agents, attaching them to conversations
- When an agent is added to a conversation, override the system prompt to tweak the instructions
- Agents can be configured with prompt modification, model specification, a profile picture, and other things
- Admin-configured models will not be editable by individual users
- Add unit tests to verify agent behavior. Unit tests demonstrate imperfect adherence to prompt specifications

* Customize default behaviors for conversations without agents or with default agents

* Add a new web client route for viewing all agents

* Use agent_id for getting correct agent

* Add web UI views for agents
- Add a page to view all agents
- Add slugs to manage agents
- Add a view to view single agent
- Display active agent when in chat window
- Fix post-login redirect issue

* Fix agent view

* Spruce up the 404 page and improve the overall layout for agents pages

* Create chat actor for directly reading webpages based on user message

- Add prompt for the read webpages chat actor to extract, infer
  webpage links
- Make chat actor infer or extract webpage to read directly from user
  message
- Rename previous read_webpage function to more narrow
  read_webpage_at_url function

* Rename agents_page -> agent_page

* Fix unit test for adding the filename to the compiled markdown entry

* Fix layout of agent, agents pages

* Merge migrations

* Let the name, slug of the default agent be Khoj, khoj

* Fix chat-related unit tests

* Add webpage chat command for read web pages requested by user

Update auto chat command inference prompt to show example of when to
use webpage chat command (i.e when url is directly provided in link)

* Support webpage command in chat API

- Fallback to use webpage when SERPER not setup and online command was
  attempted
- Do not stop responding if can't retrieve online results. Try to
  respond without the online context

* Test select webpage as data source and extract web urls chat actors

* Tweak prompts to extract information from webpages, online results

- Show more of the truncated messages for debugging context
- Update Khoj personality prompt to encourage it to remember it's capabilities

* Rename extract_content online results field to webpages

* Parallelize simple webpage read and extractor

Similar to what is being done with search_online with olostep

* Pass multiple webpages with their urls in online results context

Previously even if MAX_WEBPAGES_TO_READ was > 1, only 1 extracted
content would ever be passed.

URL of the extracted webpage content wasn't passed to clients in
online results context. This limited them from being rendered

* Render webpage read in chat response references on Web, Desktop apps

* Time chat actor responses & chat api request start for perf analysis

* Increase the keep alive timeout in the main application for testing

* Do not pipe access/error logs to separate files. Flow to stdout/stderr

* [Temp] Reduce to 1 gunicorn worker

* Change prod docker image to use jammy, rather than nvidia base image

* Use Khoj icon when Khoj web is installed on iOS as a PWA

* Make slug required for agents

* Simplify calling logic and prevent agent access for unauthenticated users

* Standardize to use personality over tuning in agent nomenclature

* Make filtering logic more stringent for accessible agents and remove unused method:

* Format chat message query

---------

Co-authored-by: Debanjum Singh Solanky <debanjum@gmail.com>
2024-03-26 18:13:24 +05:30
.github Free space on Github workflow VM to build Khoj docker images 2024-02-06 23:37:51 +05:30
documentation Default to gpt-4-turbo-preview for chat model, extract questions actor 2024-03-14 01:22:33 +05:30
scripts Fix bump_version.sh to commit, clean-up after desktop app version bump 2023-12-22 21:42:03 +05:30
src Part 2: Add web UI updates for basic agent interactions (#675) 2024-03-26 18:13:24 +05:30
tests Part 2: Add web UI updates for basic agent interactions (#675) 2024-03-26 18:13:24 +05:30
.dockerignore Use pypi khoj to fix docker builds and dockerize github workflow 2023-02-19 01:57:01 -06:00
.gitattributes Exclude tests data file from programming stats on Github 2023-08-28 11:00:52 -07:00
.gitignore [Multi-User Part 5]: Add a production Docker file and use a gunicorn configuration with it (#514) 2023-10-26 13:15:31 -07:00
.pre-commit-config.yaml Add isort to the pre-commit configuration and apply it to the whole project (#595) 2023-12-28 18:04:02 +05:30
docker-compose.yml Set default value of KHOJ_DEBUG to False in the docker-compose file 2024-03-01 21:51:13 +05:30
Dockerfile Remove unused git dependency from Docker images 2024-02-16 17:41:09 +05:30
gunicorn-config.py Part 2: Add web UI updates for basic agent interactions (#675) 2024-03-26 18:13:24 +05:30
LICENSE Change license to GNU AGPLv3 from GNU GPLv3 2023-11-16 11:14:06 -08:00
manifest.json Release Khoj version 1.7.0 2024-03-15 00:08:32 +05:30
prod.Dockerfile Part 2: Add web UI updates for basic agent interactions (#675) 2024-03-26 18:13:24 +05:30
pyproject.toml Update project URLs to show on pypi project page 2024-03-15 04:03:39 +05:30
pytest.ini Move the django app into the src/khoj folder for better organization and functionality 2023-11-21 10:56:04 -08:00
README.md Add num online for Discord badge 2024-03-10 17:48:30 +05:30
versions.json Release Khoj version 1.7.0 2024-03-15 00:08:32 +05:30

Khoj Logo

test dockerize pypi Discord

An AI personal assistant for your digital brain


Khoj is an AI application to search and chat with your notes and documents.
It is open-source, self-hostable and accessible on Desktop, Emacs, Obsidian, Web and Whatsapp.
It works with pdf, markdown, org-mode, notion files and github repositories.
It can paint, search the internet and understand speech.


🔎 Search 💬 Chat
Quickly retrieve relevant documents using natural language Get answers and create content from your existing knowledge base
Does not need internet Can be configured to work without internet

Contributors

Cheers to our awesome contributors! 🎉

Made with contrib.rocks.