Skip to content

Bolt 6.0 support with vector types - #1214

Merged
robsdedude merged 29 commits into
neo4j:6.xfrom
robsdedude:vector-types
Jul 21, 2025
Merged

Bolt 6.0 support with vector types#1214
robsdedude merged 29 commits into
neo4j:6.xfrom
robsdedude:vector-types

Conversation

@robsdedude

@robsdedude robsdedude commented Jun 25, 2025

Copy link
Copy Markdown
Member

Introduce Bolt 6.0 support, which includes vector types.

Example:

from neo4j.vector import Vector

# Create a vector (raw big-endian byte buffer by default)
v = Vector(b"\x00\x01\x02\x03", "i16")
# or (less performant, but much more user-friendly)
v = Vector.from_native([1, 513], "i16")
# `v` can now be used as query parameter

# Get a vector
v = driver.execute_query(
    "MATCH (d:Doc) RETURN d.embedding AS v LIMIT 1",
    database_="neo4j",
).records[0]["v"]
# Working with the vector
print(f"Got vector of type {v.dtype} with {len(v)} elements: {v}")
print("raw bytes:", v.raw())
print("python list:", v.to_native())
print("as numpy array:", v.to_numpy())

@robsdedude
robsdedude marked this pull request as ready for review July 15, 2025 12:58

@MaxAake MaxAake left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two minor comments

Comment thread docs/source/index.rst
Comment thread tests/unit/common/vector/test_vector.py Outdated

@MaxAake MaxAake left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@robsdedude
robsdedude merged commit 85a4955 into neo4j:6.x Jul 21, 2025
@robsdedude
robsdedude deleted the vector-types branch July 21, 2025 06:44
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.

3 participants