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
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