Brain Docs

Reference

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

resolve_entity

Ask Brain which entity a surface form means — the four outcomes, and why Ambiguous writes nothing.

PURPOSE

Ask Brain which entity a surface form means. This is the verb extraction uses internally, exposed so you can run it yourself.

POST/v1/entities/resolveBearer API keystable
async fn resolve_entity(&self, input: &ResolveEntityInput) -> Result<ResolveEntityResult, BrainHttpError>
Handshake credentialstable
async fn resolve_entity(&self, request: &EntityResolveRequest) -> Result<EntityResolveResponse>

Parameters

ParameterTypeRequired
candidate_namestringrequired

The surface form to resolve — "Priya", "P. Raman".

resolution_contextstringoptional

Surrounding text to disambiguate with. This is what separates two people called Priya.

type_hintintegeroptional

Restrict candidates to one entity type. On the wire the field is entityTypeHint.

allow_createbooleanoptional

Create the entity when nothing matches, instead of answering NotFound.

Returns

FieldTypePresence
outcomeResolved | Created | Ambiguous | NotFoundalways

Resolved — matched an existing entity. Created — creation was allowed and nothing matched. Ambiguous — several candidates tied. NotFound — nothing matched and creation was not allowed.

tierintegeralways

Which resolution tier produced the answer — exact alias, normalised form, embedding similarity, and so on. Low tiers are cheap and certain.

confidencefloatalways

Confidence in [0, 1].

entity_idstring | nullalways

The resolved entity — null on Ambiguous. On the wire the field is resolvedEntity.

candidate_idsstring[]always

The tied candidates, populated on Ambiguous.

Example

let r = brain
    .resolve_entity(&ResolveEntityInput {
        candidate_name: "Priya".into(),
        resolution_context: Some("the engineer who moved to Lisbon".into()),
        allow_create: Some(false),
        ..Default::default()
    })
    .await?;

if r.outcome == "Ambiguous" {
    // resolve by hand from r.candidate_ids
}
Ambiguous writes nothing, silently

When resolution is ambiguous Brain does not pick, and it does not link. The statement that triggered the resolution is stored with no entity attached, and nothing is logged as an error. Reading candidateIds and deciding is the caller's job; ignoring the outcome is how a graph quietly loses its edges.

The wire response also carries an auditId for the resolution, which the HTTP result omits.

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
get_entityEntities, in depth

Was this page helpful?

get_entity

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

list_entities

Enumerate entities by type and name prefix — cursor-paged, with a required type filter.

On this page

ParametersReturnsExampleOn the wire
Suggest an editOpen in Playground