Knowledge Retrieval
Last updated:2025-04-07

Knowledge Retrieval

The knowledge base serves as an agent's private collection of knowledge. The Knowledge Retrieval node enables querying of specified knowledge bases based on user input, retrieves the most relevant (highest similarity) knowledge chunks, and returns the matched results as a list.

Node Configuration

image.png

  • Search Scope: Defines the range of knowledge bases to query. Supports selecting multiple knowledge bases as the retrieval scope. Required knowledge must first be added to the workflow's designated knowledge bases.

  • Query:The search term used for retrieval. The system will retrieve the most relevant knowledge chunks from the specified knowledge bases using this query.

  • Knowledge Relevance: Defines the minimum relevance (similarity score) for retrieved knowledge chunks. Chunks below this threshold will be excluded.

  • Recall Number: Specifies the maximum number of knowledge chunks to retrieve, prioritized by descending similarity scores.

  • Search Weight:

    • Semantic Search: Interprets relationships between words and sentences in a human-like manner. Recommended for scenarios requiring semantic understanding or cross-language queries.

    • Keyword Search: Performs full-text searches based on exact keywords. Ideal for scenarios where the knowledge contains proper nouns, technical terms, or abbreviations.

    • Mixed Search: Combines semantic and keyword retrieval advantages, and ranks results comprehensively.

  • Rerank Model: Reorders retrieved document snippets by relevance or quality to enhance answer accuracy. Recommended for high-precision use cases (e.g., technical support, expert Q&A).

    • Disable Rerank: Outputs raw vector retrieval results sorted by knowledge relevance.

    • Enable Rerank: The rerank model re-evaluates embedding-based results to prioritize the most contextually relevant documents.

Node Output

image.png

The output is a fixed array named output_list, containing retrieved knowledge chunks sorted by descending relevance. Each entry includes:

  • doc_id: ID of the document containing the knowledge chunk.

  • doc_name: Name of the source document.

  • chunk_id: ID of the knowledge chunk.

  • chunk_content: Content of the knowledge chunk.

  • similarity_score: Relevance between the chunk and the Query.