Neo4j
Create, find and delete nodes in a Neo4j graph database, run Cypher queries, and store and search vector embeddings in a Neo4j vector index.
What’s inside
-
Neo4j component, URI syntax:
neo4j:name
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-neo4j-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 21 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.neo4j.alias | The Cypher variable that the generated queries bind the node to, such as u in MATCH (u:User). It is not stored in the database. Required by CREATE_NODE, RETRIEVE_NODES, DELETE_NODE and CREATE_VECTOR_INDEX. CREATE_VECTOR uses e when not set | String | |
camel.component.neo4j.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.neo4j.configuration | The shared configuration of the component. Each endpoint starts from a copy of it. The option is a org.apache.camel.component.neo4j.Neo4jConfiguration type. | Neo4jConfiguration | |
camel.component.neo4j.database-url | The URI of the Neo4j server that the driver connects to, such as neo4j://localhost:7687 or bolt://localhost:7687 (the neo4j+s and bolt+s schemes use TLS). The producer also needs credentials: kerberosAuthTicket, token, or username and password. Required unless the driver option is set, which wins over this option and the credentials. | String | |
camel.component.neo4j.detach-relationship | Whether DELETE_NODE deletes the nodes with DETACH DELETE, which also deletes their relationships. When false, deleting a node that still has relationships fails | false | Boolean |
camel.component.neo4j.dimension | The number of dimensions of the vectors in the vector index, set as vector.dimensions by CREATE_VECTOR_INDEX. It must be the length of the embedding vectors. Required by CREATE_VECTOR_INDEX | Integer | |
camel.component.neo4j.driver | The Neo4j Driver to use. When set, databaseUrl and the credentials are not used. Autowired when the registry has a single Driver. The option is a org.neo4j.driver.Driver type. | Driver | |
camel.component.neo4j.enabled | Whether to enable auto configuration of the neo4j component. This is enabled by default. | Boolean | |
camel.component.neo4j.kerberos-auth-ticket | The Kerberos ticket, encoded in Base64, for Kerberos authentication. It wins over token, username and password | String | |
camel.component.neo4j.label | The label of the nodes. CREATE_NODE gives it to the new node, RETRIEVE_NODES and DELETE_NODE match the nodes that have it, and CREATE_VECTOR_INDEX indexes the nodes that have it. Required by these operations. CREATE_VECTOR gives it to the node it creates, and uses Embedding when not set | String | |
camel.component.neo4j.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.neo4j.max-results | The number of nearest neighbours that VECTOR_SIMILARITY_SEARCH asks the vector index for. The nodes that score below minScore are then left out, so the result can have fewer | 3 | Integer |
camel.component.neo4j.min-score | The lowest similarity score that a node needs to be in the result of VECTOR_SIMILARITY_SEARCH. Neo4j gives scores from 0 to 1, where 1 is the most similar, so 0 keeps all the nodes that the vector index returns | Double | |
camel.component.neo4j.operation | The operation to perform. The CamelNeo4jOperation header, when set, wins over this option. | Neo4Operation | |
camel.component.neo4j.password | The password for basic authentication, used together with username | String | |
camel.component.neo4j.realm | The realm for basic authentication, used only together with username and password. When not set, the driver sends no realm | String | |
camel.component.neo4j.similarity-function | The similarity function of the vector index that CREATE_VECTOR_INDEX creates, set as vector.similarity_function. It decides how VECTOR_SIMILARITY_SEARCH scores the nodes | cosine | Neo4jSimilarityFunction |
camel.component.neo4j.token | The token for bearer authentication, such as a token of a single sign-on provider. It wins over username and password | String | |
camel.component.neo4j.username | The user name for basic authentication, used together with password when neither kerberosAuthTicket nor token is set | String | |
camel.component.neo4j.vector-index-name | The name of the vector index that CREATE_VECTOR_INDEX creates (unless an index with this name already exists), DROP_VECTOR_INDEX drops and VECTOR_SIMILARITY_SEARCH queries. Required by these operations | String | |
camel.component.neo4j.query | Cypher Query. Deprecation note: Not used: RETRIEVE_NODES_AND_UPDATE_WITH_CYPHER_QUERY and ADD_OR_DELETE_NODE_WITH_CYPHER_QUERY take the Cypher query from the message body | String |