Commit Graph

550 Commits

Author SHA1 Message Date
Debanjum
d0a933b072 Add email based rate limiting to email login API endpoint
Server:
 - Rate limit based on unverified email before creating user
 - Check email address for deliverability before creating user
 - Track rate limit for unverified email in new non-user keyed table

Web app:
 - Show error in login popup to user on failure/throttling
 - Simplify login popup logic by moving magic link handling logic
   into EmailSigninContext instead of passing require props via parent
2025-04-11 17:49:18 +05:30
Debanjum
2935ea52cf Set chatSidebar prompt, Setting name fields to empty str if value null
TextArea and Input field values cannot be null.
2025-04-10 19:59:01 +05:30
Debanjum
aea7b90fec Track if agent modified in chatSidebar to simplify code, fix looping
Previously the sidebar could recurse on opening chat page (from home?)
due to child modelSelector component updating parent chatSidebar prop
which was passed back down to it in a loop.

The chatSidebar decides if agent has been modified in a single
useEffect and enables the Save button accordingly.
- Track agent modification wrt agent info received from server in
  chatSidebar instead.
- Reduce modelSelector's mandate to just notify
  when the user changes the model.

- Fix to infer, show & update agent state from chat sidebar on web app
  This logic is fragile and convoluted because:
  - the default agent chat model is dynamically determined.
  - need to disambiguate tools not set vs none set vs all set by user
    The default agent's tool selection is stored as undefined to show
    not set scenario, which allows for all tools to be dynamically
    used by  agent.
    But the user can also set no tools or all tools for their agents.
    All 3 scenarios are handled differently.
  - Track tools to be displayed vs tools to be stored
2025-04-10 19:59:01 +05:30
Debanjum
e9ee9004fb Suppress spurious dark mode hydration warnings on the web app
This is triggered by mismatch between "dark" class present on server
sent layout but not in client sent layout on initial render.

That mismatch exists because the server applies dark-mode styling
early to avoid FOUC flickering of UX.

Related 43e032e
2025-04-10 19:59:01 +05:30
Debanjum
9ab5ead3ca Set key for chatMessage parent to get UX efficiently updated by react
By fixing the no key prop in ChatHistory error on web app
2025-04-10 19:59:01 +05:30
Debanjum
1ad7314fe6 Let only root next.js layout handle html, body tags, not child layouts
Remove html, body elements from child page layouts. Let only the root
layout handle it.

Next.js router structure mounts child layouts inside parent layouts,
as defined by their directory hierarchy. So the html, body component
should only be defined in the parent layout.

This avoids the child layout mounting its html, body component within
the actual root layout's existing html, body component.
2025-04-10 19:59:01 +05:30
sabaimran
2ae8c62547 Repopulate the client API-key generation section 2025-04-07 06:54:47 -07:00
sabaimran
abfdf7b1fb Temporarily remove the OTP feature on the settings page while we fix our number 2025-04-03 19:41:18 -05:00
Debanjum
5b8c2989d6 Add hover text on button to unshare a conversation on web app 2025-03-31 15:32:43 +05:30
Debanjum
e9132d4fee Support attaching programming language file types to web app for chat 2025-03-29 01:22:35 +05:30
Debanjum
9dfa7757c5 Unshare public conversations from the title pane on web app
Only show the unshare button on public conversations created by the
currently logged in user. Otherwise hide the button

Set conversation.isOwner = true only if currently logged in user
shared the current conversation.

This isOwner information is passed by the get shared conversation API
endpoint
2025-03-25 14:05:29 +05:30
Debanjum
f15a95dccf Show Khoj agent in agent dropdown by default on mobile in web app home
Previously on slow connection you'd see the agent dropdown flicker
from undefined to Khoj default agent on phones and other thin screens.

This is unnecessary and jarring. Populate with default agent to remove
this issue
2025-03-20 12:27:52 +05:30
Debanjum
9a0b126f12 Allow chat input on web app while Khoj responds to speed interactions
Previously the chat input area didn't allow inputting text while Khoj is
researching and generating response.

This change allows the user to add their next text while Khoj
responds. This should speed up interaction cycles as user can have
their next query ready to send when Khoj finishes its response.
2025-03-19 23:08:22 +05:30
sabaimran
ce60cb9779 Remove max-w 80vw, which was smushing AI responses 2025-03-13 13:44:05 -07:00
sabaimran
a3c4347c11 Add a one-click action to export all conversations. Add a self-service delete account action to the settings page 2025-03-12 23:54:02 -07:00
Debanjum
b692e690b4 Rename and fix the delete content source API endpoint
- Delete file objects on deleting content by source via API
  Previously only entries were deleted, not the associated file objects
- Add new db adapter to delete multiple file objects (by name)
2025-03-07 13:28:53 +05:30
sabaimran
7089ea1cf4 Remove experimental parenthesis from research mode ✁ 2025-02-18 08:59:12 +05:30
Debanjum
5dfb59e1ee Show more references in teaser ref section of chat response on web app 2025-02-15 14:11:17 +05:30
sabaimran
b6e745336b Add s short description to explain what the create agent button does 2025-02-13 14:08:50 -08:00
sabaimran
848a91313d Move the create agent button to the bottom of the sidebar and fix experience when resetting settings 2025-02-12 19:24:02 -08:00
sabaimran
d0d30ace06 Add feature to create a custom agent directly from the side panel with currently configured settings
- Also, when in not subscribed state, fallback to the default model when chatting with an agent
- With conversion, create a brand new agent from inside the chat view that can be managed separately
2025-02-12 18:24:41 -08:00
sabaimran
589b047d90 Simplify agent picker selection in homepage mobile view 2025-02-10 15:05:30 -08:00
sabaimran
427ec061b4 Add auto redirect on delete of current conversation 2025-02-09 11:38:44 -08:00
sabaimran
031bccb628 Fix awkward padding in chat window 2025-02-06 16:31:25 -08:00
sabaimran
43e032e25a Improve handling of dark mode theme in order to avoid jitter when loading new page 2025-02-06 16:17:58 -08:00
sabaimran
0d10c5fb02 Improve default selection of models to avoid infinite loops 2025-02-04 11:36:41 -08:00
sabaimran
4409a58794 set initial model of default state 2025-02-03 18:17:21 -08:00
sabaimran
51874c25d5 Prevent infinite loops in model selection logic by configuring an initial model state 2025-02-03 18:11:01 -08:00
sabaimran
489fa71143 Update the width for rending all conversation sessions 2025-02-03 15:49:43 -08:00
sabaimran
61e48d686e Let file context buttons route to search page instead of settings for upload/manage 2025-02-02 12:26:13 -08:00
sabaimran
b4c467cd11 Remove shadows from reference panel trigger icons 2025-02-02 12:23:19 -08:00
sabaimran
a3d75e5241 When in mobile view, don't use the hover card in the model selector 2025-02-02 12:22:45 -08:00
sabaimran
08bc1d3bcb Improve sizing / spacing of side bar 2025-02-01 14:25:45 -08:00
sabaimran
f3b2580649 Add back hover state with collapsed references 2025-02-01 14:03:17 -08:00
sabaimran
641f1bcd91 Only open the side bar automatically when there is no chat history && no pending messages. 2025-01-30 16:07:27 -08:00
sabaimran
98e3f5162a Show generated diagram raw code if fails rendering 2025-01-29 21:49:33 -08:00
sabaimran
b5f99dd103 Rename custom instructions -> instructions 2025-01-29 15:06:22 -08:00
sabaimran
0ff33d4347 Merge branch 'master' of github.com:khoj-ai/khoj into features/add-chat-controls 2025-01-29 14:58:15 -08:00
sabaimran
d640299edc use is_active property for determine user subscription status 2025-01-29 14:10:59 -08:00
sabaimran
e2bfd4ac0f Change name of teams section to teams 2025-01-29 12:52:10 -08:00
sabaimran
58f77edcad Make conversation sessions rounded-lg 2025-01-29 12:47:36 -08:00
sabaimran
0b2305d8f2 Add an animation to opening and closing the thought process 2025-01-29 12:47:14 -08:00
sabaimran
01faae0299 Simplify the train of thought UI 2025-01-28 22:00:09 -08:00
sabaimran
59f0873232 Rename train of thought button 2025-01-28 21:32:21 -08:00
sabaimran
272764d734 Simplify the chat response / user message bubbles 2025-01-28 21:17:56 -08:00
sabaimran
b61226779e Simplify references section with icons in chat message 2025-01-28 18:13:26 -08:00
sabaimran
58879693f3 Simplify nav menu and add a teams section 2025-01-28 18:12:50 -08:00
sabaimran
e076ebd133 Make tools section of sidebar a popover to prevent increasing height 2025-01-28 18:12:13 -08:00
sabaimran
dc6e9e8667 Skip showing hidden agents in the all conversations agent filter 2025-01-21 12:43:34 -08:00
sabaimran
e3e93e091d automatically open the side bar when a new chat is created with the default agent. 2025-01-21 11:56:06 -08:00