The tos_vector backend uses a vector bucket in Volcengine TOS (object storage) as the vector store. Knowledge text is embedded locally by an embedding model, written to a TOS vector index, and retrieved by cosine similarity. On first use, the vector bucket and index are created automatically if they do not exist.
When to use
- You have a Volcengine account and want to host vector data in a TOS vector bucket;
- You need persistent vector storage while keeping control of embedding locally.
Dependencies
Usage
You can also pass credentials and config explicitly via backend_config:
Parameters
Constructor parameters
backend_config supports the following settings:
TOS vector client config
tos_vector_config is a TOSVectorConfig with env prefix DATABASE_TOS_VECTOR_ (common fields shown):
TOSVectorConfig also exposes advanced fields such as proxy settings (proxy_host/proxy_port/proxy_username/proxy_password), high_latency_log_threshold, and user_agent_*; the defaults are usually fine.
Embedding config
embedding_config is an EmbeddingModelConfig with env prefix MODEL_EMBEDDING_:
Environment variables
add_from_directory and add_from_files are still being refined and may have gaps when handling some files (e.g., documents containing images). Text ingestion (add_from_text) is stable.