feat: native vector search support - #90
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## paradedb-am #90 +/- ##
===============================================
- Coverage 92.15% 89.65% -2.50%
===============================================
Files 26 33 +7
Lines 854 996 +142
Branches 105 126 +21
===============================================
+ Hits 787 893 +106
- Misses 27 56 +29
- Partials 40 47 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| ## Vector Search (`examples/VectorSearch`) | ||
|
|
||
| Runs Top-K nearest-neighbor queries over a pgvector column with the native | ||
| vector support, backed by a bm25 index when the server supports it. |
There was a problem hiding this comment.
| vector support, backed by a bm25 index when the server supports it. | |
| ParadeDB vector support, backed by a bm25 index when the server supports it. |
| Autocomplete | ||
| MoreLikeThis | ||
| HybridRrf | ||
| VectorSearch |
There was a problem hiding this comment.
For the other ORMs I see you put VectorSearch below Rag. I think it looks better above, but that's a nit
| @@ -47,13 +47,57 @@ The official [Entity Framework Core](https://learn.microsoft.com/en-us/ef/core/) | |||
| | ParadeDB | 0.23.0+ | | |||
| | PostgreSQL | 15+ (with ParadeDB extension) | | |||
There was a problem hiding this comment.
Should we add pgvector as a requirement in these tables?
| | ParadeDB | 0.23.0+ | | ||
| | PostgreSQL | 15+ (with ParadeDB extension) | | ||
|
|
||
| ## Vector Search |
There was a problem hiding this comment.
This is useful, but I don't know if code snippets make sense in the top-level README. Imo instead we should add an extra sentence at line 39, which explains that we do full-text and vector search, and that vector search indexes pgvector types
7430827 to
f6a9110
Compare
f6a9110 to
be2eb22
Compare
be2eb22 to
610bb10
Compare
| await db.Database.ExecuteSqlRawAsync("DROP INDEX IF EXISTS mock_items_bm25_idx"); | ||
| // The VectorSearch example may have left its own index behind, and newer | ||
| // pg_search versions allow only one ParadeDB index per table | ||
| await db.Database.ExecuteSqlRawAsync("DROP INDEX IF EXISTS mock_items_vector_idx"); |
There was a problem hiding this comment.
We should update all examples to use one index name between them. Maybe search_idx so it's not bm25 or vector specific. Then we don't need to have a separate drop command
What
Implements paradedb/paradedb#5685: native vector search support with no Pgvector/Pgvector.EntityFrameworkCore dependency.
HasVectorType(n)property mapping for pgvectorvector(n)onfloat[], including migration DDL and round-trip serialization via a minimal Npgsql binary converter (plugin-registered on EF9/10, GlobalTypeMapper on EF8)EF.Functions.L2Distance/CosineDistance/InnerProducttranslating to<->/<=>/<#>with parameterized query vectorsBm25IndexBuilder.HasField(x => x.Embedding, VectorMetric.Cosine)emitting vector opclasses insideUSING bm25DDLWhy
ParadeDB indexes pgvector columns inside the bm25 index, so users should get the full query surface from this package alone.
Tests
net8.0/net9.0/net10.0 each: 114 passed, 2 skipped (capability-gated) against a live Testcontainer. csharpier/api-coverage/codespell/markdownlint clean.
Note: on EF9/10 the type converter auto-registers when the provider builds the data source; users passing a pre-built
NpgsqlDataSourceneed manual setup (same caveat as pgvector-dotnet).