Quickstart

Ship a Fuze Agent in five minutes. Sensible defaults, full compliance evidence, no ceremony.

Ship a working agent in five minutes. The defaults are safe, every model call, tool execution, and policy decision still goes through the hash-chained evidence pipeline. Swap in production policies and retention when you're ready; the API doesn't change.

1. Install

bash
npm install @fuze-ai/agent @fuze-ai/agent-providers zod

2. Get a Mistral key

Sign in at console.mistral.ai, create an API key, and put it in MISTRAL_API_KEY. The free tier is enough to follow this page.

3. Write the agent

Save as agent.ts:

ts
import { z } from 'zod'
import { quickAgent, quickTool } from '@fuze-ai/agent/quickstart'
import { mistralModel } from '@fuze-ai/agent-providers'

const wordCount = quickTool({
  name: 'word_count',
  description: 'count words in a string',
  input: z.object({ text: z.string() }),
  output: z.object({ count: z.number() }),
  run: ({ text }) => ({ count: text.trim().split(/\s+/).filter(Boolean).length }),
})

const agent = quickAgent({
  model: mistralModel({ apiKey: process.env.MISTRAL_API_KEY ?? '' }),
  tools: [wordCount],
})

const result = await agent.run('How many words are in "the quick brown fox"?')
console.log(result.status, result.output)
console.log('evidence spans:', agent.records().length)

4. Run it

bash
MISTRAL_API_KEY=sk-... node --experimental-strip-types agent.ts

You should see the run status, the structured output, and the number of evidence spans recorded.

5. What just happened

  • Hash-chained evidence: each model call, tool execution, and policy decision was recorded as a span. agent.records() returns the full chain, every record's prevHash matches the previous record's hash.
  • Policy gate ran: the default quickstart configuration uses an allow-all StaticPolicyEngine. You'll see a one-time warning on stderr reminding you to define a real policy before production.
  • Same evidence shape as production: the only difference between quickstart and a hand-wired agent is who picks the defaults. Tools are classified public, retention is the short fuze.quickstart.v1 policy, lawful basis is consent. Switch any of these by dropping back to defineAgent / defineTool.

Next steps