Discover and explore top open-source AI tools and projects—updated daily.
ankaneRails gem for nearest neighbor search
Top 45.7% on SourcePulse
Neighbor is a Ruby gem providing efficient nearest neighbor search capabilities for Ruby on Rails applications. It integrates with various database extensions and types, enabling developers to implement similarity search for embeddings and other vector data directly within their ActiveRecord models.
How It Works
Neighbor leverages database-specific extensions like PostgreSQL's cube and pgvector, SQLite's sqlite-vec, MariaDB, and MySQL to store and query vector data. It provides an ActiveRecord interface (has_neighbors) that maps to these underlying database features, allowing users to define vector columns and perform nearest neighbor searches using various distance metrics (Euclidean, cosine, Hamming, etc.). The gem also supports indexing strategies like HNSW and IVFFlat for performance optimization.
Quick Start & Requirements
gem "neighbor"has_neighbors.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
1 week ago
1 day
pgvector
neondatabase-labs
asg017
tensorchord
timescale
marqo-ai
pgvector