EventBuilder provides a chainable API for constructing events. Start a builder with client.event(), then chain methods to add data.
Starting a builder
| Parameter | Type | Required | Description |
|---|---|---|---|
agentType | string | Yes | Agent classification (e.g., "movie-bot") |
config | EventBuilderConfig | No | Optional agentId and sessionId overrides |
Builder methods
action(name, params)
Define an Action event — use this whenever your agent does something (calls an API, books a seat, sends an email).
outcome(result)
Attach a success outcome to the previously defined action.
observation(type, data, options?)
Define an Observation event — use this when the agent receives external data that isn’t a direct message (price updates, sensor readings, API responses).
The
data parameter is stored verbatim — the SDK does not validate payload fields.context(text, type?)
Define a Context event for claim extraction. Use this for raw text content like conversation messages, documents, or transcripts.
state(variables)
Add environmental state variables to the event context.
goal(text, priority?, progress?)
Attach an active goal. Goals are how Minns Memory Layer groups events into episodes.
causedBy(parentId)
Link the event to a parent event, building a causality chain.
build()
Return the raw Event object without submitting it.
send()
Build and submit the event. Returns the server response.
enqueue()
Build and queue the event for background processing. Returns a local receipt immediately.
Full example
Next steps
Memory & strategies
Query memories and learned strategies via the SDK.
Event types reference
See the full specification for every event type variant.
