createEntity
Mint a structured entity directly from a kind and display name, skipping LLM extraction. Deduplicates by identifier so later relations can reference a stable uid.
Instructions
Mint a structured entity of a registered kind directly, bypassing LLM extraction — the write-side complement to relate. Use it when you already hold an entity as (kind, displayName) and need its entities/{uid} to assert a relation, without a remember() round-trip. Inputs: kind (a core kind or a registered extension kind — register first with defineEntityKind, check with introspect), displayName, optional confidence (default 1.0), identifiers (anchor the entity so the resolver attaches future mentions instead of duplicating), alternateNames, and properties (typed attributes validated against the kind's propertySchema). Deduplicates before minting: a matching identifier returns the existing entity (status reused); an existing same-name or near-duplicate of the same kind is NOT created (status duplicate_candidates) — inspect candidates, then reuse a uid, merge with mergeEntities, or retry with force=true to record a genuinely distinct entity that happens to share a name. On a plain create (status created) any advisory near-matches are still listed in candidates. Returns E_VALIDATION on a malformed kind, empty displayName, out-of-range confidence, or non-object properties.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Entity kind. A core kind (person, organization, place, project, event, document) or a registered extension kind (e.g. user:vehicle). Register a new kind with defineEntityKind first; introspect lists what exists. | |
| force | No | Skip the duplicate check and mint a new entity even when one with the same name already exists. Use to record a genuinely distinct entity that shares a name with an existing one (e.g. a second real person named the same). Defaults to false. | |
| scope | No | Scope to write into — pick by who should see it. Defaults to personal (private to the user, syncs to their devices). Use "project" for records tied to the current repo/codebase (shared with anyone who has repo access). Use "team" for the shared team brain (requires admitted membership, else E_PERMISSION). | |
| confidence | No | Writer confidence in the entity's identity. Defaults to 1.0 (user-confirmed). | |
| properties | No | Typed attribute values matching the kind's propertySchema (P3), e.g. {"vin":"…","make":"…"}. Validated on write when strict_attributes is enabled. Optional. | |
| displayName | Yes | Human-readable label, e.g. "Mithril Corp" or "Eowyn". | |
| identifiers | No | Strong/weak external identifiers to anchor the entity so the resolver attaches future mentions instead of minting a duplicate. Optional. | |
| alternateNames | No | Other surface forms for this entity. Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | No | Bare ULID of the entity (set on status created/reused). | |
| kind | No | The entity's kind (set on status created/reused). | |
| name | No | AIP resource name of the entity (set on status created/reused). Pass to relate or get(entities/{uid}). | |
| status | Yes | created = a new entity was minted; reused = an existing entity matched by identifier and is returned in uid/name; duplicate_candidates = NOT created because same-name or near-duplicate entities exist (see candidates) — reuse one, merge with mergeEntities, or retry with force=true. | |
| candidates | No | Existing entities that match by name or embedding. On duplicate_candidates the create was refused; on created these are advisory near-matches you may want to merge. |