k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
query(query: str, *, params: Optional[dict] = None) → List[Dict[str, Any]][source]¶
This method sends a Cypher query to the connected Neo4j database
and returns the results as a list of dictionaries.
Parameters
query (str) – The Cypher query to execute.
params (dict, optional) – Dictionary of query parameters. Defaults to {}.
Returns
List of dictionaries containing the query results.
Return type
List[Dict[str, Any]]
retrieve_existing_fts_index(text_node_properties: List[str] = []) → Optional[str][source]¶
Check if the fulltext index exists in the Neo4j database
This method queries the Neo4j database for existing fts indexes
with the specified name.
Returns
keyword index information
Return type
(Tuple)
retrieve_existing_index() → Optional[int][source]¶
Check if the vector index exists in the Neo4j database
and returns its embedding dimension.
This method queries the Neo4j database for existing indexes
and attempts to retrieve the dimension of the vector index
with the specified name. If the index exists, its dimension is returned.
If the index doesn’t exist, None is returned.
Returns
The embedding dimension of the existing index if found.
Return type
int or None
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.