[PR #726] [CLOSED] [OSSHACK] Opt-In Semantic Search #703 #1142

Closed
opened 2026-02-26 19:32:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/726
Author: @Rohan-Narayan
Created: 12/3/2023
Status: Closed

Base: mainHead: sem-search-ada


📝 Commits (9)

  • 1ce93fb feat: enable/disable semantic search in profile settings
  • 5fef25e feat: all existing documents now embedded on sem-search opt-in, running on background job
  • f4fbe67 feat: subscription flag for semantic search
  • eea44c9 feat: routers for search
  • 2728f63 Merge branch 'sem-search-ada' of https://github.com/apirjani/documenso into sem-search-ada
  • 604e897 feat: database migration with embeddings
  • c90410e feat: fixed sql query
  • 4f23eeb feat: embed on creating new document
  • 2c5ae93 feat: search functionality added

📊 Changes

28 files changed (+1217 additions, -41 deletions)

View changed files

📝 apps/web/package.json (+8 -2)
📝 apps/web/src/app/(dashboard)/documents/page.tsx (+1 -1)
📝 apps/web/src/app/(dashboard)/documents/upload-document.tsx (+4 -2)
📝 apps/web/src/app/(dashboard)/settings/security/page.tsx (+85 -23)
apps/web/src/app/api/trigger/route.ts (+13 -0)
📝 apps/web/src/components/(dashboard)/common/command-menu.tsx (+52 -3)
apps/web/src/components/forms/sem-search/semantic-toggle.tsx (+106 -0)
apps/web/src/jobs/embedJob.ts (+65 -0)
apps/web/src/jobs/embedNewDocJob.ts (+62 -0)
apps/web/src/jobs/examples.ts (+45 -0)
apps/web/src/jobs/index.ts (+5 -0)
apps/web/src/trigger.ts (+7 -0)
📝 package-lock.json (+480 -6)
📝 package.json (+4 -1)
📝 packages/lib/next-auth/error-codes.ts (+2 -0)
📝 packages/lib/server-only/document-data/create-document-data.ts (+13 -3)
packages/lib/server-only/sem-search/disable-sem-search.ts (+22 -0)
packages/lib/server-only/sem-search/document-processor.ts (+62 -0)
packages/lib/server-only/sem-search/enable-sem-search.ts (+41 -0)
packages/lib/server-only/sem-search/run-sem-search.ts (+39 -0)

...and 8 more files

📄 Description

Improvements

Created opt-in feature which allows users to opt into semantic search program. If opted in, all current documents are embedded, and any future documents that are uploaded are embedded as well. This is only available to subscribed users.
Integrated with Trigger.dev to run embedding jobs in background. Set Trigger.dev API variables in env file accordingly. Started implementation for semantic search using pg_vector similarity search.

#TODO
Complete similarity search using pg_vector and fix sql query.
Display found documents in appropriate manner.
Optimize semantic search and embedding using chunks.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/726 **Author:** [@Rohan-Narayan](https://github.com/Rohan-Narayan) **Created:** 12/3/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `sem-search-ada` --- ### 📝 Commits (9) - [`1ce93fb`](https://github.com/documenso/documenso/commit/1ce93fbc9bb2160abd7ab2aec87d75795ef33c71) feat: enable/disable semantic search in profile settings - [`5fef25e`](https://github.com/documenso/documenso/commit/5fef25e4f57e134133505d890383c64667baa542) feat: all existing documents now embedded on sem-search opt-in, running on background job - [`f4fbe67`](https://github.com/documenso/documenso/commit/f4fbe674838b5db98055071da064987bf4678386) feat: subscription flag for semantic search - [`eea44c9`](https://github.com/documenso/documenso/commit/eea44c9bcabdd7190fff3980b16517e89a1d2809) feat: routers for search - [`2728f63`](https://github.com/documenso/documenso/commit/2728f63b52e8bc2c7689b56b0aff4c3aa5a0d95a) Merge branch 'sem-search-ada' of https://github.com/apirjani/documenso into sem-search-ada - [`604e897`](https://github.com/documenso/documenso/commit/604e8970f41e816e0baf823f8c41256fdf2ad6c8) feat: database migration with embeddings - [`c90410e`](https://github.com/documenso/documenso/commit/c90410ea53a8198b21457e4c69e3367893c9743a) feat: fixed sql query - [`4f23eeb`](https://github.com/documenso/documenso/commit/4f23eebdbf2a3e804310ece78abe35d09ad09c3d) feat: embed on creating new document - [`2c5ae93`](https://github.com/documenso/documenso/commit/2c5ae93de7d7ae49707a8452aebe6d99bb333389) feat: search functionality added ### 📊 Changes **28 files changed** (+1217 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/package.json` (+8 -2) 📝 `apps/web/src/app/(dashboard)/documents/page.tsx` (+1 -1) 📝 `apps/web/src/app/(dashboard)/documents/upload-document.tsx` (+4 -2) 📝 `apps/web/src/app/(dashboard)/settings/security/page.tsx` (+85 -23) ➕ `apps/web/src/app/api/trigger/route.ts` (+13 -0) 📝 `apps/web/src/components/(dashboard)/common/command-menu.tsx` (+52 -3) ➕ `apps/web/src/components/forms/sem-search/semantic-toggle.tsx` (+106 -0) ➕ `apps/web/src/jobs/embedJob.ts` (+65 -0) ➕ `apps/web/src/jobs/embedNewDocJob.ts` (+62 -0) ➕ `apps/web/src/jobs/examples.ts` (+45 -0) ➕ `apps/web/src/jobs/index.ts` (+5 -0) ➕ `apps/web/src/trigger.ts` (+7 -0) 📝 `package-lock.json` (+480 -6) 📝 `package.json` (+4 -1) 📝 `packages/lib/next-auth/error-codes.ts` (+2 -0) 📝 `packages/lib/server-only/document-data/create-document-data.ts` (+13 -3) ➕ `packages/lib/server-only/sem-search/disable-sem-search.ts` (+22 -0) ➕ `packages/lib/server-only/sem-search/document-processor.ts` (+62 -0) ➕ `packages/lib/server-only/sem-search/enable-sem-search.ts` (+41 -0) ➕ `packages/lib/server-only/sem-search/run-sem-search.ts` (+39 -0) _...and 8 more files_ </details> ### 📄 Description # Improvements Created opt-in feature which allows users to opt into semantic search program. If opted in, all current documents are embedded, and any future documents that are uploaded are embedded as well. This is only available to subscribed users.\ Integrated with Trigger.dev to run embedding jobs in background. Set Trigger.dev API variables in env file accordingly. Started implementation for semantic search using pg_vector similarity search. #TODO Complete similarity search using pg_vector and fix sql query.\ Display found documents in appropriate manner. \ Optimize semantic search and embedding using chunks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:32:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1142
No description provided.