Skip to content

feat: add Hermes-native LanceDB memory provider#771

Open
MarsDoge wants to merge 1 commit intoCortexReach:masterfrom
MarsDoge:feat/hermes-native-provider
Open

feat: add Hermes-native LanceDB memory provider#771
MarsDoge wants to merge 1 commit intoCortexReach:masterfrom
MarsDoge:feat/hermes-native-provider

Conversation

@MarsDoge
Copy link
Copy Markdown

@MarsDoge MarsDoge commented May 8, 2026

Summary

Adds a Hermes-native lancedb_pro memory provider under integrations/hermes/lancedb_pro/, plus a safe OpenClaw LanceDB importer for migrating legacy OpenClaw rows into a separate Hermes-schema database.

What changed

  • Adds/updates the Hermes provider implementation and metadata for lancedb_pro.
  • Keeps provider runtime Hermes-schema only, regardless of table name.
  • Supports HERMES_MEMORY_LANCEDB_TABLE override; default remains hermes_memories.
  • Stores JSON fallback data per table (<safe-table-name>.jsonl) to match table override behavior.
  • Adds an OpenClaw migration importer that converts legacy text/timestamp/metadata rows into Hermes content/created_at/metadata_json rows.
  • Adds preflight safety checks before migration writes: missing/non-directory source is rejected before lancedb.connect(), source table existence is verified before target creation/connect, and target paths equal to or inside the source are refused.
  • Preserves original OpenClaw values in metadata_json as original_* fields.
  • Documents migration workflow, table override behavior, and local smoke-test commands.
  • Adds regression tests for provider table override, Hermes schema output, JSON fallback file naming, migration conversion, timestamp conversion, metadata parsing, and migration preflight safety.

Test plan

  • ./.migration-venv/bin/python -m py_compile integrations/hermes/lancedb_pro/provider.py integrations/hermes/lancedb_pro/scripts/import_openclaw_lancedb.py test/hermes_lancedb_pro_provider_test.py test/hermes_lancedb_pro_openclaw_migration_test.py
  • ./.migration-venv/bin/python -m pytest test/hermes_lancedb_pro_provider_test.py test/hermes_lancedb_pro_openclaw_migration_test.py -q
    • Result: 12 passed, 1 skipped.
  • git diff --check
    • Result: passed.
  • npm test
    • Not run in this local checkout because node_modules is not present.

Safety notes

  • No Hermes core files are modified.
  • No live OpenClaw DB writes are performed by the provider or tests.
  • The importer reads an OpenClaw source only after explicit CLI invocation and writes only to a separate target path.
  • The importer refuses source/target path overlap and verifies the source path/table before any target connect/create.
  • No API keys or local private DB paths are included in docs or this PR body.
  • sync_turn/auto-capture remains disabled by default.
  • lancedb_pro_forget deletes only one exact memory id.

Follow-ups

  • Add CI coverage for the Python provider tests if upstream wants Python tests in this Node-centric repository.
  • Consider richer category/scope ranking controls in a separate change.

@MarsDoge MarsDoge force-pushed the feat/hermes-native-provider branch from 0bdbcd7 to 877d1a8 Compare May 8, 2026 10:23
Add a native Hermes plugin for memory-lancedb-pro that lets Hermes use the
existing LanceDB-backed memory store directly instead of going through adapter
shims. The provider includes plugin metadata, a Python entrypoint, and a
session-scoped implementation that exposes store, retrieve, reflection, and
health-check behavior while preserving safe defaults for missing optional
features.

Add OpenClaw migration support for teams moving existing LanceDB data into the
Hermes provider. The importer validates source and destination paths, supports
dry-run and confirmation flows, handles duplicate records safely, and documents
operational guardrails so migrations can be reviewed before data is written.

Document installation, configuration, provider behavior, and migration steps in
the Hermes integration README and migration guide. Cover safety behavior such as
fail-closed validation for destructive migration actions and graceful degradation
when optional LanceDB integrations are unavailable.

Add focused tests for the provider contract and OpenClaw migration importer,
including metadata validation, storage and retrieval flows, path safety checks,
dry-run behavior, and duplicate handling.
@MarsDoge MarsDoge force-pushed the feat/hermes-native-provider branch from 877d1a8 to 2c353a0 Compare May 8, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant