Neo4jVector(
self,
embedding: Embeddings,
*,
search_type: SearchType = | Name | Type | Description |
|---|---|---|
url | Optional[str] | Default: NoneNeo4j connection url |
username | Optional[str] | Default: NoneNeo4j username. |
password | Optional[str] | Default: None |
database | Optional[str] | Default: None |
embedding* | Embeddings | |
distance_strategy | DistanceStrategy | Default: DEFAULT_DISTANCE_STRATEGY |
search_type | SearchType | Default: SearchType.VECTOR |
node_label | str | Default: 'Chunk' |
embedding_node_property | str | Default: 'embedding' |
text_node_property | str | Default: 'text' |
retrieval_query | str | Default: '' |
index_type | IndexType | Default: DEFAULT_INDEX_TYPE |
pre_delete_collection | bool | Default: False |
embedding_dimension | Optional[int] | Default: None |
| Name | Type |
|---|---|
| embedding | Embeddings |
| search_type | SearchType |
| username | Optional[str] |
| password | Optional[str] |
| url | Optional[str] |
| keyword_index_name | Optional[str] |
| database | Optional[str] |
| index_name | str |
| node_label | str |
| embedding_node_property | str |
| text_node_property | str |
| distance_strategy | DistanceStrategy |
| logger | Optional[logging.Logger] |
| pre_delete_collection | bool |
| retrieval_query | str |
| relevance_score_fn | Optional[Callable[[float], float]] |
| index_type | IndexType |
| graph | Optional[Neo4jGraph] |
| embedding_dimension | Optional[int] |
Neo4j vector index.
To use, you should have the neo4j python package installed.
Example:
from langchain_neo4j import Neo4jVector
from langchain_openai import OpenAIEmbeddings
url="bolt://localhost:7687"
username="neo4j"
password="password"
embeddings = OpenAIEmbeddings()
vector_store = Neo4jVector.from_documents(
embedding=embeddings,
documents=docs,
url=url,
username=username,
password=password,
)Neo4j password
Optionally provide Neo4j database Defaults to 'neo4j'
Any embedding function implementing
langchain.embeddings.base.Embeddings interface.
The distance strategy to use. (default: COSINE)
The type of search to be performed, either 'vector' or 'hybrid'
The label used for nodes in the Neo4j database.
The property name in Neo4j to store embeddings.
The property name in Neo4j to store the text.
The Cypher query to be used for customizing retrieval. If empty, a default query will be used.
The type of index to be used, either
'NODE' or 'RELATIONSHIP'
If True, will delete existing data if it exists.
Useful for testing.
The dimension of the embeddings. If not provided, will query the embedding model to calculate the dimension.