rig-neo4j

Crates.iorig-neo4j
lib.rsrig-neo4j
version
sourcesrc
created_at2024-11-07 18:59:26.031954
updated_at2024-12-03 22:02:21.47146
descriptionNeo4j implementation of a Rig vector store.
homepage
repositoryhttps://github.com/0xPlaygrounds/rig
max_upload_size
id1440054
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(cvauclair)

documentation

README

Rig logo + Neo4j logo



This companion crate implements a Rig vector store based on Neo4j Graph database. It uses the neo4rs crate to interact with Neo4j. Note that the neo4rs crate is a work in progress and does not yet support all Neo4j features. Further documentation on Neo4j & vector search integration can be found on the neo4rs docs.

Prerequisites

The GenAI plugin is enabled by default in Neo4j Aura.

The plugin needs to be installed on self-managed instances. This is done by moving the neo4j-genai.jar file from /products to /plugins in the Neo4j home directory, or, if you are using Docker, by starting the Docker container with the extra parameter --env NEO4J_PLUGINS='["genai"]'. For more information, see Operations Manual → Configure plugins.

Usage

Add the companion crate to your Cargo.toml, along with the rig-core crate:

[dependencies]
rig-neo4j = "0.1"

You can also run cargo add rig-neo4j rig-core to add the most recent versions of the dependencies to your project.

See the examples folder for usage examples.

Notes

  • The rig-neo4j::vector_index module offers utility functions to create and query a Neo4j vector index. You can also create indexes using the Neo4j browser or directly call cypther queries with the Neo4rs crate. See the Neo4j documentation for more information. Example examples/vector_search_simple.rs shows how to create an index on existing data.
CREATE VECTOR INDEX moviePlots
FOR (m:Movie)
ON m.embedding
OPTIONS {indexConfig: {
    `vector.dimensions`: 1536,
    `vector.similarity_function`: 'cosine'
}}

Roadmap

  • Add support for creating the vector index through RIG.
  • Add support for adding embeddings to an existing database
  • Add support for uploading documents to an existing database
Commit count: 327

cargo fmt