Skip to content

feat: native vector search support - #76

Open
rebasedming wants to merge 2 commits into
paradedb-amfrom
vector-search
Open

feat: native vector search support#76
rebasedming wants to merge 2 commits into
paradedb-amfrom
vector-search

Conversation

@rebasedming

Copy link
Copy Markdown

What

Implements paradedb/paradedb#5685: native vector search support with no pgvector-python dependency.

  • Vector(n) column type with serialization, reflection, and Alembic autogenerate round-trip support
  • l2_distance / cosine_distance / inner_product expressions (<->, <=>, <#>)
  • VectorField(col, metric=...) for listing vector columns with their opclass (vector_l2_ops default) in a bm25 index
  • Docs + examples/vector_search; integration tests are capability-gated until a release ships vector-in-bm25

Why

ParadeDB indexes pgvector columns inside the bm25 index, so users should get the full query surface from this package alone.

Tests

165 unit tests pass; integration suite passes against 0.23.0 (7 vector tests skip via capability gate) and all 7 pass against a dev pg_search 0.25.0 build.

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.11538% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.32%. Comparing base (5bdd6a9) to head (f9a62c2).

Files with missing lines Patch % Lines
paradedb/sqlalchemy/alembic.py 72.72% 1 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           paradedb-am      #76      +/-   ##
===============================================
+ Coverage        89.81%   90.32%   +0.51%     
===============================================
  Files               17       18       +1     
  Lines             1276     1375      +99     
  Branches           263      275      +12     
===============================================
+ Hits              1146     1242      +96     
- Misses              74       75       +1     
- Partials            56       58       +2     
Flag Coverage Δ
pg15 90.32% <97.11%> (+0.51%) ⬆️
pg16 90.32% <97.11%> (+0.51%) ⬆️
pg17 90.32% <97.11%> (+0.51%) ⬆️
pg18 90.32% <97.11%> (+0.51%) ⬆️
py3.10 90.32% <97.11%> (+0.51%) ⬆️
py3.11 90.32% <97.11%> (+0.51%) ⬆️
py3.12 90.32% <97.11%> (+0.51%) ⬆️
py3.13 90.32% <97.11%> (+0.51%) ⬆️
py3.14 90.32% <97.11%> (+0.51%) ⬆️
sqlalchemy-paradedb 90.32% <97.11%> (+0.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
paradedb/__init__.py 100.00% <100.00%> (ø)
paradedb/sqlalchemy/__init__.py 100.00% <100.00%> (ø)
paradedb/sqlalchemy/indexing.py 87.53% <100.00%> (+1.03%) ⬆️
paradedb/sqlalchemy/vector.py 100.00% <100.00%> (ø)
paradedb/sqlalchemy/alembic.py 93.38% <72.72%> (-0.97%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread examples/vector_search/vector_search.py Outdated
"""Top-K vector search over a BM25 index.

Requires a ParadeDB build with vector-in-bm25 support (pg_search branch
``mvp/vector-search``). The ORDER BY metric must match the index opclass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stale?

"""Integration tests for vector search inside BM25 indexes.

Vector-in-bm25 support is not yet in a released pg_search (it lives on branch
``mvp/vector-search``), so every test here is gated on the server actually

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment thread README.md Outdated
Comment on lines +99 to +100
- [RAG](examples/rag/rag.py)
- [Vector Search](examples/vector_search/vector_search.py)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [RAG](examples/rag/rag.py)
- [Vector Search](examples/vector_search/vector_search.py)
- [Vector Search](examples/vector_search/vector_search.py)
- [RAG](examples/rag/rag.py)

Comment thread README.md Outdated

## Vector Search

ParadeDB indexes pgvector `vector` columns directly inside BM25 indexes, so no pgvector ORM library is needed. Declare a `vector(n)` column with the built-in `Vector` type, add it to the BM25 index with `VectorField` and a distance metric, and order by the matching distance function:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on the EF Core PR

@rebasedming
rebasedming changed the base branch from main to paradedb-am July 27, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants