Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Split documents into chunks for embedding
from agno.knowledge import Knowledge
knowledge = Knowledge(
path="docs/",
vector_db=vector_db,
chunk_size=1000, # Characters per chunk
chunk_overlap=200 # Overlap between chunks
)
from agno.knowledge import Knowledge
from agno.knowledge.chunking.semantic import SemanticChunker
knowledge = Knowledge(
path="docs/",
vector_db=vector_db,
chunker=SemanticChunker()
)
from agno.knowledge.chunking.fixed import FixedChunker
from agno.knowledge.chunking.recursive import RecursiveChunker
# Fixed-size chunks
knowledge = Knowledge(
path="docs/",
chunker=FixedChunker(chunk_size=500)
)
# Recursive chunking (splits by paragraphs, then sentences)
knowledge = Knowledge(
path="docs/",
chunker=RecursiveChunker()
)