Neo4jVector retrieval from multiple indexes

90 Views Asked by At

I am using LangChain's Neo4j Vector Index, and its Neo4jVector.from_existing_index function.

This is an example I found for the structure:

movie_plot_vector = Neo4jVector.from_existing_index(
    embedding_provider,
    url="url",
    username="neo4j",
    password="pasword",
    index_name="customerIndex",
    embedding_node_property="embedding_customer_name",
    text_node_property="customer_name",
)

plot_retriever = RetrievalQA.from_llm(
    llm=llm,
    retriever=movie_plot_vector.as_retriever(),
    verbose=True,
    return_source_documents=True
)

I want to know if there is a way to search on multiple indexes, what I would imagine this would look like:

movie_plot_vector = Neo4jVector.from_existing_index(
    embedding_provider,
    url="url",
    username="neo4j",
    password="pasword",
    index_name=["customerIndex","problemIndex"]
    embedding_node_property=["embedding_customer_name","embedding_problem"]
    text_node_property=["customer_name","problem_description"]
)

plot_retriever = RetrievalQA.from_llm(
    llm=llm,
    retriever=movie_plot_vector.as_retriever(),
    verbose=True,
    return_source_documents=True
)

Or is there another function from Neo4jVector which does what I need? Can anyone guide me to find a solution please?

0

There are 0 best solutions below