Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
createEntitygetEntityresolveEntitylistEntitiesupdateEntityrenameEntitymergeEntitiesunmergeEntitytombstoneEntity
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKEntitiescreateEntity

createEntity

Create an entity with a canonical name, aliases and a schema-declared type.

PURPOSE

Create an entity directly, rather than letting extraction discover one. The type must exist in the active schema.

POST/v1/entitiesBearer API keystable
createEntity(input: CreateEntityInput): Promise<CreateEntityResult>
Handshake credentialstable
createEntity(request: EntityCreateRequest): Promise<EntityCreateResponse>

Parameters

ParameterTypeRequired
entityTypeIdintegerrequired

A type id from the active schema. A type that is not declared there is rejected.

canonicalNamestringrequired

The name Brain treats as the entity's own.

aliasesstring[]optional

Other surface forms that should resolve here. Defaults to empty.

Returns

FieldTypePresence
entityIdstringalways

The new entity.

The wire request carries two fields the HTTP body does not: a sessionId, attributing the entity to a session, and an attributesBlob.

Prefer resolveEntity with creation allowed when you are turning a surface form into an entity — it checks for an existing match first, where createEntity always writes a new one.

On the wire

Ids are fixed-width UUID bytes rather than strings, attributes is an opaque attributesBlob, and every request carries a requestId plus an optional actAs. See Wire client.

See also
resolveEntitygetSchema

Was this page helpful?

deleteSession

Remove a session and its memories — tombstoned by default, zeroed with hard.

getEntity

Read one entity — its canonical name, aliases, mention count and merge lineage.

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground