Skip to content

Graph-interchange restore: import pre-extracted graphs from external systems #509

Description

@aaronsb

Idea

Raised while discussing the #505 restore-time durability path. The restore endpoint already imports a kg-backup/2 object (concepts + embeddings, sources, instances, evidence, relationships, ontologies, documents). That makes it, in effect, a bulk importer of graph-shaped data — and integration mode + the external-concept-id handling already exist to attach incoming data to an existing graph across embedding spaces.

The question: can we expose a supported path to import a pre-extracted graph from an external system (federation / interchange), distinct from ingesting raw content?

The boundary (important)

  • Restore / interchange = faithful rehydration of an already-extracted graph. No LLM extraction, no concept embedding from scratch — the caller supplies concepts/sources/instances/relationships already in the schema, with compatible embeddings.
  • Ingestion = turning raw documents into a graph (chunk → LLM-extract → embed → upsert). This is where the expensive extraction happens.

These must stay decoupled. The #505 durability path deliberately does NOT do extraction — it only reconstructs the derived :DocumentMeta tier from bytes already present. Folding extraction into restore would blur the two and complicate both.

What an interchange feature would need

  • A documented external→kg-backup/2 mapping contract (what fields a caller must supply, embedding-profile/dimension compatibility rules).
  • Validation at the untrusted-input boundary (the linter lint_backup.py already does referential integrity; extend for interchange-specific cases).
  • Probably its own restore mode or a clearly-scoped variant of integration mode, and an ADR documenting the contract + trust model.

Status

Deliberately out of scope for #505. Filed to capture the idea; needs an ADR before any implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions