Class Neo4jContentRetriever
java.lang.Object
dev.langchain4j.rag.content.retriever.neo4j.Neo4jContentRetriever
- All Implemented Interfaces:
ContentRetriever
A
ContentRetriever
that retrieves from an Neo4jGraph
.
It converts a natural language question into a Neo4j cypher query and then retrieves relevant Content
s by executing the query on Neo4j.-
Constructor Summary
ConstructorDescriptionNeo4jContentRetriever
(Neo4jGraph graph, ChatLanguageModel chatLanguageModel, PromptTemplate promptTemplate) -
Method Summary
-
Constructor Details
-
Neo4jContentRetriever
public Neo4jContentRetriever(Neo4jGraph graph, ChatLanguageModel chatLanguageModel, PromptTemplate promptTemplate)
-
-
Method Details
-
retrieve
Description copied from interface:ContentRetriever
Retrieves relevantContent
s using a givenQuery
. TheContent
s are sorted by relevance, with the most relevantContent
s appearing at the beginning of the returnedList<Content>
.- Specified by:
retrieve
in interfaceContentRetriever
- Parameters:
query
- TheQuery
to use for retrieval.- Returns:
- A list of retrieved
Content
s.
-