
Knowledge Retrieval node configuration
Create and populate knowledge bases before using this node. See the knowledge base creation guide for setup instructions.
Configuration
Query and Knowledge Base Selection
The Query determines what to search for in your knowledge bases. Usesys.query for user input in chatflow applications, or any text variable from your workflow. Queries are limited to 200 characters.
Select one or more Knowledge Bases to search. Each contains indexed documents you’ve uploaded to Dify. Multiple knowledge bases can be searched simultaneously using different strategies.
Retrieval Strategy
Choose how to search your content:- Semantic Search
- Keyword Search
- Hybrid Search
Uses vector embeddings to find conceptually similar content based on meaning. Works well for natural language queries and related concepts with different terminology.
Advanced Settings

Advanced retrieval configuration options
Retrieval Parameters
Top K controls how many document chunks to retrieve. Start with 3-5 chunks for focused results or 10-15 for comprehensive coverage. Score Threshold sets minimum similarity scores. Higher thresholds (0.7+) ensure relevance, lower thresholds (0.5-) include more tangential content. Reranking re-scores results after initial retrieval. Enable for hybrid search, many chunks, or when precision matters more than speed.Metadata Filtering
Filter results using document metadata like type, date, or department. Set up metadata when uploading documents to enable targeted searching in large knowledge bases.Multi-Knowledge Base Strategies
N-to-1 Recall uses function calling to analyze queries, select appropriate knowledge bases, and optimize searches. Best for specialized knowledge bases in different domains. Multi-way Recall queries all selected knowledge bases simultaneously and combines results. Use when information spans multiple sources or you need comprehensive coverage.
Comparison of retrieval strategies for multiple knowledge bases
Output and Integration
The node outputs an array of retrieved document chunks containing text content and metadata (source, score, document ID). This structured output preserves information needed for citations.RAG Integration
Connect Knowledge Retrieval output to LLM node context inputs for RAG applications. When using retrieval results as context variables, Dify automatically tracks sources and enables citations.Rate Limiting
Knowledge retrieval operations are subject to rate limits based on your subscription plan. The system tracks requests using Redis with a 60-second sliding window. When limits are exceeded, aRateLimitExceeded error is returned.