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 examplesviking 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, useCLOUD_PROVIDER=byteplus, BYTEPLUS_ACCESS_KEY, and BYTEPLUS_SECRET_KEY, plus BYTEPLUS_SESSION_TOKEN for temporary credentials
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.
backend_config:
Get a user profile
Parameters
LongTermMemory parameters
Constructor parameters
backend_config supports the following settings:
Credential resolution order
The backend prefersvolcengine_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: inbyteplusmode it is alwayscn-hongkong, ignoring the env var and any explicitly passed value; in other modes, when not set explicitly it readsDATABASE_VIKING_REGIONand thenREGION, defaulting tocn-beijingif neither is set.memory_type: when not set explicitly, reads envDATABASE_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.