feat: add user-scoped memory extraction policies - #3906
Open
heaoxiang-ai wants to merge 4 commits into
Open
Conversation
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.
Description
Add user-scoped memory extraction policies for enterprise multi-user OpenViking instances. User defaults are persisted in
user_config.json, resolved at commit time, and frozen into the asynchronous extraction task so policy changes apply immediately without restarting the instance.Human Involvement
Related Issue
N/A
Type of Change
Changes Made
MemoryPolicywith independent self/peer type filters, reject Agent memory for peers, and expandexperiencesto cases/trajectories/experiences only when resolving the effective Self policy.viking://user/{user_id}/settings/user_config.json; add locked backup/update behavior and allowlisted GET/PATCH admin settings APIs.Testing
Commands run:
pytest -q -o addopts='' tests/unit/session/test_memory_policy.py tests/unit/session/test_agent_evolution_policy.py tests/server/test_admin_api.py::test_user_memory_policy_can_be_initialized_and_hot_updated— 16 passed.python -m compileall -q openviking— passed.ruff checkfor all changed Python and test files — passed.The Session integration fixtures could not initialize in the local environment because native AGFS/VectorDB setup failed before reaching the test assertions (
AGFSInvalidOperationError/ local store lock). The added integration cases remain in the suite for CI.Checklist
Screenshots (if applicable)
N/A
Additional Notes
npm run check:apistill reports the pre-existing missing reference forPATCH /api/v1/sessions/{}/config; the two routes introduced here are present in both overview and detailed API references.