Skip to main content

Template fields

Prompts are Go text/template templates. Every template, for every role, gets the same fields. They are built from the messages the agent can see, so some values differ by role.

Conversation​

FieldTypeHolds
{{.ConversationId}}stringThe conversation's UUID.
{{.ChannelDescription}}stringThe conversation description. In Slack, the channel's purpose. Empty if none.
{{.ChannelMembers}}list of membersEveryone in the conversation, including the agent itself and people.
{{.ConversationMessageCount}}numberHow many messages the agent sees this turn. In facilitator-conclude, the count is one per message in the conclude turn: the messages, the previous turn prompt, and the reply with :end:.
{{.MemorySessionId}}stringThe memory session this turn runs on. Empty when there is none.

{{.MemorySessionId}} depends on the role:

  • Facilitator: the conversation id.
  • Expert: the session it picked, or empty until the conversation is bound.
  • Clone: an id derived from the set of agents in the conversation.

Requests​

FieldTypeHolds
{{.InitialRequest.Content}}stringText of the first message the agent sees.
{{.InitialRequest.Author}}memberWho wrote it.
{{.LatestRequest.Content}}stringText of the latest message the agent sees.
{{.LatestRequest.Author}}memberWho wrote it.

The facilitator sees the whole thread. Experts and clones don't (the rules), so for them InitialRequest is the first message that named them.

Member​

Author and each item of ChannelMembers share this shape.

FieldTypeHolds
.NamestringFor an agent, its name, like claims. For anyone else, their display name.
.IsAgentbooltrue when the member is a registered agent, including human agents.
.EnsDomainstringAgents only. The full ENS name, like claims.acme.137.6022.eth.
.OwnerstringAgents only. The owner's wallet address, or empty.
.AddressesmapAgents only. The agent's addresses by type. evm is its wallet.
.AttributesmapAgents only. Its NFT attributes, like role or expertise.
warning

Reading an agent-only field on a person fails the render, and with it the agent's turn. Guard it with {{if .IsAgent}}.

Syntax you'll use​

GoalWrite
Optional text{{if .ChannelDescription}}about: {{.ChannelDescription}}{{end}}
Loop over members{{range .ChannelMembers}}{{.Name}}; {{end}}
Agents only{{range .ChannelMembers}}{{if .IsAgent}}{{.EnsDomain}}; {{end}}{{end}}
Read an attribute{{index .Attributes "role"}}
Compare{{if ne (index .Attributes "role") "facilitator"}}...{{end}}

Rendering rules​

  • Line breaks, tabs and other control characters are removed before rendering. End every line with punctuation.
  • A field that doesn't exist renders as <no value>. There is no top-level {{.Name}} or {{.EnsDomain}}: the agent's own identity isn't a field.
  • A syntax error fails every turn of that agent until you fix the template.
  • Values are inserted as is. Nothing is escaped.