-
Notifications
You must be signed in to change notification settings - Fork 15
95 unified semantic search service #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sahilx13
wants to merge
38
commits into
main
Choose a base branch
from
95-unified-semantic-search-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
…ransformer; register plugin and deps
…unking params; include hidden defaults in payload
… embeddings testing
…scueBox into 83-backend-db-connection
- Create init-pgvector.sql to automatically enable pgvector extension - Mount initialization script in docker-compose.yml - Ensures pgvector is available when PostgreSQL container starts This fixes the missing vector extension dependency for text embeddings.
- Add check_db.py for easy PostgreSQL database inspection - Shows tables, row counts, indexes, and extensions - Useful for debugging and verifying database state
…h-text-embeddings-devcontainer
…ings-devcontainer Backend db with text embeddings devcontainer
Collaborator
|
can we add seach/find image from facematch , https://github.com/UMass-Rescue/RescueBox/blob/main/src/face-detection-recognition/face_detection_recognition/utils/get_batch_embeddings.py#L14 get_embeddings() and save to db. |
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.
🔍 Add Text and Image Embeddings with Vector Database Search
Summary
This PR adds semantic search capabilities to RescueBox by integrating text and image embeddings with a PostgreSQL + pgvector database backend. Users can now embed text documents and images, then perform fast similarity searches using natural language queries.
🎯 Key Features
1. Text Embeddings Plugin (
src/text-embeddings/)all-MiniLM-L6-v2,all-mpnet-base-v2, andmulti-qa-MiniLM-L6-cos-v12. Image Embeddings Plugin (
src/image-embeddings/)3. Database Integration
📂 New Files
Plugins
Database & Infrastructure
🏗️ Database Schema
📦 New Dependencies
🚀 Usage Examples
Text Embeddings Workflow
Output:
{ "query": "machine learning algorithms", "results": [ {"path": "/docs/ml_intro.txt", "similarity": 0.8932}, {"path": "/docs/neural_nets.md", "similarity": 0.8654} ] }Image Search Workflow
Output:
{ "query": "sunset over mountains", "results": [ {"path": "/photos/mountain_sunset.jpg", "similarity": 0.9123}, {"path": "/photos/alpine_evening.png", "similarity": 0.8876} ] }🏎️ Performance Optimizations
pgvector Integration
<=>cosine distance operatorpool_pre_pingSearch Performance
🛠️ Infrastructure Changes
DevContainer Updates
5433:5432(to avoid conflicts with existing postgres instances)Database Utilities
check_db.py: Inspect database tables, row counts, indexes, and extensions🧪 Testing
Both plugins include comprehensive test suites:
Run tests:
🔧 Technical Details
Text Embeddings
Image Embeddings
📊 Use Cases
Digital Forensics
Content Discovery
Dataset Exploration
🔜 Future Enhancements
🧹 Clean Up
poetry.lockfrom branch83-backend-db-with-text-embeddings📝 Documentation
Both plugins include comprehensive README files with:
Branch:
backend-db-with-text-embeddings-devcontainerRelated Issues: Closes #83