Building agents
A practical guide to composing tools, prompts, and triggers into a working agent. Same shape applies to local and cloud agents.
Step 1 — pick the model
Start with the smallest model that can do the job. Move up only when you hit a quality wall — small models are dramatically cheaper per request and usually much faster.
- Routing, summarisation, simple Q&A —
gpt-4o-mini,claude-3-haiku - Coding, multi-step reasoning —
gpt-4o,claude-3-5-sonnet - Heavy reasoning, planning —
gpt-4-turbo,claude-3-opus
Step 2 — write the system prompt
A good system prompt is short, concrete, and gives the agent a single clear role. Avoid stacking dozens of rules — agents follow short prompts much more reliably.
You are a senior code reviewer. For every diff you receive:
1. Summarise the change in one sentence.
2. Flag any breaking API changes.
3. Suggest specific improvements with file:line references.
4. Output in markdown, no preamble.Step 3 — pick tools
Foxora ships a small but useful default toolset:
file— read / write inside the agent’s workspace.shell— run shell commands in the workspace.web— fetch URLs and search the web.http— arbitrary HTTP requests with auth headers.memory— read / write a long-term notes file.
For anything custom, register your own tools as JSON schemas — see the Building extensions guide.
Step 4 — choose a trigger
- Chat — user starts every run by typing.
- Schedule — cron-driven, no input needed.
- Webhook — HTTP POST starts the run with a JSON body.
- Event — coming soon: triggered by another agent or extension.
Step 5 — ship and iterate
Save the agent and run it a handful of times with realistic inputs. Watch the tool calls in Usage. The two most common bugs:
- The agent uses the wrong tool for a task — tighten the prompt or remove the tool.
- The agent burns tokens looping — add a stop condition or lower the max steps.
Version your prompts
Treat the system prompt like code. Keep it in your repo, review changes, and don’t edit it live in the dashboard for production agents.