Interface ContentRetriever

All Known Implementing Classes:
AzureAiSearchContentRetriever, EmbeddingStoreContentRetriever, Neo4jContentRetriever, SqlDatabaseContentRetriever, WebSearchContentRetriever

public interface ContentRetriever
Retrieves 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 (see EmbeddingStoreContentRetriever)
 - Full-text search engine (see AzureAiSearchContentRetriever in langchain4j-azure-ai-search module)
 - Hybrid of vector and full-text search (see AzureAiSearchContentRetriever in langchain4j-azure-ai-search module)
 - Web Search Engine (see WebSearchContentRetriever)
 - Knowledge graph (see Neo4jContentRetriever in langchain4j-neo4j module)
 - SQL database (see SqlDatabaseContentRetriever in langchain4j-experimental-sql module)
 - etc.
See Also:
  • Method Summary

    Modifier and Type
    retrieve(Query query)
    Retrieves relevant Contents using a given Query.
  • Method Details

    • retrieve

      List<Content> retrieve(Query query)
      Retrieves relevant Contents using a given Query. The Contents are sorted by relevance, with the most relevant Contents appearing at the beginning of the returned List<Content>.
      query - The Query to use for retrieval.
      A list of retrieved Contents.