Manage OpenClaw long-term memory by operating directly on MemoryOS storage files and by following the MemoryOS data model used in long_term_user.json and long_term_assistant.json.
Use the bundled script for deterministic operations. Read the reference file only when you need to confirm the on-disk layout or explain how MemoryOS maps user profile, user knowledge, and assistant knowledge.
Prefer scripts/memoryos_admin.py over ad hoc edits.
Common commands:
python scripts/memoryos_admin.py summary --data-root "D:\path\to\memoryos_data" --user-id alice --assistant-id openclaw
python scripts/memoryos_admin.py search-user --data-root "D:\path\to\memoryos_data" --user-id alice --query "project preference"
python scripts/memoryos_admin.py add-user-knowledge --data-root "D:\path\to\memoryos_data" --user-id alice --text "User prefers concise technical answers."
python scripts/memoryos_admin.py set-profile --data-root "D:\path\to\memoryos_data" --user-id alice --profile-file ".\profile.txt"
python scripts/memoryos_admin.py backup --data-root "D:\path\to\memoryos_data" --user-id alice --assistant-id openclaw
Follow this order unless the user asks for a narrower task:
summary to inspect current profile and knowledge counts.backup before any mutating action.search-user or search-assistant to verify whether the target memory already exists.add-user-knowledge, add-assistant-knowledge, or set-profile for intentional updates.export-markdown when the user wants a readable audit or handoff artifact.Treat these files as the authoritative long-term memory state:
users//long_term_user.json assistants//long_term_assistant.json Interpret them this way:
user_profiles..data : current synthesized user profileknowledge_base[]: user-specific long-term knowledge entriesassistant_knowledge[]: assistant-side reusable knowledge entriesPreserve existing timestamps unless you are explicitly adding or replacing content.
Do not hand-edit embeddings. The bundled admin script stores and updates records without embeddings on purpose, because this skill is for memory administration, curation, backup, and inspection. Semantic retrieval inside live MemoryOS runtime can rebuild or add embeddings through normal MemoryOS flows when needed.
Use set-profile only when the user wants to replace the synthesized profile with a curated version.
Use add-user-knowledge for durable facts about the user, preferences, identity, recurring tasks, or persistent context that OpenClaw should remember.
Use add-assistant-knowledge for workflow instructions, project background, house rules, or reusable operational knowledge that belongs to the assistant rather than the user.
Before appending a near-duplicate memory, search first and ask whether the old entry should be kept, replaced manually, or left unchanged if the instruction is ambiguous.
If OpenClaw is not present in the workspace, treat OpenClaw as the consuming agent and MemoryOS as the storage backend. The critical integration contract is the MemoryOS data_storage_path and the chosen user_id plus assistant_id.
When wiring another agent project to MemoryOS:
user_id per personassistant_id per OpenClaw persona or deploymentdata_storage_pathRead references/memoryos-layout.md when you need exact file layout and field names.
共 1 个版本