18 lines
504 B
Python
18 lines
504 B
Python
"""
|
|
Chunking utilities for the RAG agent.
|
|
|
|
Uses RecursiveCharacterTextSplitter from langchain.text_splitter to split documents into
|
|
chunks of 500 characters with an overlap of 100 characters. The splitter is exposed as a
|
|
singleton instance so that it can be reused across the project.
|
|
"""
|
|
|
|
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
|
|
# Singleton splitter configuration
|
|
CHUNKER = RecursiveCharacterTextSplitter(
|
|
chunk_size=500,
|
|
chunk_overlap=100,
|
|
)
|
|
|
|
__all__ = ["CHUNKER"]
|