Manage long-term memory and user profiles from the terminal with the Bailian CLI.
The Bailian CLI provides commands to add and search memory, manage nodes and profile schemas, and export skill memories from the terminal or an Agent.
For the schema and profile workflow, see Use user profiles.
When upgrading from an older version, replace the memory library flag
Memory CLI capabilities are currently available only to China site (aliyun.com) accounts.
Prerequisites
- Install Bailian CLI version 2.5.0 or later.
- Get an API key and a workspace ID for the same workspace. See Authentication.
--workspace-id or set the following environment variables:
Add, list, and search memory
add submits an async extraction task and waits up to 120 seconds by default. With --wait 0, it returns only the submission receipt. Extraction may continue after a timeout, so check the results before deciding whether to resubmit. The returned event_id identifies the event; use memory_node_id from list or search results to show, update, or delete a node.
search searches fact memories (observation) by default. Pass --memory-types skill to search skill memories. Use --plan-version to choose pro or lite; --min-score works only with pro. See Billing for pricing differences. list queries the default rule only unless you pass --project-id for another rule.
Available commands
| Task | Commands | Notes |
|---|---|---|
| Add and search | bl memory add / bl memory search | Identify the memory owner with --user-id |
| Node management | bl memory list / bl memory node show / bl memory update / bl memory delete | list paginates by user and rule; the other commands use --node-id. update and delete do not accept --user-id |
| Profile schema management | bl memory profile create / bl memory profile list / bl memory profile show / bl memory profile update / bl memory profile delete | Schemas define attributes to extract and can be shared by multiple users |
| Read user profiles | bl memory profile get | Read extracted values with --schema-id and --user-id; first link the schema with add's --profile-schema |
| Export skill memory | bl memory skill export | Export the skill body or JSON with --node-id; it is not installed into an Agent automatically |
--memory-library-id with --library-id. See the 2.5.0 changelog for other migration changes.
Append --help to any command for full parameter details. See the Memory command reference for flags and examples for all 13 commands.