context_search backend integrates with the managed Volcengine Context Search service. Files are uploaded to TOS (object storage) via pre-signed URLs, then registered into a Context Search RAG scene; splitting, embedding, and retrieval all run server-side, so no local embedding is required.
When to use
- You need a managed semantic-search service without maintaining a vector store yourself;
- You have created a RAG scene and a search engine in Volcengine Context Search.
Prerequisites
- A Volcengine account with a Context Search RAG scene whose scene ID is a numeric string;
- The search engine’s Endpoint and API Key (required for retrieval).
Usage
First set the AK/SK, scene, and engine variables below, and replace the example numeric ID with your actual RAG scene ID. Uploads require scene write permissions; searches require the engine API key. The engine must index the same scene. Data is uploaded for remote processingbackend_config:
Parameters
KnowledgeBase parameters
Constructor parameters
backend_config supports the following settings:
Environment variables
Embedding and retrieval both run server-side in Context Search, so this backend requires no embedding model configuration. Ingestion is asynchronous: after files are uploaded, wait for server-side indexing to complete before searching.
CLOUD_PROVIDER=byteplus changes the default region and API host. Global configuration can map BytePlus AK/SK to the fields read by this backend. Explicitly provide STS tokens through volcengine_session_token or VOLCENGINE_SESSION_TOKEN; the endpoint, credentials, and scene must belong to the same environment. Directory ingestion recursively scans all files; exclude content that should not be uploaded before importing
The example search should return the annual-leave policy. For empty results, check successful ingestion, matching embedding dimensions, completed server processing, network access, and permissions. Managed ingestion may not be immediately searchable. Running the configured Agent also requires model credentials