ontocast.tool.vector_store.factory¶
Factory for vector store backend selection.
Backend modules are imported inside the selected branch rather than at module
scope: importing :mod:ontocast.tool.vector_store.qdrant pulls the Qdrant SDK
(and, through it, gRPC and an ONNX runtime), and OntoCast's base install ships
neither. Only the backend actually configured is loaded.
create_vector_store_manager(tool_config, embedding, sparse_embedding=None)
¶
Return a vector store manager for the configured backend.
Selection is driven by VectorStoreConfig.backend. The default,
:attr:~ontocast.onto.enum.VectorStoreBackend.AUTO, infers the backend from
whichever connection setting is populated and otherwise resolves to
:attr:~ontocast.onto.enum.VectorStoreBackend.NONE, returning None.
A deployment that configures neither Qdrant nor LanceDB has no vector
retrieval: ontology context comes from a single working ontology, which is
the default :class:~ontocast.onto.enum.OntologyContextMode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_config
|
ToolConfig
|
The resolved tool configuration. |
required |
embedding
|
EmbeddingTool
|
Dense embedding provider. |
required |
sparse_embedding
|
FastembedBm25SparseTool | None
|
BM25 sparse provider, required by both backends. |
None
|
Returns:
| Type | Description |
|---|---|
VectorStoreManager | None
|
A manager for the selected backend, or |
VectorStoreManager | None
|
explicitly disabled. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an explicitly requested backend is not configured, or if
Qdrant's |