khoj 1.32.3.dev34__py3-none-any.whl → 1.32.3.dev61__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. khoj/database/adapters/__init__.py +14 -1
  2. khoj/interface/compiled/404/index.html +1 -1
  3. khoj/interface/compiled/_next/static/chunks/1010-8f39bb4648b5ba10.js +1 -0
  4. khoj/interface/compiled/_next/static/chunks/4124-f5c857c57e5391d9.js +1 -0
  5. khoj/interface/compiled/_next/static/chunks/5427-b52d95253e692bfa.js +1 -0
  6. khoj/interface/compiled/_next/static/chunks/5477-0bbddb79c25a54a7.js +1 -0
  7. khoj/interface/compiled/_next/static/chunks/{3175-b2e522f8ca392f7e.js → 6293-469dd16402ea8a6f.js} +2 -2
  8. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e49165209d2e406c.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/app/agents/page-f6f93b8b4457f1f7.js +1 -0
  10. khoj/interface/compiled/_next/static/chunks/app/automations/page-e8f13a995ae7f2fa.js +1 -0
  11. khoj/interface/compiled/_next/static/chunks/app/chat/{page-a0b61f10b0bf6dd5.js → page-4645a696ec970a94.js} +1 -1
  12. khoj/interface/compiled/_next/static/chunks/app/page-8ebd7e62c0542aa1.js +1 -0
  13. khoj/interface/compiled/_next/static/chunks/app/settings/page-1bf10e8d882533b6.js +1 -0
  14. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-6fb51c5c80f8ec67.js +1 -0
  15. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-02dc1f2e2a41e522.js → page-3067638b97048e5f.js} +1 -1
  16. khoj/interface/compiled/_next/static/chunks/webpack-4f582c9505ac1fb8.js +1 -0
  17. khoj/interface/compiled/_next/static/css/307dd5243338dfd8.css +1 -0
  18. khoj/interface/compiled/_next/static/css/{c3acbadc30537d04.css → 4e4e6a4a1c920d06.css} +1 -1
  19. khoj/interface/compiled/_next/static/css/5dd9bb87a50b706e.css +25 -0
  20. khoj/interface/compiled/agents/index.html +1 -1
  21. khoj/interface/compiled/agents/index.txt +2 -2
  22. khoj/interface/compiled/automations/index.html +1 -1
  23. khoj/interface/compiled/automations/index.txt +3 -3
  24. khoj/interface/compiled/chat/index.html +1 -1
  25. khoj/interface/compiled/chat/index.txt +2 -2
  26. khoj/interface/compiled/index.html +1 -1
  27. khoj/interface/compiled/index.txt +2 -2
  28. khoj/interface/compiled/search/index.html +1 -1
  29. khoj/interface/compiled/search/index.txt +2 -2
  30. khoj/interface/compiled/settings/index.html +1 -1
  31. khoj/interface/compiled/settings/index.txt +4 -4
  32. khoj/interface/compiled/share/chat/index.html +1 -1
  33. khoj/interface/compiled/share/chat/index.txt +2 -2
  34. khoj/processor/conversation/prompts.py +37 -17
  35. khoj/routers/api.py +23 -20
  36. khoj/routers/auth.py +32 -14
  37. khoj/routers/helpers.py +129 -14
  38. {khoj-1.32.3.dev34.dist-info → khoj-1.32.3.dev61.dist-info}/METADATA +1 -1
  39. {khoj-1.32.3.dev34.dist-info → khoj-1.32.3.dev61.dist-info}/RECORD +50 -50
  40. khoj/interface/compiled/_next/static/chunks/4124-0baa32400521e909.js +0 -1
  41. khoj/interface/compiled/_next/static/chunks/4357-03ea130575287c27.js +0 -1
  42. khoj/interface/compiled/_next/static/chunks/5427-3e7360c8e6ac9728.js +0 -1
  43. khoj/interface/compiled/_next/static/chunks/5477-c5d7eabee28a789a.js +0 -1
  44. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +0 -1
  45. khoj/interface/compiled/_next/static/chunks/app/agents/page-ab5ebe4efba9b582.js +0 -1
  46. khoj/interface/compiled/_next/static/chunks/app/automations/page-37d56a7bbfd307df.js +0 -1
  47. khoj/interface/compiled/_next/static/chunks/app/page-33a3375b1414d1bd.js +0 -1
  48. khoj/interface/compiled/_next/static/chunks/app/settings/page-430db6215e48aea2.js +0 -1
  49. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js +0 -1
  50. khoj/interface/compiled/_next/static/chunks/webpack-b0a1b08bb62bdc15.js +0 -1
  51. khoj/interface/compiled/_next/static/css/0f04760e76bba6c1.css +0 -25
  52. khoj/interface/compiled/_next/static/css/e546bf5cc4914244.css +0 -1
  53. /khoj/interface/compiled/_next/static/chunks/{182-8cd8b17d40e6e989.js → 182-f1c48a203dc91e0e.js} +0 -0
  54. /khoj/interface/compiled/_next/static/chunks/{1915-605f698f2573cfd4.js → 1915-d3c36ad6ce697ce7.js} +0 -0
  55. /khoj/interface/compiled/_next/static/chunks/{2117-9886e6a0232dc093.js → 2117-165ef4747a5b836b.js} +0 -0
  56. /khoj/interface/compiled/_next/static/chunks/{8667-d3e5bc726e4ff4e3.js → 8667-b6bf63c72b2d76eb.js} +0 -0
  57. /khoj/interface/compiled/_next/static/chunks/{9259-27d1ff42af9a43e0.js → 9259-1172dbaca0515237.js} +0 -0
  58. /khoj/interface/compiled/_next/static/chunks/{9665-1ab5c8c667b74dca.js → 9665-391df1e5c51c960a.js} +0 -0
  59. /khoj/interface/compiled/_next/static/{mqcIHpVqVWkmBuN0npYHA → iX3n9kOMMR5_Xg2yB-YVv}/_buildManifest.js +0 -0
  60. /khoj/interface/compiled/_next/static/{mqcIHpVqVWkmBuN0npYHA → iX3n9kOMMR5_Xg2yB-YVv}/_ssgManifest.js +0 -0
  61. {khoj-1.32.3.dev34.dist-info → khoj-1.32.3.dev61.dist-info}/WHEEL +0 -0
  62. {khoj-1.32.3.dev34.dist-info → khoj-1.32.3.dev61.dist-info}/entry_points.txt +0 -0
  63. {khoj-1.32.3.dev34.dist-info → khoj-1.32.3.dev61.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/0f04760e76bba6c1.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/df4b47a2d0d85eae.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/9c164d9727dd8092.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/8e6a3ca11a60b189.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-b0a1b08bb62bdc15.js"/><script src="/_next/static/chunks/fd9d1056-4482b99a36fd1673.js" async=""></script><script src="/_next/static/chunks/2117-9886e6a0232dc093.js" async=""></script><script src="/_next/static/chunks/main-app-de1f09df97a3cfc7.js" async=""></script><script src="/_next/static/chunks/d3ac728e-44ebd2a0c99b12a0.js" async=""></script><script src="/_next/static/chunks/9259-27d1ff42af9a43e0.js" async=""></script><script src="/_next/static/chunks/8667-d3e5bc726e4ff4e3.js" async=""></script><script src="/_next/static/chunks/182-8cd8b17d40e6e989.js" async=""></script><script src="/_next/static/chunks/4357-03ea130575287c27.js" async=""></script><script src="/_next/static/chunks/3175-b2e522f8ca392f7e.js" async=""></script><script src="/_next/static/chunks/4124-0baa32400521e909.js" async=""></script><script src="/_next/static/chunks/5477-c5d7eabee28a789a.js" async=""></script><script src="/_next/static/chunks/3789-a09e37a819171a9d.js" async=""></script><script src="/_next/static/chunks/app/share/chat/page-02dc1f2e2a41e522.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com https://accounts.google.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; frame-src &#x27;self&#x27; https://accounts.google.com https://app.chatwoot.com; child-src &#x27;self&#x27; https://app.chatwoot.com; object-src &#x27;none&#x27;;"/><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com https://accounts.google.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; frame-src &#x27;self&#x27; https://accounts.google.com https://app.chatwoot.com; child-src &#x27;self&#x27; https://app.chatwoot.com; object-src &#x27;none&#x27;;"/><title>Khoj AI - Ask Anything</title><meta name="description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta name="keywords" content="research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"/><meta property="og:title" content="Khoj AI - Ask Anything"/><meta property="og:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta property="og:url" content="https://app.khoj.dev/chat/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta property="og:image:width" content="940"/><meta property="og:image:height" content="525"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Ask Anything"/><meta name="twitter:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta name="twitter:image:width" content="940"/><meta name="twitter:image:height" content="525"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><html lang="en" class="__variable_f36179 __variable_702545"><body><div class="bg-background opacity-50 flex items-center justify-center h-screen"><div>Loading<!-- --> <span><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 256 256" class="inline animate-spin h-5 w-5"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg></span></div></div><script>window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';</script><script src="/_next/static/chunks/webpack-b0a1b08bb62bdc15.js" async=""></script></body></html><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/0f04760e76bba6c1.css\",\"style\"]\na:HL[\"/_next/static/css/df4b47a2d0d85eae.css\",\"style\"]\nb:HL[\"/_next/static/css/9c164d9727dd8092.css\",\"style\"]\nc:HL[\"/_next/static/css/8e6a3ca11a60b189.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"d:I[12846,[],\"\"]\nf:I[19107,[],\"ClientPageRoot\"]\n10:I[41694,[\"3954\",\"static/chunks/d3ac728e-44ebd2a0c99b12a0.js\",\"9259\",\"static/chunks/9259-27d1ff42af9a43e0.js\",\"8667\",\"static/chunks/8667-d3e5bc726e4ff4e3.js\",\"182\",\"static/chunks/182-8cd8b17d40e6e989.js\",\"4357\",\"static/chunks/4357-03ea130575287c27.js\",\"3175\",\"static/chunks/3175-b2e522f8ca392f7e.js\",\"4124\",\"static/chunks/4124-0baa32400521e909.js\",\"5477\",\"static/chunks/5477-c5d7eabee28a789a.js\",\"3789\",\"static/chunks/3789-a09e37a819171a9d.js\",\"3111\",\"static/chunks/app/share/chat/page-02dc1f2e2a41e522.js\"],\"default\",1]\n11:I[4707,[],\"\"]\n12:I[36423,[],\"\"]\n14:I[61060,[],\"\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$Ld\",null,{\"buildId\":\"mqcIHpVqVWkmBuN0npYHA\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"share\",\"chat\",\"\"],\"initialTree\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{},[[\"$Le\",[\"$\",\"$Lf\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$10\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/df4b47a2d0d85eae.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9c164d9727dd8092.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/8e6a3ca11a60b189.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\",\"chat\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';\"}}]]}]]}]],null],null]},[null,[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/0f04760e76bba6c1.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/chat/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"link\",\"26\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"27\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"28\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"e:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5dd9bb87a50b706e.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/df4b47a2d0d85eae.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/9c164d9727dd8092.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/8e6a3ca11a60b189.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-4f582c9505ac1fb8.js"/><script src="/_next/static/chunks/fd9d1056-4482b99a36fd1673.js" async=""></script><script src="/_next/static/chunks/2117-165ef4747a5b836b.js" async=""></script><script src="/_next/static/chunks/main-app-de1f09df97a3cfc7.js" async=""></script><script src="/_next/static/chunks/d3ac728e-44ebd2a0c99b12a0.js" async=""></script><script src="/_next/static/chunks/9259-1172dbaca0515237.js" async=""></script><script src="/_next/static/chunks/8667-b6bf63c72b2d76eb.js" async=""></script><script src="/_next/static/chunks/182-f1c48a203dc91e0e.js" async=""></script><script src="/_next/static/chunks/1010-8f39bb4648b5ba10.js" async=""></script><script src="/_next/static/chunks/6293-469dd16402ea8a6f.js" async=""></script><script src="/_next/static/chunks/4124-f5c857c57e5391d9.js" async=""></script><script src="/_next/static/chunks/5477-0bbddb79c25a54a7.js" async=""></script><script src="/_next/static/chunks/3789-a09e37a819171a9d.js" async=""></script><script src="/_next/static/chunks/app/share/chat/page-3067638b97048e5f.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com https://accounts.google.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; frame-src &#x27;self&#x27; https://accounts.google.com https://app.chatwoot.com; child-src &#x27;self&#x27; https://app.chatwoot.com; object-src &#x27;none&#x27;;"/><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com https://accounts.google.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; frame-src &#x27;self&#x27; https://accounts.google.com https://app.chatwoot.com; child-src &#x27;self&#x27; https://app.chatwoot.com; object-src &#x27;none&#x27;;"/><title>Khoj AI - Ask Anything</title><meta name="description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta name="keywords" content="research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"/><meta property="og:title" content="Khoj AI - Ask Anything"/><meta property="og:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta property="og:url" content="https://app.khoj.dev/chat/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta property="og:image:width" content="940"/><meta property="og:image:height" content="525"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Ask Anything"/><meta name="twitter:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta name="twitter:image:width" content="940"/><meta name="twitter:image:height" content="525"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><html lang="en" class="__variable_f36179 __variable_702545"><body><div class="bg-background opacity-50 flex items-center justify-center h-screen"><div>Loading<!-- --> <span><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 256 256" class="inline animate-spin h-5 w-5"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg></span></div></div><script>window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';</script><script src="/_next/static/chunks/webpack-4f582c9505ac1fb8.js" async=""></script></body></html><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/5dd9bb87a50b706e.css\",\"style\"]\na:HL[\"/_next/static/css/df4b47a2d0d85eae.css\",\"style\"]\nb:HL[\"/_next/static/css/9c164d9727dd8092.css\",\"style\"]\nc:HL[\"/_next/static/css/8e6a3ca11a60b189.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"d:I[12846,[],\"\"]\nf:I[19107,[],\"ClientPageRoot\"]\n10:I[41694,[\"3954\",\"static/chunks/d3ac728e-44ebd2a0c99b12a0.js\",\"9259\",\"static/chunks/9259-1172dbaca0515237.js\",\"8667\",\"static/chunks/8667-b6bf63c72b2d76eb.js\",\"182\",\"static/chunks/182-f1c48a203dc91e0e.js\",\"1010\",\"static/chunks/1010-8f39bb4648b5ba10.js\",\"6293\",\"static/chunks/6293-469dd16402ea8a6f.js\",\"4124\",\"static/chunks/4124-f5c857c57e5391d9.js\",\"5477\",\"static/chunks/5477-0bbddb79c25a54a7.js\",\"3789\",\"static/chunks/3789-a09e37a819171a9d.js\",\"3111\",\"static/chunks/app/share/chat/page-3067638b97048e5f.js\"],\"default\",1]\n11:I[4707,[],\"\"]\n12:I[36423,[],\"\"]\n14:I[61060,[],\"\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$Ld\",null,{\"buildId\":\"iX3n9kOMMR5_Xg2yB-YVv\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"share\",\"chat\",\"\"],\"initialTree\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{},[[\"$Le\",[\"$\",\"$Lf\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$10\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/df4b47a2d0d85eae.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9c164d9727dd8092.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/8e6a3ca11a60b189.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\",\"chat\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';\"}}]]}]]}]],null],null]},[null,[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5dd9bb87a50b706e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/chat/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"link\",\"26\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"27\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"28\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"e:null\n"])</script></body></html>
@@ -1,7 +1,7 @@
1
1
  2:I[19107,[],"ClientPageRoot"]
2
- 3:I[41694,["3954","static/chunks/d3ac728e-44ebd2a0c99b12a0.js","9259","static/chunks/9259-27d1ff42af9a43e0.js","8667","static/chunks/8667-d3e5bc726e4ff4e3.js","182","static/chunks/182-8cd8b17d40e6e989.js","4357","static/chunks/4357-03ea130575287c27.js","3175","static/chunks/3175-b2e522f8ca392f7e.js","4124","static/chunks/4124-0baa32400521e909.js","5477","static/chunks/5477-c5d7eabee28a789a.js","3789","static/chunks/3789-a09e37a819171a9d.js","3111","static/chunks/app/share/chat/page-02dc1f2e2a41e522.js"],"default",1]
2
+ 3:I[41694,["3954","static/chunks/d3ac728e-44ebd2a0c99b12a0.js","9259","static/chunks/9259-1172dbaca0515237.js","8667","static/chunks/8667-b6bf63c72b2d76eb.js","182","static/chunks/182-f1c48a203dc91e0e.js","1010","static/chunks/1010-8f39bb4648b5ba10.js","6293","static/chunks/6293-469dd16402ea8a6f.js","4124","static/chunks/4124-f5c857c57e5391d9.js","5477","static/chunks/5477-0bbddb79c25a54a7.js","3789","static/chunks/3789-a09e37a819171a9d.js","3111","static/chunks/app/share/chat/page-3067638b97048e5f.js"],"default",1]
3
3
  4:I[4707,[],""]
4
4
  5:I[36423,[],""]
5
- 0:["mqcIHpVqVWkmBuN0npYHA",[[["",{"children":["share",{"children":["chat",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["share",{"children":["chat",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/df4b47a2d0d85eae.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/9c164d9727dd8092.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/8e6a3ca11a60b189.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[null,["$","html",null,{"lang":"en","className":"__variable_f36179 __variable_702545","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"}],["$","body",null,{"children":[["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","share","children","chat","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';"}}]]}]]}]],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","share","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/089de1d8526b96e9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/0f04760e76bba6c1.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_f36179 __variable_702545","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"}],["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]]}]],null],null],["$L6",null]]]]
5
+ 0:["iX3n9kOMMR5_Xg2yB-YVv",[[["",{"children":["share",{"children":["chat",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["share",{"children":["chat",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/df4b47a2d0d85eae.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/9c164d9727dd8092.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/8e6a3ca11a60b189.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[null,["$","html",null,{"lang":"en","className":"__variable_f36179 __variable_702545","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"}],["$","body",null,{"children":[["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","share","children","chat","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';"}}]]}]]}]],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","share","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/089de1d8526b96e9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/5dd9bb87a50b706e.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_f36179 __variable_702545","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"}],["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]]}]],null],null],["$L6",null]]]]
6
6
  6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Khoj AI - Ask Anything"}],["$","meta","3",{"name":"description","content":"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."}],["$","link","4",{"rel":"manifest","href":"/static/khoj.webmanifest","crossOrigin":"use-credentials"}],["$","meta","5",{"name":"keywords","content":"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"}],["$","meta","6",{"property":"og:title","content":"Khoj AI - Ask Anything"}],["$","meta","7",{"property":"og:description","content":"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."}],["$","meta","8",{"property":"og:url","content":"https://app.khoj.dev/chat/"}],["$","meta","9",{"property":"og:site_name","content":"Khoj AI"}],["$","meta","10",{"property":"og:image","content":"https://assets.khoj.dev/khoj_hero.png"}],["$","meta","11",{"property":"og:image:width","content":"940"}],["$","meta","12",{"property":"og:image:height","content":"525"}],["$","meta","13",{"property":"og:image","content":"https://assets.khoj.dev/khoj_lantern_256x256.png"}],["$","meta","14",{"property":"og:image:width","content":"256"}],["$","meta","15",{"property":"og:image:height","content":"256"}],["$","meta","16",{"property":"og:type","content":"website"}],["$","meta","17",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","18",{"name":"twitter:title","content":"Khoj AI - Ask Anything"}],["$","meta","19",{"name":"twitter:description","content":"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."}],["$","meta","20",{"name":"twitter:image","content":"https://assets.khoj.dev/khoj_hero.png"}],["$","meta","21",{"name":"twitter:image:width","content":"940"}],["$","meta","22",{"name":"twitter:image:height","content":"525"}],["$","meta","23",{"name":"twitter:image","content":"https://assets.khoj.dev/khoj_lantern_256x256.png"}],["$","meta","24",{"name":"twitter:image:width","content":"256"}],["$","meta","25",{"name":"twitter:image:height","content":"256"}],["$","link","26",{"rel":"icon","href":"/static/assets/icons/khoj_lantern.ico"}],["$","link","27",{"rel":"apple-touch-icon","href":"/static/assets/icons/khoj_lantern_256x256.png"}],["$","meta","28",{"name":"next-size-adjust"}]]
7
7
  1:null
@@ -935,7 +935,7 @@ AI: Here is one I found: "It's not denial. I'm just selective about the reality
935
935
  User: Hahah, nice! Show a new one every morning.
936
936
  Khoj: {{
937
937
  "crontime": "0 9 * * *",
938
- "query": "/automated_task Share a funny Calvin and Hobbes or Bill Watterson quote from my notes",
938
+ "query": "Share a funny Calvin and Hobbes or Bill Watterson quote from my notes",
939
939
  "subject": "Your Calvin and Hobbes Quote for the Day"
940
940
  }}
941
941
 
@@ -955,7 +955,7 @@ AI: The latest released Khoj python package version is 1.5.0.
955
955
  User: Notify me when version 2.0.0 is released
956
956
  Khoj: {{
957
957
  "crontime": "0 10 * * *",
958
- "query": "/automated_task What is the latest released version of the Khoj python package?",
958
+ "query": "/automated_task /research What is the latest released version of the Khoj python package?",
959
959
  "subject": "Khoj Python Package Version 2.0.0 Release"
960
960
  }}
961
961
 
@@ -1101,33 +1101,33 @@ to_notify_or_not = PromptTemplate.from_template(
1101
1101
  You are Khoj, an extremely smart and discerning notification assistant.
1102
1102
  - Decide whether the user should be notified of the AI's response using the Original User Query, Executed User Query and AI Response triplet.
1103
1103
  - Notify the user only if the AI's response satisfies the user specified requirements.
1104
- - You should only respond with a "Yes" or "No". Do not say anything else.
1104
+ - You should return a response with your reason and "Yes" or "No" decision in JSON format. Do not say anything else.
1105
1105
 
1106
1106
  # Examples:
1107
1107
  Original User Query: Hahah, nice! Show a new one every morning at 9am. My Current Location: Shanghai, China
1108
1108
  Executed User Query: Could you share a funny Calvin and Hobbes quote from my notes?
1109
1109
  AI Reponse: Here is one I found: "It's not denial. I'm just selective about the reality I accept."
1110
- Khoj: Yes
1110
+ Khoj: {{ "reason": "The AI has shared a funny Calvin and Hobbes quote." , "decision": "Yes" }}
1111
1111
 
1112
1112
  Original User Query: Every evening check if it's going to rain tomorrow. Notify me only if I'll need an umbrella. My Current Location: Nairobi, Kenya
1113
1113
  Executed User Query: Is it going to rain tomorrow in Nairobi, Kenya
1114
1114
  AI Response: Tomorrow's forecast is sunny with a high of 28°C and a low of 18°C
1115
- Khoj: No
1115
+ Khoj: {{ "reason": "It is not expected to rain tomorrow.", "decision": "No" }}
1116
1116
 
1117
- Original User Query: Tell me when version 2.0.0 is released. My Current Location: Mexico City, Mexico
1118
- Executed User Query: Check if version 2.0.0 of the Khoj python package is released
1119
- AI Response: The latest released Khoj python package version is 1.5.0.
1120
- Khoj: No
1121
-
1122
- Original User Query: Paint me a sunset every evening. My Current Location: Shanghai, China
1123
- Executed User Query: Paint me a sunset in Shanghai, China
1117
+ Original User Query: Paint a sunset for me every evening. My Current Location: Shanghai, China
1118
+ Executed User Query: Paint a sunset in Shanghai, China
1124
1119
  AI Response: https://khoj-generated-images.khoj.dev/user110/image78124.webp
1125
- Khoj: Yes
1120
+ Khoj: {{ "reason": "The AI has created an image.", "decision": "Yes" }}
1121
+
1122
+ Original User Query: Notify me when Khoj version 2.0.0 is released
1123
+ Executed User Query: What is the latest released version of the Khoj python package
1124
+ AI Response: The latest released Khoj python package version is 1.5.0.
1125
+ Khoj: {{ "reason": "Version 2.0.0 of Khoj has not been released yet." , "decision": "No" }}
1126
1126
 
1127
- Original User Query: Share a summary of the tasks I've completed at the end of the day. My Current Location: Oslo, Norway
1128
- Executed User Query: Share a summary of the tasks I've completed today.
1129
- AI Response: I'm sorry, I couldn't find any relevant notes to respond to your message.
1130
- Khoj: No
1127
+ Original User Query: Share a summary of the tasks I've completed at the end of the day.
1128
+ Executed User Query: Generate a summary of the tasks I've completed today.
1129
+ AI Response: You have completed the following tasks today: 1. Meeting with the team 2. Submit travel expense report
1130
+ Khoj: {{ "reason": "The AI has provided a summary of completed tasks.", "decision": "Yes" }}
1131
1131
 
1132
1132
  Original User Query: {original_query}
1133
1133
  Executed User Query: {executed_query}
@@ -1137,6 +1137,26 @@ Khoj:
1137
1137
  )
1138
1138
 
1139
1139
 
1140
+ automation_format_prompt = PromptTemplate.from_template(
1141
+ """
1142
+ You are Khoj, a smart and creative researcher and writer with a knack for creating engaging content.
1143
+ - You *CAN REMEMBER ALL NOTES and PERSONAL INFORMATION FOREVER* that the user ever shares with you.
1144
+ - You *CAN* generate look-up real-time information from the internet, send notifications and answer questions based on the user's notes.
1145
+
1146
+ Convert the AI response into a clear, structured markdown report with section headings to improve readability.
1147
+ Your response will be sent in the body of an email to the user.
1148
+ Do not add an email subject. Never add disclaimers in your final response.
1149
+
1150
+ You are provided the following details for context.
1151
+
1152
+ {username}
1153
+ Original User Query: {original_query}
1154
+ Executed Chat Request: {executed_query}
1155
+ AI Response: {response}
1156
+ Khoj:
1157
+ """.strip()
1158
+ )
1159
+
1140
1160
  # System messages to user
1141
1161
  # --
1142
1162
  help_message = PromptTemplate.from_template(
khoj/routers/api.py CHANGED
@@ -38,15 +38,15 @@ from khoj.processor.conversation.offline.chat_model import extract_questions_off
38
38
  from khoj.processor.conversation.offline.whisper import transcribe_audio_offline
39
39
  from khoj.processor.conversation.openai.gpt import extract_questions
40
40
  from khoj.processor.conversation.openai.whisper import transcribe_audio
41
- from khoj.processor.conversation.utils import defilter_query
41
+ from khoj.processor.conversation.utils import clean_json, defilter_query
42
42
  from khoj.routers.helpers import (
43
43
  ApiUserRateLimiter,
44
44
  ChatEvent,
45
45
  CommonQueryParams,
46
46
  ConversationCommandRateLimiter,
47
- acreate_title_from_query,
48
47
  get_user_config,
49
48
  schedule_automation,
49
+ schedule_query,
50
50
  update_telemetry_state,
51
51
  )
52
52
  from khoj.search_filter.date_filter import DateFilter
@@ -566,7 +566,7 @@ def delete_automation(request: Request, automation_id: str) -> Response:
566
566
 
567
567
  @api.post("/automation", response_class=Response)
568
568
  @requires(["authenticated"])
569
- async def post_automation(
569
+ def post_automation(
570
570
  request: Request,
571
571
  q: str,
572
572
  crontime: str,
@@ -584,11 +584,15 @@ async def post_automation(
584
584
  if not cron_descriptor.get_description(crontime):
585
585
  return Response(content="Invalid crontime", status_code=400)
586
586
 
587
+ # Infer subject, query to run
588
+ _, query_to_run, generated_subject = schedule_query(q, conversation_history={}, user=user)
589
+ subject = subject or generated_subject
590
+
587
591
  # Normalize query parameters
588
592
  # Add /automated_task prefix to query if not present
589
- q = q.strip()
590
- if not q.startswith("/automated_task"):
591
- query_to_run = f"/automated_task {q}"
593
+ query_to_run = query_to_run.strip()
594
+ if not query_to_run.startswith("/automated_task"):
595
+ query_to_run = f"/automated_task {query_to_run}"
592
596
 
593
597
  # Normalize crontime for AP Scheduler CronTrigger
594
598
  crontime = crontime.strip()
@@ -603,24 +607,19 @@ async def post_automation(
603
607
  minute_value = crontime.split(" ")[0]
604
608
  if not minute_value.isdigit():
605
609
  return Response(
606
- content="Recurrence of every X minutes is unsupported. Please create a less frequent schedule.",
610
+ content="Minute level recurrence is unsupported. Please create a less frequent schedule.",
607
611
  status_code=400,
608
612
  )
609
613
 
610
- if not subject:
611
- subject = await acreate_title_from_query(q, user)
612
-
613
- title = f"Automation: {subject}"
614
-
615
614
  # Create new Conversation Session associated with this new task
616
- conversation = await ConversationAdapters.acreate_conversation_session(user, request.user.client_app, title=title)
617
-
618
- calling_url = request.url.replace(query=f"{request.url.query}")
615
+ title = f"Automation: {subject}"
616
+ conversation = ConversationAdapters.create_conversation_session(user, request.user.client_app, title=title)
619
617
 
620
618
  # Schedule automation with query_to_run, timezone, subject directly provided by user
621
619
  try:
622
620
  # Use the query to run as the scheduling request if the scheduling request is unset
623
- automation = await schedule_automation(
621
+ calling_url = request.url.replace(query=f"{request.url.query}")
622
+ automation = schedule_automation(
624
623
  query_to_run, subject, crontime, timezone, q, user, calling_url, str(conversation.id)
625
624
  )
626
625
  except Exception as e:
@@ -691,11 +690,15 @@ def edit_job(
691
690
  logger.error(f"Error editing automation {automation_id} for {user.email}: {e}", exc_info=True)
692
691
  return Response(content="Invalid automation", status_code=403)
693
692
 
693
+ # Infer subject, query to run
694
+ _, query_to_run, _ = schedule_query(q, conversation_history={}, user=user)
695
+ subject = subject
696
+
694
697
  # Normalize query parameters
695
698
  # Add /automated_task prefix to query if not present
696
- q = q.strip()
697
- if not q.startswith("/automated_task"):
698
- query_to_run = f"/automated_task {q}"
699
+ query_to_run = query_to_run.strip()
700
+ if not query_to_run.startswith("/automated_task"):
701
+ query_to_run = f"/automated_task {query_to_run}"
699
702
  # Normalize crontime for AP Scheduler CronTrigger
700
703
  crontime = crontime.strip()
701
704
  if len(crontime.split(" ")) > 5:
@@ -713,7 +716,7 @@ def edit_job(
713
716
  )
714
717
 
715
718
  # Construct updated automation metadata
716
- automation_metadata = json.loads(automation.name)
719
+ automation_metadata: dict[str, str] = json.loads(clean_json(automation.name))
717
720
  automation_metadata["scheduling_request"] = q
718
721
  automation_metadata["query_to_run"] = query_to_run
719
722
  automation_metadata["subject"] = subject.strip()
khoj/routers/auth.py CHANGED
@@ -3,6 +3,7 @@ import datetime
3
3
  import logging
4
4
  import os
5
5
  from typing import Optional
6
+ from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
6
7
 
7
8
  import requests
8
9
  from fastapi import APIRouter, Depends
@@ -13,6 +14,7 @@ from starlette.requests import Request
13
14
  from starlette.responses import HTMLResponse, RedirectResponse, Response
14
15
  from starlette.status import HTTP_302_FOUND
15
16
 
17
+ from khoj.app.settings import DISABLE_HTTPS
16
18
  from khoj.database.adapters import (
17
19
  acreate_khoj_token,
18
20
  aget_or_create_user_by_email,
@@ -28,7 +30,6 @@ from khoj.routers.helpers import (
28
30
  update_telemetry_state,
29
31
  )
30
32
  from khoj.utils import state
31
- from khoj.utils.helpers import in_debug_mode
32
33
 
33
34
  logger = logging.getLogger(__name__)
34
35
 
@@ -204,23 +205,33 @@ async def auth_post(request: Request):
204
205
 
205
206
  @auth_router.get("/redirect")
206
207
  async def auth(request: Request):
207
- next_url = get_next_url(request)
208
- for q in request.query_params:
209
- if q in ["code", "state", "scope", "authuser", "prompt", "session_state", "access_type"]:
210
- continue
211
- if q != "next":
212
- next_url += f"&{q}={request.query_params[q]}"
213
-
214
- code = request.query_params.get("code")
208
+ next_url_path = get_next_url(request)
209
+
210
+ # Add query params from request, excluding OAuth params to next URL
211
+ oauth_params = {"code", "state", "scope", "authuser", "prompt", "session_state", "access_type", "next"}
212
+ query_params = {param: value for param, value in request.query_params.items() if param not in oauth_params}
213
+
214
+ # Rebuild next URL with updated query params
215
+ parsed_next_url_path = urlparse(next_url_path)
216
+ next_url = urlunparse(
217
+ (
218
+ parsed_next_url_path.scheme,
219
+ parsed_next_url_path.netloc,
220
+ parsed_next_url_path.path,
221
+ parsed_next_url_path.params,
222
+ urlencode(query_params, doseq=True),
223
+ parsed_next_url_path.fragment,
224
+ )
225
+ )
215
226
 
216
- # 1. Construct the full redirect URI including domain
227
+ # Construct the full redirect URI including domain
217
228
  base_url = str(request.base_url).rstrip("/")
218
-
219
- if not in_debug_mode():
229
+ if not DISABLE_HTTPS:
220
230
  base_url = base_url.replace("http://", "https://")
221
-
222
231
  redirect_uri = f"{base_url}{request.app.url_path_for('auth')}"
223
232
 
233
+ # Build the payload for the token request
234
+ code = request.query_params.get("code")
224
235
  payload = {
225
236
  "code": code,
226
237
  "client_id": os.environ["GOOGLE_CLIENT_ID"],
@@ -229,12 +240,14 @@ async def auth(request: Request):
229
240
  "grant_type": "authorization_code",
230
241
  }
231
242
 
243
+ # Request the token from Google
232
244
  verified_data = requests.post(
233
245
  "https://oauth2.googleapis.com/token",
234
246
  headers={"Content-Type": "application/x-www-form-urlencoded"},
235
247
  data=payload,
236
248
  )
237
249
 
250
+ # Validate the OAuth response
238
251
  if verified_data.status_code != 200:
239
252
  logger.error(f"Token request failed: {verified_data.text}")
240
253
  try:
@@ -245,20 +258,24 @@ async def auth(request: Request):
245
258
  verified_data.raise_for_status()
246
259
 
247
260
  credential = verified_data.json().get("id_token")
248
-
249
261
  if not credential:
250
262
  logger.error("Missing id_token in OAuth response")
251
263
  return RedirectResponse(url="/login?error=invalid_token", status_code=HTTP_302_FOUND)
252
264
 
265
+ # Validate the OAuth token
253
266
  try:
254
267
  idinfo = id_token.verify_oauth2_token(credential, google_requests.Request(), os.environ["GOOGLE_CLIENT_ID"])
255
268
  except OAuthError as error:
256
269
  return HTMLResponse(f"<h1>{error.error}</h1>")
270
+
271
+ # Get or create the authenticated user in the database
257
272
  khoj_user = await get_or_create_user(idinfo)
258
273
 
274
+ # Set the user session if the user is authenticated
259
275
  if khoj_user:
260
276
  request.session["user"] = dict(idinfo)
261
277
 
278
+ # Send a welcome email to new users
262
279
  if datetime.timedelta(minutes=3) > (datetime.datetime.now(datetime.timezone.utc) - khoj_user.date_joined):
263
280
  asyncio.create_task(send_welcome_email(idinfo["name"], idinfo["email"]))
264
281
  update_telemetry_state(
@@ -269,6 +286,7 @@ async def auth(request: Request):
269
286
  )
270
287
  logger.log(logging.INFO, f"🥳 New User Created: {khoj_user.uuid}")
271
288
 
289
+ # Redirect the user to the next URL
272
290
  return RedirectResponse(url=next_url, status_code=HTTP_302_FOUND)
273
291
 
274
292