Skip to content

[FEATURE] Support Vector of numbers binding to numpy.NDArray #525

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
badmonster0 opened this issue May 20, 2025 · 0 comments
Open

[FEATURE] Support Vector of numbers binding to numpy.NDArray #525

badmonster0 opened this issue May 20, 2025 · 0 comments
Labels
cocoindex-core CocoIndex Core Engine help wanted Extra attention is needed

Comments

@badmonster0
Copy link
Member

Currently we're using list for vectors in Python. It's not efficient and needs extra conversions, e.g. when building vector search queries with pgvector like the ::vector here:

SELECT filename, text, embedding <=> %s::vector AS distance

We want to support vector of numbers represented by numpy.typing.NDArray, e.g. numpy.typing.NDArray[npmpy.float32], numpy.typing.NDArray[npmpy.float64], numpy.typing.NDArray[npmpy.int64] for corresponding types.

#437 is a similar issue - which also added a new Python representation for an existing type.


❤️ Contributors, please refer to 📙Contributing Guide.
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like I'm working on it or Can I work on this issue? to avoid duplicating work. Our Discord server is always open and friendly.

@badmonster0 badmonster0 added help wanted Extra attention is needed cocoindex-core CocoIndex Core Engine labels May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cocoindex-core CocoIndex Core Engine help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant