Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Import Knowledge and Memory Portability (`import-kb`)

A utility package for importing distilled knowledge into a ChromaDB-based Long-Term Memory (LTM) system and backing up or restoring OmegaClaw user memory.
A utility package for importing distilled knowledge into a ChromaDB-based Long-Term Memory (LTM) system and backing up or restoring Omega user memory.

## Purpose
The `import-kb` package is designed to bridge the gap between static knowledge files (JSONL, MeTTa) and an active agent's memory. It processes structured knowledge, generates vector embeddings, and upserts them into a ChromaDB collection, enabling semantic search and retrieval for AI agents.

The package also provides `memory_portability`, a programmatic interface for exporting and restoring OmegaClaw conversation history and user LTM records. OmegaClaw Core remains responsible for its CLI, container lifecycle, transfer-directory mount, and user-facing decisions.
The package also provides `memory_portability`, a programmatic interface for exporting and restoring Omega conversation history and user LTM records. Omega Core remains responsible for its CLI, container lifecycle, transfer-directory mount, and user-facing decisions.

## Supported Embedding Models
This package supports two primary embedding modes:
Expand Down Expand Up @@ -88,7 +88,7 @@ from pathlib import Path
from memory_portability import MemoryStore, MemoryTransfer

store = MemoryStore(
memory_dir=Path("/path/to/omegaclaw/memory"),
memory_dir=Path("/path/to/omega/memory"),
chroma_path=Path("/path/to/chroma_db"),
collection_name="memories",
)
Expand All @@ -98,11 +98,11 @@ transfer = MemoryTransfer(
)

transfer.export(component="both")
transfer.import_archive("omegaclaw-memory-<timestamp>.tar.gz")
transfer.import_archive("omega-memory-<timestamp>.tar.gz")
transfer.recover()
```

`MemoryStore` does not infer OmegaClaw paths or read them from environment
`MemoryStore` does not infer Omega paths or read them from environment
variables. Resolve these values in the host application's configuration layer.

## Dependencies
Expand Down
20 changes: 10 additions & 10 deletions src/import_knowledge/KB/max_distilled_knowledge.jsonl

Large diffs are not rendered by default.

146 changes: 73 additions & 73 deletions src/import_knowledge/KB/oma_distilled_knowledge.jsonl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/memory_portability/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Portable export and restore of OmegaClaw user memory."""
"""Portable export and restore of Omega user memory."""

from .storage import MemoryStore
from .transfer import MemoryTransfer
Expand Down
6 changes: 3 additions & 3 deletions src/memory_portability/exporter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Logical export of OmegaClaw history and user LTM records."""
"""Logical export of Omega history and user LTM records."""

from __future__ import annotations

Expand All @@ -23,7 +23,7 @@ def export_memory(
) -> dict:
"""Create and atomically publish a memory archive.

The caller must hold OmegaClaw's memory-write lock for the duration of this
The caller must hold Omega's memory-write lock for the duration of this
synchronous call when a cross-component point-in-time snapshot is required.
"""
if component not in {"history", "ltm", "both"}:
Expand Down Expand Up @@ -110,7 +110,7 @@ def export_memory(

def _default_filename() -> str:
timestamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
return f"omegaclaw-memory-{timestamp}.tar.gz"
return f"omega-memory-{timestamp}.tar.gz"


def _validate_filename(filename: str) -> None:
Expand Down
8 changes: 4 additions & 4 deletions src/memory_portability/storage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""OmegaClaw memory storage primitives reused by export and import.
"""Omega memory storage primitives reused by export and import.

This module intentionally follows the same direct, environment-driven approach
as ``import_knowledge.py`` and the existing memory extraction script. It does not copy raw
Expand All @@ -18,7 +18,7 @@

DEFAULT_COLLECTION = "memories"
DEFAULT_BATCH_SIZE = 500
DEFAULT_OMEGACLAW_ROOT = Path("/PeTTa/repos/OmegaClaw-Core")
DEFAULT_OMEGA_ROOT = Path("/PeTTa/repos/Omega")
_KNOWN_DIMENSIONS = {
"intfloat/e5-large-v2": 1024,
"text-embedding-3-large": 3072,
Expand All @@ -34,7 +34,7 @@ def is_user_record(metadata: object) -> bool:


class MemoryStore:
"""Read and mutate OmegaClaw's persistent user-memory components."""
"""Read and mutate Omega's persistent user-memory components."""

def __init__(
self,
Expand Down Expand Up @@ -211,7 +211,7 @@ def archive_metadata(self) -> dict[str, str]:
except PackageNotFoundError:
package_version = "development"
return {
"omegaclaw_version": os.environ.get("OMEGACLAW_VERSION", "unknown"),
"omega_version": os.environ.get("OMEGA_VERSION", "unknown"),
"import_kb_version": package_version,
"chromadb_version": chromadb.__version__,
}
Expand Down
2 changes: 1 addition & 1 deletion src/memory_portability/transfer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Small synchronous facade for OmegaClaw's CLI and skill layers."""
"""Small synchronous facade for Omega's CLI and skill layers."""

from __future__ import annotations

Expand Down
4 changes: 2 additions & 2 deletions src/memory_portability/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .archive import FORMAT_VERSION, MANIFEST_NAME, expected_members
from .errors import ArchiveValidationError

FORMAT_NAME = "omegaclaw-user-memory"
FORMAT_NAME = "omega-user-memory"


def sha256_file(path: Path) -> str:
Expand Down Expand Up @@ -101,7 +101,7 @@ def _validate_manifest_metadata(manifest: dict) -> None:
source = manifest.get("source")
if not isinstance(source, dict):
raise ArchiveValidationError("Manifest source is required")
for key in ("omegaclaw_version", "chromadb_version"):
for key in ("omega_version", "chromadb_version"):
if not isinstance(source.get(key), str) or not source[key]:
raise ArchiveValidationError(f"Manifest source.{key} is required")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_memory_portability.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_default_export_filename_has_no_random_suffix(tmp_path):
result = MemoryTransfer(tmp_path / "transfer", source).export("history")

assert re.fullmatch(
r"omegaclaw-memory-\d{8}T\d{6}Z\.tar\.gz", result["filename"]
r"omega-memory-\d{8}T\d{6}Z\.tar\.gz", result["filename"]
)


Expand Down