Add Linear Projection adapter layer for feedback-driven query vector transformation#4
Draft
Copilot wants to merge 27 commits into
Draft
Add Linear Projection adapter layer for feedback-driven query vector transformation#4Copilot wants to merge 27 commits into
Copilot wants to merge 27 commits into
Conversation
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
…ithout punctuation Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
…reservation Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
…-chunking-class Add semantic chunking strategy using embedding similarity with sliding window
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add adapter layer for query and chunk matching
Add Linear Projection adapter layer for feedback-driven query vector transformation
Dec 23, 2025
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Collaborator
|
@copilot I have updated some code, take a pull and update the adapter service to store the model in local file by default and only use mongo if flag is enabled. |
…when ADAPTER_USE_MONGO=true Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
…logging Co-authored-by: ankit-programmer <36553178+ankit-programmer@users.noreply.github.com>
Contributor
Author
Updated the adapter service to use local file storage by default. MongoDB storage is now only used when |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a learnable adapter layer that transforms query vectors to better match relevant chunk vectors based on user feedback. The adapter is a single dense layer initialized as identity matrix, trained via MSE loss when users upvote search results.
Core Components
src/models/adapter.ts- MongoDB schema for persisting adapter weights per collectionsrc/service/adapter.ts- TensorFlow.js linear projection with:ADAPTER_USE_MONGO=true)Integration Points
retrievePoints()for fetching vectors by IDUsage Flow
Configuration
ADAPTER_USE_MONGOfalsetrueto use MongoDB for model storageADAPTER_STORAGE_PATH./adapter_modelsDependencies
@tensorflow/tfjs@4.22.0(no known vulnerabilities)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.