接口 Knowledge


@Deprecated(forRemoval=true, since="2.0.0") public interface Knowledge
已过时, 待删除: 此 API 元素将从以后的版本中删除。
since 2.0.0. The rag package is removed; integrate retrieval at the application layer.
Interface for knowledge bases.

This interface provides a unified API for storing and retrieving documents in a knowledge base. Knowledge bases are used in RAG (Retrieval-Augmented Generation) systems to provide context to language models.

  • 方法概要

    修饰符和类型
    方法
    说明
    reactor.core.publisher.Mono<Void>
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    Adds documents to the knowledge base.
    reactor.core.publisher.Mono<List<Document>>
    retrieve(String query, RetrieveConfig config)
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    Retrieves relevant documents based on a query.
  • 方法详细资料

    • addDocuments

      reactor.core.publisher.Mono<Void> addDocuments(List<Document> documents)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Adds documents to the knowledge base.

      Documents are embedded and stored in the vector database for later retrieval.

      参数:
      documents - the list of documents to add
      返回:
      a Mono that completes when all documents have been added
    • retrieve

      reactor.core.publisher.Mono<List<Document>> retrieve(String query, RetrieveConfig config)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Retrieves relevant documents based on a query.

      The query is embedded and used to search for similar documents in the knowledge base. Results are filtered by the score threshold and limited by the configured limit.

      参数:
      query - the search query text
      config - the retrieval configuration (limit, score threshold, etc.)
      返回:
      a Mono that emits a list of relevant Document objects, sorted by relevance