ingest.stores.factory
VectorStoreFactory
VectorStoreFactory ()
*Convenience factory for creating vector stores with sensible defaults.
Provides a simple interface to create the most commonly used vector stores: - ChromaStore (default) - Dense vector store using Chroma - WhooshStore - Sparse text search using Whoosh - ElasticsearchStore - Unified dense + sparse using Elasticsearch*
VectorStoreFactory.create
VectorStoreFactory.create (kind:str='chroma', persist_location:str=None, **kwargs)
*Create a vector store instance.
Args: kind: Type of store to create. One of: - ‘chroma’ (default): ChromaStore for dense vector search - ‘whoosh’: WhooshStore for sparse text search
- ‘chroma+-whoosh’: a DualStore using ChromaStore and WhooshStore - ‘elasticsearch’: ElasticsearchStore for unified dense + sparse - ‘elasticsearch_sparse’: For use with pre-existing Elasticsearch indices without dense vectors persist_location: Where to store the index/database **kwargs: Additional arguments passed to the store constructor
Returns: VectorStore instance
Examples: # Create default ChromaStore store = VectorStoreFactory.create()
# Create WhooshStore for text search
store = VectorStoreFactory.create('whoosh', persist_location='./search_index')
# Create ElasticsearchStore for hybrid search
store = VectorStoreFactory.create('elasticsearch',
persist_location='http://localhost:9200',
index_name='my_docs')*