Skip to main content
API key authentication and the associated management-precheck behavior on this page are unreleased Preview features, verified against public source adcdfdcc6a5a213b249a8caad435b939c01df7f6. Stable VeADK 1.1.13 does not include them. Install that source before using the API key examples
The viking backend integrates with the managed VikingDB knowledge base service. Files are first uploaded to TOS (object storage), then registered into a VikingDB collection; splitting, embedding, and retrieval all run server-side, so no local embedding is required. It is the recommended backend for production.

When to use

  • You need a managed, ready-to-use knowledge base service without maintaining a vector store yourself;
  • You want server-side splitting, embedding, and reranking;
  • You need metadata-filtered retrieval.

Prerequisites

  • A Volcengine or BytePlus account with a VikingDB knowledge base created;
  • A TOS bucket for uploading files;
  • On first use, the backend automatically creates the target collection if it does not exist.

Usage

Set the AK/SK, project, region, and TOS bucket below first. Initialization may create a collection; ingestion uploads documents for server-side processing. These actions require resource permissions and may incur charges
You can also pass project and credentials explicitly via backend_config:
Search an existing collection using an API key:

Parameters

KnowledgeBase parameters

Constructor parameters

backend_config supports the following settings:
Credential resolution checks AGENTKIT_CLOUD_PROVIDER and then CLOUD_PROVIDER to determine the cloud provider. When set to byteplus, credentials are read from BYTEPLUS_ACCESS_KEY, BYTEPLUS_SECRET_KEY, and BYTEPLUS_SESSION_TOKEN; otherwise from VOLCENGINE_ACCESS_KEY, VOLCENGINE_SECRET_KEY, and VOLCENGINE_SESSION_TOKEN.
When api_key is set, knowledge search uses API key auth. If volcengine_access_key and volcengine_secret_key are not configured, the backend skips collection management precheck (existence check and auto-creation). Creating, deleting, listing collections, and operations such as add_from_text / add_from_files that upload through TOS still require valid AK/SK or IAM credentials. When both API key and AK/SK are configured, search uses the API key and management uses AK/SK or IAM.

TOS config

tos_config is a TOSConfig with env prefix DATABASE_TOS_:
Under byteplus, the TOS region and endpoint are resolved in the following priority: an explicitly passed tos_config takes precedence; otherwise DATABASE_TOS_REGION and DATABASE_TOS_ENDPOINT environment variables are used; if neither is set, the TOS region and endpoint are automatically aligned with the knowledge base region. TOS bucket creation also uses the aligned region.

Retrieval parameters

Besides query and top_k, the search method also supports:

Environment variables

Embedding, splitting, and retrieval all run server-side in VikingDB, so this backend requires no embedding model configuration. query_with_user_profile requires Viking long-term memory on the agent; it does not impose that requirement on the knowledge backend
index (the collection name) must start with a letter, contain only letters, digits, and underscores, and be 1-128 characters long; otherwise initialization fails. version supports only "2" or "4".
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
Last modified on September 19, 2026