Interface ContentRetriever
- All Known Implementing Classes:
AzureAiSearchContentRetriever, AzureCosmosDBNoSqlContentRetriever, ElasticsearchContentRetriever, EmbeddingStoreContentRetriever, SqlDatabaseContentRetriever, WebSearchContentRetriever
public interface ContentRetriever
Retrieves
The goal is to retrieve only relevant
The underlying data source can be virtually anything:
Contents from an underlying data source using a given Query.
The goal is to retrieve only relevant
Contents in relation to a given Query.
The underlying data source can be virtually anything:
- Embedding (vector) store (seeEmbeddingStoreContentRetriever) - Full-text search engine (seeAzureAiSearchContentRetrieverin thelangchain4j-azure-ai-searchmodule) - Hybrid of vector and full-text search (seeAzureAiSearchContentRetrieverin thelangchain4j-azure-ai-searchmodule) - Web Search Engine (seeWebSearchContentRetriever) - Knowledge graph (seeNeo4jContentRetrieverin thelangchain4j-community-neo4j-retrievermodule) - SQL database (seeSqlDatabaseContentRetrieverin thelangchain4j-experimental-sqlmodule) - etc.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault ContentRetrieveraddListener(ContentRetrieverListener listener) Wraps thisContentRetrieverwith a listening retriever that dispatches events to the provided listener.default ContentRetrieveraddListeners(Collection<ContentRetrieverListener> listeners) Wraps thisContentRetrieverwith a listening retriever that dispatches events to the provided listeners.
-
Method Details
-
retrieve
-
addListener
Wraps thisContentRetrieverwith a listening retriever that dispatches events to the provided listener.- Parameters:
listener- The listener to add.- Returns:
- An observing
ContentRetrieverthat will dispatch events to the provided listener. - Since:
- 1.11.0
-
addListeners
Wraps thisContentRetrieverwith a listening retriever that dispatches events to the provided listeners.Listeners are called in the order of iteration.
- Parameters:
listeners- The listeners to add.- Returns:
- An observing
ContentRetrieverthat will dispatch events to the provided listeners. - Since:
- 1.11.0
-