Refactor OpenViking Memory API and User Management

- Updated API authentication headers to use `X-API-Key` for both admin and user APIs.
- Modified the account creation process to directly create user-specific accounts without requiring an admin workspace.
- Enhanced user creation to return account-specific details, including `admin_user_id`.
- Introduced new endpoints for retrieving task status and user profiles, allowing for more flexible user data management.
- Updated search functionality to include additional parameters such as `level` and `score_threshold`.
- Improved the handling of user keys in the storage layer to associate them with specific accounts.
- Added tests to validate the new user account creation process and search functionalities, ensuring proper integration with the OpenViking service.
- Included new documentation to reflect changes in API usage and expected request/response formats.
This commit is contained in:
2026-05-27 16:09:28 +08:00
parent a89807b174
commit 70cda923b2
13 changed files with 543 additions and 165 deletions

View File

@ -147,7 +147,10 @@ curl -s -X POST <MEMORY_SYSTEM_BASE_URL>/memory-system/search \
"session_id": "<SESSION_ID>",
"query": "我喜欢喝什么咖啡?",
"use_llm": false,
"limit": 10
"limit": 10,
"level": 2,
"score_threshold": 0.8,
"target_uri": "viking://user/memories"
}'
```
@ -162,11 +165,14 @@ curl -s -X POST <MEMORY_SYSTEM_BASE_URL>/memory-system/search \
"session_id": "<SESSION_ID>",
"query": "我的偏好是什么?",
"use_llm": true,
"limit": 10
"limit": 10,
"level": 2,
"score_threshold": 0.8,
"target_uri": "viking://user/memories"
}'
```
Raw API search responses include merged `items` plus compact backend diagnostics. Fields named `vector` are stripped recursively before the API returns JSON. The API does not return EverOS `original_data` or full episode payloads inside `backends` anymore.
Raw API search responses include merged `items` plus compact backend diagnostics. Fields named `vector` are stripped recursively before the API returns JSON. The API does not return EverOS `original_data` or full episode payloads inside `backends` anymore. OpenViking search uses `/api/v1/search/search`; `target_uri`, `level`, and `score_threshold` are optional request fields.
The search response shape should now look more like:
@ -219,9 +225,15 @@ Use the compact `text` fields for answering. Only inspect raw `backends` when de
## Profile
```bash
curl -s "<MEMORY_SYSTEM_BASE_URL>/memory-system/users/<USER_ID>/profile?user_key=<USER_KEY>"
curl -sS --get "<MEMORY_SYSTEM_BASE_URL>/memory-system/users/<USER_ID>/profile" \
--data-urlencode "user_key=<USER_KEY>" \
--data-urlencode "query=我想喝东西" \
--data-urlencode "limit=10" \
--data-urlencode "level=2"
```
This combines EverOS profile with OpenViking memory recall. The OpenViking request uses `/api/v1/search/search` with `target_uri: viking://user/memories`, `limit`, and `level`.
## Response Interpretation
Inspect backend status: