feat(memory): add TOS ContextBucket long-term memory backend#703
Open
huangmorven wants to merge 1 commit into
Open
feat(memory): add TOS ContextBucket long-term memory backend#703huangmorven wants to merge 1 commit into
huangmorven wants to merge 1 commit into
Conversation
huangmorven
force-pushed
the
feat/mem-tos-context-bucket
branch
2 times, most recently
from
July 22, 2026 06:44
84822de to
f6ab474
Compare
Introduce a `tos_context` long-term memory backend backed by Volcengine TOS ContextBucket, wired through the runtime direct-connect path (LongTermMemory(backend="tos_context")), configuration, tests, and docs. Backend & wiring - Add TosContextBucketLTMBackend that maps VeADK's memory abstraction onto ContextBucket coordinates (app_name/index -> context bucket, user_id -> context set), with lazy bucket ensure and the standard save/search hooks. - Register the backend under backend="tos_context" and strip the injected session_id / app_name kwargs the SDK does not accept. - Add TOSContextBucketConfig so the backend can be configured from config.yaml. Credentials - Resolve credentials via _get_ak_sk_sts(): use explicit AK/SK (with the STS token from VOLCENGINE_SESSION_TOKEN) when both are present, otherwise fall back to the VeFaaS IAM credential file, mirroring VikingDBLTMBackend so keyless cloud (VeFaaS / AgentKit) deployments authenticate correctly. - Use the global VOLCENGINE_SESSION_TOKEN for the STS token instead of a standalone DATABASE_TOS_CONTEXT_SECURITY_TOKEN, matching TOS object storage and other components. Fail-closed dependency handling - ContextBucket APIs require tos>=2.9.4b1 (beta). Keep the core dependency at tos>=2.8.4 and probe TosClientV2 for the required methods at init, raising a clear RuntimeError with the upgrade command when the installed SDK is too old. Tests & docs - Add backend tests covering the explicit / IAM-fallback / VOLCENGINE_SESSION_TOKEN-default credential paths. - Add zh/en wiki pages, update the long-term memory index and sidebar, and note in the backend comparison table that temporary credentials need VOLCENGINE_SESSION_TOKEN (with an anchor to the configuration section). - Extend config.yaml.full with the tos_context section; the STS token uses the global VOLCENGINE_SESSION_TOKEN documented on the backend page rather than a dedicated placeholder. Note: the backend targets the runtime direct-connect path only; the CLI harness template and cloud harness env mapping are intentionally not wired for tos_context.
huangmorven
force-pushed
the
feat/mem-tos-context-bucket
branch
from
July 23, 2026 05:43
f6ab474 to
9dd6998
Compare
yaozheng-fang
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a
tos_contextlong-term memory backend backed by Volcengine TOS ContextBucket, and wire it through configuration, the cloud harness, tests, and docs.Backend & wiring
Credentials
Fail-closed dependency handling
Tests & docs