Skip to content

Graphorin API reference v0.4.0


Graphorin API reference / @graphorin/core / / GraphEntity

Interface: GraphEntity

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

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.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
createdAtreadonlystring-packages/core/src/types/memory.ts:321
idreadonlystring-packages/core/src/types/memory.ts:308
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:320
namereadonlystringDisplay name as first observed (the surface form that minted it).packages/core/src/types/memory.ts:311
normalizedNamereadonlystringCase/space-folded key used for lexical dedup + the canonical unique index.packages/core/src/types/memory.ts:313
updatedAt?readonlystring-packages/core/src/types/memory.ts:322
userIdreadonlystring-packages/core/src/types/memory.ts:309