Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/core / / GraphEntity

Interface: GraphEntity

Defined in: packages/core/src/types/memory.ts:353

Canonical entity in the lightweight in-SQLite relation graph (P2-1). The entity resolver (@graphorin/memory) deduplicates the raw subject/object strings on facts into canonical entities - merging aliases ("Anna", "Anna S.", "my sister") via lexical + embedding similarity (with optional LLM adjudication) - so multi-hop recall can traverse relationships instead of fragmenting them.

Merges are append-only and reversible: a merged entity is never deleted - its GraphEntity.mergedInto points at the surviving canonical entity, every merge / unmerge is recorded in an audit ledger, and mergedInto is single-level (it always points directly at a root), so mergedInto ?? id is the canonical id.

Core defines only the record shape; the storage surface for the graph (upsert / link / merge / one-hop expansion) is NOT part of the baseline MemoryStore contract - it lives in the optional GraphMemoryStoreExt exported from @graphorin/memory (W-048). Adapters without it simply have no relation graph.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
createdAtreadonlystring-packages/core/src/types/memory.ts:367
idreadonlystring-packages/core/src/types/memory.ts:354
mergedInto?readonlystringCanonical pointer. undefined ⇒ this entity is itself a root. Otherwise it is the id of the surviving entity this one was merged into; single-level by construction, so mergedInto ?? id resolves the canonical id without a recursive walk.packages/core/src/types/memory.ts:366
namereadonlystringDisplay name as first observed (the surface form that minted it).packages/core/src/types/memory.ts:357
normalizedNamereadonlystringCase/space-folded key used for lexical dedup + the canonical unique index.packages/core/src/types/memory.ts:359
updatedAt?readonlystring-packages/core/src/types/memory.ts:368
userIdreadonlystring-packages/core/src/types/memory.ts:355