Skip to content

feat(examples): OpenClaw → OpenViking memory migration tool#1289

Open
deepakdevp wants to merge 1 commit intovolcengine:mainfrom
deepakdevp:feat/openclaw-migration-tool
Open

feat(examples): OpenClaw → OpenViking memory migration tool#1289
deepakdevp wants to merge 1 commit intovolcengine:mainfrom
deepakdevp:feat/openclaw-migration-tool

Conversation

@deepakdevp
Copy link
Copy Markdown
Contributor

Closes #1011.

Summary

  • Adds examples/openclaw-migration/migrate.py — a standalone script that imports OpenClaw workspace memory files directly into OpenViking's memory system
  • Zero LLM calls: uses MemoryExtractor.create_memory() + SessionCompressor._index_memory() for direct write + embedding enqueue
  • Adds examples/openclaw-migration/README.md with usage guide, category mapping table, and dry-run example
  • Adds tests/unit/test_openclaw_migration.py — 25 unit tests, no OV server required

Category mapping

OpenClaw file OV category Reasoning
MEMORY.md, memory.md entities Curated durable knowledge
YYYY-MM-DD.md events Daily logs / time-stamped records
YYYY-MM-DD-slug.md cases Session summaries
Everything else entities Safe fallback

--category flag overrides all files to a single category.

Test plan

  • PYTHONPATH=. .venv/bin/python -m pytest tests/unit/test_openclaw_migration.py -v --no-cov → 25 passed
  • python examples/openclaw-migration/migrate.py --dry-run against a real OpenClaw workspace
  • Real run with --ov-data-dir ./test-data --user-id testuser, verify memories appear under viking://user/testuser/memories/

🤖 Generated with Claude Code

Closes volcengine#1011.

Implements a zero-LLM-call migration script that reads OpenClaw workspace
memory files and writes them directly into OpenViking's memory system using
MemoryExtractor.create_memory() + SessionCompressor._index_memory().

Category mapping:
  MEMORY.md / memory.md     → entities   (curated durable knowledge)
  YYYY-MM-DD.md             → events     (daily logs / time-stamped records)
  YYYY-MM-DD-slug.md        → cases      (session summaries)
  everything else           → entities   (safe fallback)

Files added:
  examples/openclaw-migration/migrate.py   — main migration script
  examples/openclaw-migration/README.md    — usage guide
  tests/unit/test_openclaw_migration.py    — 25 unit tests (no OV server needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1011 - Partially compliant

Compliant requirements:

  • Added migration script examples/openclaw-migration/migrate.py
  • Reads OpenClaw workspace files
  • Uses direct memory write/embedding enqueue
  • Includes --dry-run, --openclaw-dir, --ov-data-dir, etc. flags
  • Added unit tests and documentation

Non-compliant requirements:

  • No resume capability implemented
  • "cases" category used which is not a valid OpenViking MemoryCategory

Requires further human verification:

  • Real run with actual OpenClaw workspace and OpenViking installation
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 78
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Invalid MemoryCategory

The script uses "cases" as a memory category, which is not one of the 6 valid OpenViking MemoryCategory values (PREFERENCES, ENTITIES, PATTERNS, EVENTS, TOOLS, SKILLS). This will cause a ValueError when processing session summary files (YYYY-MM-DD-slug.md).

return "cases"
Invalid CLI Category Choice

The --category flag accepts "cases" as an option, which is not a valid MemoryCategory. This will cause failures when users specify --category cases.

choices=["entities", "events", "cases", "preferences"],

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

@qin-ctx qin-ctx self-assigned this Apr 8, 2026
@qin-ctx
Copy link
Copy Markdown
Collaborator

qin-ctx commented Apr 10, 2026

Thanks for the contribution, and sorry for the delay here. We are about to adjust the agent/user directory layout and namespace model, which may change how memories are distributed and stored. To avoid reviewing and merging migration logic against a layout that is about to change, we'd prefer to pause this PR for now and continue the review after that refactor lands. That should help us evaluate the migration path against the final storage model instead of introducing compatibility baggage too early.

@qin-ctx
Copy link
Copy Markdown
Collaborator

qin-ctx commented Apr 10, 2026

For reference, the refactor we want to land first is here: #1356 . Once that storage / namespace change settles, we can review this migration path against the updated model.

@deepakdevp
Copy link
Copy Markdown
Contributor Author

Thanks for the context, @qin-ctx — makes sense to wait for #1356 to settle before reviewing the migration path against the updated storage model. I'll keep this open and rebase once that lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Feature]: Add migration tool to import existing OpenClaw conversation history into OpenViking

2 participants