Skip to content

Add plugin system for custom chunkers #11

Description

@ahmed-sekka

Description

Create a plugin architecture to allow users to add custom chunking strategies without modifying the core codebase.

Use cases

  • Custom domain-specific chunkers (legal, medical, code)
  • Proprietary chunking algorithms
  • Integration with internal tools

Proposed design

Plugin location

~/.atlasrag/plugins/
└── my_chunker.py

Plugin interface

# ~/.atlasrag/plugins/legal_chunker.py
from ragctl.plugins import ChunkerPlugin, Chunk

class LegalChunker(ChunkerPlugin):
    """Chunker optimized for legal documents."""
    
    name = "legal"
    description = "Splits by legal sections and clauses"
    
    def chunk(self, text: str, **options) -> list[Chunk]:
        # Custom implementation
        chunks = []
        # ... split by ARTICLE, SECTION, CLAUSE patterns
        return chunks

Usage

ragctl chunk contract.pdf --strategy legal

Tasks

  • Design plugin interface (ChunkerPlugin base class)
  • Implement plugin discovery and loading
  • Add plugin validation and error handling
  • Create example plugins
  • Document plugin development guide
  • Add ragctl plugins list command

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions