Skip to main content
API key authentication, custom service URLs, 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 uses Volcengine VikingDB memory as long-term storage. It is a managed service requiring no self-hosted vector store or local embedding — recommended for production. This backend also supports user profiles (get_user_profile), the only backend that does. The earlier viking_mem backend is deprecated and is automatically mapped to viking; both have the same behavior.

When to use

  • Production with persistence and managed operations;
  • When you want Volcengine’s memory capabilities, including user profiles;
  • You have a Volcengine account with the corresponding AK/SK or IAM credentials.

Usage

Enable VikingDB memory in the target region and configure credentials below before running. AK/SK initialization checks for and may create a collection and requires collection-management permissions. Writes send conversation content to the remote service. For BytePlus, use CLOUD_PROVIDER=byteplus, BYTEPLUS_ACCESS_KEY, and BYTEPLUS_SECRET_KEY, plus BYTEPLUS_SESSION_TOKEN for temporary credentials
At init, if the collection does not exist, VeADK creates it from memory_type.
When you select the VikingDB Memory backend in Studio’s custom creation flow, you can browse and pick an existing VikingDB memory collection from the current account. Selecting an existing collection uses its name as the collection index, and Studio automatically fills the project, region, and memory-type environment variables. If you do not select one, the collection name is auto-generated from the agent name, and the collection is created at runtime if it does not exist. See the Studio agent workbench.
You can also pass config explicitly via backend_config:
Access an existing collection using an API key:

Get a user profile

Parameters

LongTermMemory parameters

Constructor parameters

backend_config supports the following settings:

Credential resolution order

The backend prefers volcengine_access_key and volcengine_secret_key from explicit arguments or environment variables. When both are missing, it reads credentials from the VeFaaS IAM file, suitable for Volcengine cloud deployments.
When api_key is set, memory read and write operations use 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, listing, and deleting collections still require AK/SK or IAM credentials. When both API key and AK/SK are configured, memory operations use the API key and management uses AK/SK or IAM.

Defaults for region and memory_type

  • region: in byteplus mode it is always cn-hongkong, ignoring the env var and any explicitly passed value; in other modes, when not set explicitly it reads DATABASE_VIKING_REGION and then REGION, defaulting to cn-beijing if neither is set.
  • memory_type: when not set explicitly, reads env DATABASE_VIKINGMEM_MEMORY_TYPE (a comma-separated string is parsed into a list); when still empty, defaults to ["sys_event_v1", "sys_profile_v1"].

Environment variables

index (the collection name) must follow VikingDB rules: start with an English letter, contain only letters, digits, and underscores, length 1–128; otherwise initialization fails.
viking is the only backend that supports get_user_profile(user_id), returning the user’s profile information; other backends return an empty string for that method.

Verify writes and retrieval

After configuring the dependencies and credentials on this page, run this standalone example. It saves user text and searches for that user directly without calling a conversation model
Results should contain the saved language preference. Managed services may extract memories asynchronously, so a completed write does not guarantee immediate retrieval. An empty result can also indicate permission, network, or service failure; check error logs and service records. The save method does not return a success Boolean
Last modified on September 19, 2026