FalkorDBVector(
self,
embedding: Embeddings,
*,
search_type: SearchType = | Name | Type | Description |
|---|---|---|
host | str | Default: 'localhost'FalkorDB host |
port | int | Default: 6379FalkorDB port |
username | Optional[str] | Default: None |
password | Optional[str] | Default: None |
embedding* | Embeddings | |
pre_delete_collection | bool | Default: False |
search_type | SearchType | Default: SearchType.VECTOR |
database | Optional[str] | Default: generate_random_string(4) |
node_label | str | Default: 'Chunk' |
relation_type | str | Default: '' |
embedding_node_property | str | Default: 'embedding' |
text_node_property | str | Default: 'text' |
embedding_dimension | Optional[int] | Default: None |
retrieval_query | Optional[str] | Default: '' |
index_type | IndexType | Default: DEFAULT_INDEX_TYPE |
graph | Optional[FalkorDBGraph] | Default: None |
relevance_score_fn | Optional[Callable[[float], float]] | Default: None |
ssl | bool | Default: False |
| Name | Type |
|---|---|
| embedding | Embeddings |
| search_type | SearchType |
| username | Optional[str] |
| password | Optional[str] |
| host | str |
| port | int |
| distance_strategy | DistanceStrategy |
| database | Optional[str] |
| node_label | str |
| relation_type | str |
| embedding_node_property | str |
| text_node_property | str |
| embedding_dimension | Optional[int] |
| retrieval_query | Optional[str] |
| index_type | IndexType |
| graph | Optional[FalkorDBGraph] |
| relevance_score_fn | Optional[Callable[[float], float]] |
| ssl | bool |
| pre_delete_collection | bool |
| metadata | List[Any] |
FalkorDB vector index.
To use, you should have the falkordb python package installed
Example:
.. code-block:: python
from langchain_community.vectorstores.falkordb_vector import FalkorDBVector from langchain_community.embeddings.openai import OpenAIEmbeddings from langchain_text_splitters import CharacterTextSplitter
host="localhost" port=6379 raw_documents = TextLoader('../../../state_of_the_union.txt').load() text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0) documents = text_splitter.split_documents(raw_documents)
embeddings=OpenAIEmbeddings() vectorstore = FalkorDBVector.from_documents( embedding=embeddings, documents=documents, host=host, port=port, )
Optionally provide your username details if you are connecting to a FalkorDB Cloud database instance
Optionally provide your password details if you are connecting to a FalkorDB Cloud database instance
Any embedding function implementing
langchain.embeddings.base.Embeddings interface.
If True, will delete existing data if it exists.(default: False). Useful for testing.
Similarity search type to use. Could be either SearchType.VECTOR or SearchType.HYBRID (default: SearchType.VECTOR)
Optionally provide the name of the database to use else FalkorDBVector will generate a random database for you.
Provide the label of the node you want the embeddings of your data to be stored in. (default: "Chunk")
Provide the relationship type of the relationship you want the embeddings of your data to be stored in. (default: "")
Provide the name of the property in which you want your embeddings to be stored. (default: "embedding")
Provide the name of the property in which you want your texts to be stored. (default: "text")
Provide the dimension of your embeddings or it will be calculated for you.
Optionally a provide a retrieval_query else the default retrieval query will be used.
Provide the index type for the VectorStore else the default index type will be used.
Optionally provide the graph you would like to use
Optionally provide a function that computes a relevance score based on the similarity score returned by the search.
Specify whether the connection to the database should be secured using SSL/TLS encryption (default: False)