Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
create_entityget_entityresolve_entitylist_entitiesupdate_entityrename_entitymerge_entitiesunmerge_entitytombstone_entity
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKEntitiescreate_entity

create_entity

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
async fn create_entity(&self, input: &CreateEntityInput) -> Result<CreateEntityResult, BrainHttpError>
Handshake credentialstable
async fn create_entity(&self, request: &EntityCreateRequest) -> Result<EntityCreateResponse>

Parameters

ParameterTypeRequired
entity_type_idintegerrequired

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

canonical_namestringrequired

The name Brain treats as the entity's own.

aliasesstring[]optional

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

Returns

FieldTypePresence
entity_idstringalways

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 resolve_entity with creation allowed when you are turning a surface form into an entity — it checks for an existing match first, where create_entity 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
resolve_entityget_schema

Was this page helpful?

delete_session

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

get_entity

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

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground