[PR #24524] feat: Add YAML file support for RAG document extraction #30673

Closed
opened 2026-02-21 20:48:00 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/24524

State: closed
Merged: No


fix #24530

This PR introduces comprehensive YAML file support to the RAG (Retrieval-Augmented Generation) document extraction system, enabling structured parsing and processing of YAML configuration files, data files, and other YAML-formatted content.

Key Features:

  • Structured YAML Parsing : Handles both YAML objects and arrays with proper structure preservation

  • Nested Structure Support : Maintains hierarchical relationships and nested data structures

  • Comprehensive Error Handling : Robust error handling for malformed YAML content with detailed error messages

  • Encoding Detection : Automatic encoding detection and fallback mechanisms for various file encodings

  • Rich Metadata : Extracts keys, types, indices, and searchable text for enhanced retrieval
    Files Changed:

  • api/core/rag/extractor/yaml_extractor.py - New YamlExtractor class implementation

  • api/core/rag/extractor/extract_processor.py - Updated to support .yaml and .yml file extensions

  • api/tests/unit_tests/core/rag/extractor/test_yaml_extractor.py - Comprehensive test suite
    Benefits:

  • Enhanced RAG system capability to understand and process YAML configuration files

  • Improved structured data retrieval for DevOps and configuration management use cases

  • Better support for infrastructure-as-code and CI/CD pipeline documentation

  • Preserved key-value relationships and hierarchical structure information for more accurate retrieval
    Testing:

  • Full test coverage including object extraction, array handling, nested structures, Unicode support, and error cases

  • All tests pass successfully

  • Maintains consistency with existing extractor patterns

**Original Pull Request:** https://github.com/langgenius/dify/pull/24524 **State:** closed **Merged:** No --- fix #24530 This PR introduces comprehensive YAML file support to the RAG (Retrieval-Augmented Generation) document extraction system, enabling structured parsing and processing of YAML configuration files, data files, and other YAML-formatted content. Key Features: - Structured YAML Parsing : Handles both YAML objects and arrays with proper structure preservation - Nested Structure Support : Maintains hierarchical relationships and nested data structures - Comprehensive Error Handling : Robust error handling for malformed YAML content with detailed error messages - Encoding Detection : Automatic encoding detection and fallback mechanisms for various file encodings - Rich Metadata : Extracts keys, types, indices, and searchable text for enhanced retrieval Files Changed: - api/core/rag/extractor/yaml_extractor.py - New YamlExtractor class implementation - api/core/rag/extractor/extract_processor.py - Updated to support .yaml and .yml file extensions - api/tests/unit_tests/core/rag/extractor/test_yaml_extractor.py - Comprehensive test suite Benefits: - Enhanced RAG system capability to understand and process YAML configuration files - Improved structured data retrieval for DevOps and configuration management use cases - Better support for infrastructure-as-code and CI/CD pipeline documentation - Preserved key-value relationships and hierarchical structure information for more accurate retrieval Testing: - Full test coverage including object extraction, array handling, nested structures, Unicode support, and error cases - All tests pass successfully - Maintains consistency with existing extractor patterns
yindo added the pull-request label 2026-02-21 20:48:00 -05:00
yindo closed this issue 2026-02-21 20:48:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30673