IndexBuilder
IndexBuilder processes document directories into searchable indexes. It handles
file discovery, text extraction, chunking, embedding generation, and storage into
either SQLite (.swsearch files) or pgvector backends. This is the programmatic
equivalent of the sw-search CLI tool.
Requires search dependencies. Install with pip install signalwire-sdk[search-full]
for full document processing support.
Properties
model_name
Name of the sentence transformer model used for embeddings.
chunking_strategy
Active chunking strategy passed to the internal DocumentProcessor.
min_chunk_size
For the markdown strategy, the minimum words a section needs before a
heading is allowed to start a new chunk. Shorter sections merge forward
into the next one instead of being emitted alone. 0 splits at every
heading. Recorded in the index metadata.
backend
Storage backend. Either "sqlite" or "pgvector".
doc_processor
The DocumentProcessor
instance used for chunking.
model
The loaded sentence transformer model. None until the first call to
build_index() or build_index_from_sources().