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[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.
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().