Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

Chunking CLI Commands

Text chunking is primarily an SDK feature for processing documents. The CLI provides knowledge management commands that use chunking internally.

Knowledge Base Commands

# Add a document (automatically chunked)
praisonai-ts knowledge add document.pdf

# Add text content
praisonai-ts knowledge add "Your text content here"

# Search knowledge base
praisonai-ts knowledge search "query" --json

SDK Usage

For direct chunking control, use the SDK:
import { Chunking } from 'praisonai';

// Chunk by size
const chunker = new Chunking({ chunkSize: 100 });
const chunks = chunker.chunk(text);

// Chunk by sentence
const sentenceChunker = new Chunking({ strategy: 'sentence' });
const sentences = sentenceChunker.chunkBySentence(text);

// Chunk by paragraph
const paraChunker = new Chunking({ strategy: 'paragraph' });
const paragraphs = paraChunker.chunkByParagraph(text);

// Chunk with overlap
const overlapChunker = new Chunking({ chunkSize: 50, overlap: 10 });
const overlappedChunks = overlapChunker.chunk(text);

Available Strategies

StrategyDescription
sizeFixed character size chunks
sentenceSplit by sentence boundaries
paragraphSplit by paragraph boundaries
semanticSemantic-aware chunking
For more details, see the Chunking SDK documentation.