Tool Calling

Workers do not parse free-text AI responses. Instead, Delibera uses OpenAI-compatible tool calling to force the model into a structured output format via the dao_vote function.

The dao_vote Tool

The tool is defined in every chat completion request:

json
{
  "type": "function",
  "function": {
    "name": "dao_vote",
    "description": "Vote on a DAO proposal with reasoning",
    "parameters": {
      "type": "object",
      "properties": {
        "vote": {
          "type": "string",
          "enum": ["Approved", "Rejected"]
        },
        "reasoning": {
          "type": "string",
          "description": "Explanation for the voting decision based on the manifesto"
        }
      },
      "required": ["vote", "reasoning"]
    }
  }
}

The request includes tool_choice: { type: "function", function: { name: "dao_vote" } } to force the model to call this specific tool rather than responding with free text.

Parameters

| Parameter | Type | Constraints | Description | |---|---|---|---| | vote | string | "Approved" or "Rejected" | The worker's vote on the proposal | | reasoning | string | Max 10,000 characters | Free-text explanation of the decision |

The worker validates both fields after parsing:

  • If vote is not exactly "Approved" or "Rejected", the vote is rejected.
  • If reasoning exceeds 10,000 characters, the vote is rejected.

System Prompt

The system prompt establishes the agent's role and constraints:

text
You are a Decentralized Autonomous Organization (DAO) agent with a
persistent identity. You have your own values, accumulated knowledge,
and decision history that shape your reasoning.

Each prompt will contain your agent identity (values, guidelines,
voting weights, past decisions), the DAO manifesto, and a proposal
to vote on.

Vote on the proposal based on BOTH the DAO manifesto AND your
personal agent identity. Your accumulated knowledge and past
decisions should inform your reasoning.

The user message is assembled from three sections:

text
{agent identity context}       <-- persistent memory from Ensue

=== DAO MANIFESTO ===
{manifesto from contract}

=== PROPOSAL ===
{proposal text}
[Info]

The agent identity context is optional. On a fresh worker with no history, only the manifesto and proposal are sent. As the worker accumulates decisions, its context grows richer.

Reasoning Privacy

The reasoning field returned by the model is never published on-chain. It is:

  1. Written to Ensue at coordination/tasks/{workerDID}/result (AES-256-GCM encrypted -- only the owning worker can decrypt).
  2. Read by the coordinator solely to extract the vote value for the aggregate tally.
  3. Stored in the worker's persistent memory to inform future deliberations.

The coordinator sees the vote (Approved/Rejected) but the reasoning text stays private to the worker. See Vote Privacy for the full privacy model.