v6.0.0-prerelease.0052
π LiteDB v6.0 Prerelease#52: Introducing Vector Search!
This release marks a significant milestone for LiteDB with the introduction of Vector Search! This powerful new feature enables you to build modern AI-powered applications, such as semantic search, recommendation engines, and Retrieval-Augmented Generation (RAG) systems, directly within LiteDB.
β¨ Major New Feature: Vector Search
-
Native Vector Storage & Indexing: We've added a native
BsonVectortype (forfloat[]) and a high-performance vector index based on the HNSW algorithm. You can now perform fast Approximate Nearest Neighbor (ANN) searches using standard distance metrics:Cosine(default),Euclidean, andDotProduct. -
New Fluent Query API: The query API has been extended with intuitive methods for vector operations.
using LiteDB.Vector; // New namespace for vector extensions! // Create a vector index on your embedding property var docs = db.GetCollection<Document>("docs"); docs.EnsureIndex(x => x.Embedding, new VectorIndexOptions(256)); // Find the top 5 most similar documents to your query vector var results = docs.Query() .TopKNear(x => x.Embedding, queryVector, k: 5) .ToList();