osyra_ome.cli.migrate.from_langgraph
Private pre-release / network boundary: The currently usable customer surface is offline verification of an existing signed artifact against an out-of-band trust anchor. Memory/network RPC APIs and host snippets on this page describe protocol and interface shape; the public Edge bridge, package publication, and release acceptance remain pending. Do not treat
api.osyra.ai:443examples as a released customer route.
``osyra-ome migrate from-langgraph`` — ENG-580 / Tier-4 T4-8.
Migrates checkpoint state from LangGraph SQLite or Postgres backends into the OME memory store via main's gRPC ``OmeClient.memory.write_claim`` surface (T4-2).
LangGraph checkpoints are organized around the ``(thread_id, checkpoint_id, parent_id, checkpoint, metadata)`` tuple. The migration:
- Open the LangGraph checkpointer for the requested backend.
- Enumerate distinct ``thread_id`` values in the store.
- For each thread, walk the checkpoint chain in causal order
(root → leaf via
parent_idpointers). - Map each checkpoint to a :class:`Claim` with kind ``ASSERTION``
(root) or
DERIVATION(child of a previous checkpoint, withparents=[parent_uuid]). The LangGraphparent_idchain becomes OME's derivation DAG.
Per the spec, the source library MUST be exercised against a real or mocked-at-the-DB-layer backend. SQLite is the default and easiest path; Postgres works the same way through the ``langgraph-checkpoint-postgres`` package (user-installed; NOT bundled).
References:
- LangGraph checkpoint API: https://langchain-ai.github.io/langgraph/concepts/persistence/
- OME derivation DAG semantics:
ome-proto/proto/ome/v1/ome_service.proto(Claim message).
Constants
| Name | Value |
| --- | --- |
| SOURCE_NAME | 'langgraph' |
Functions
from_langgraph
def from_langgraph(backend: str = typer.Option('sqlite', '--backend', help="LangGraph checkpoint backend: 'sqlite' (default) or 'postgres'. Postgres requires `pip install langgraph-checkpoint-postgres` as a user-installed extra."), path: str = typer.Option(..., '--path', help="Backend connection target. For sqlite: filesystem path to the .db file. For postgres: DSN (e.g. 'postgresql://user@host/db')."), threads_filter: str = typer.Option('', '--threads', help='Comma-separated list of LangGraph thread IDs to migrate. Empty (default) migrates all threads.'), skip_metadata: bool = typer.Option(False, '--skip-metadata', help='Migrate only the checkpoint payload, not the metadata bag. Default: include both.'), ome_endpoint: str = typer.Option(..., '--ome-endpoint', help="OME gRPC target as 'host:port' (e.g. 'api.osyra.ai:443')."), ome_token: str = typer.Option('', '--ome-token', envvar='OSYRA_OME_TOKEN', help='OME bearer token. Prefer OSYRA_OME_TOKEN env var.'), ome_workspace: str = typer.Option(..., '--ome-workspace', help="OME workspace ID (e.g. 'ws-prod')."), ome_workspace_tier: str | None = typer.Option(None, '--ome-workspace-tier', help='Deprecated: Edge derives the effective tier server-side.', hidden=True), target_namespace: str = typer.Option(..., '--target-namespace', help='OME logical namespace to write into. REQUIRED.'), batch_size: int = typer.Option(100, '--batch-size', help='Checkpoints per progress-advance window. Default 100.'), dry_run: bool = typer.Option(False, '--dry-run', help='Read + transform + validate; do NOT write to OME.'), resume_from_checkpoint: Path = typer.Option(None, '--resume-from-checkpoint', help='Resume from a previously-emitted checkpoint file.'), checkpoint_out: Path = typer.Option(None, '--checkpoint-out', help='Emit progress checkpoints to this file after each batch.'), audit_file: Path = typer.Option(None, '--audit-file', help='Append per-record JSON audit events to this file. Default: stderr.'), include_pii: bool = typer.Option(False, '--include-pii', help='Log thread/checkpoint IDs verbatim. Default: false (IDs are hashed).'), strict_audit: bool = typer.Option(False, '--strict-audit', help='Treat audit-emission failures as fatal. Default: warn and continue.'), verbose: bool = typer.Option(False, '--verbose', '-v', help='Print per-checkpoint progress to stderr.'), insecure: bool = typer.Option(False, '--insecure', help='Dial an insecure gRPC channel (no TLS). ONLY for local dev against a non-TLS test server.')) -> NoneMigrate LangGraph checkpoint state into OME.
Example:
export OSYRA_OME_TOKEN=osyra_...
osyra-ome migrate from-langgraph
--backend sqlite
--path ./checkpoints.db
--ome-endpoint api.osyra.ai:443
--ome-workspace ws-prod
--target-namespace ome-prod
--dry-run