Skip to main content
OpenFang ships with 30 pre-built agent templates across 4 performance tiers. This guide covers spawning agents from templates, creating custom agent manifests, and understanding the agent architecture.

Quick Start

Spawn any template from the CLI:
Spawn via the REST API:

Agent Template Tiers

Templates are organized into 4 tiers based on task complexity and model capabilities:

Tier 1: Frontier

DeepSeek for deep reasoning: orchestration, architecture, securityModels: deepseek-chatAgents: orchestrator, architect, security-auditor

Tier 2: Smart

Gemini 2.5 Flash for coding, research, analysis, testingModels: gemini-2.5-flashAgents: coder, researcher, data-scientist, test-engineer

Tier 3: Balanced

Groq + Gemini fallback for business and productivityModels: llama-3.3-70b-versatilegemini-2.0-flashAgents: planner, writer, assistant, customer-support

Tier 4: Fast

Groq for lightweight, high-speed tasksModels: llama-3.3-70b-versatile, llama-3.1-8b-instantAgents: ops, translator, tutor, health-tracker

Orchestrator

Tier 1 | deepseek/deepseek-chat | Fallback: groq/llama-3.3-70b-versatile
Meta-agent that decomposes complex tasks, delegates to specialist agents, and synthesizes results.
Capabilities:
  • Analyzes requests and breaks them into subtasks
  • Discovers specialists using agent_list
  • Delegates via agent_send and spawns agents as needed
  • Synthesizes all responses into coherent answers
  • Explains delegation strategy before executing
Tools: agent_send, agent_spawn, agent_list, agent_kill, memory_store, memory_recall, file_read, file_write

Coder

Tier 2 | gemini/gemini-2.5-flash | Fallback: groq/llama-3.3-70b-versatile
Expert software engineer that reads, writes, and analyzes code.
Approach:
  • Reads files first to understand context
  • Makes precise, minimal changes
  • Always writes tests for produced code
  • Supports Rust, Python, JavaScript, and more
Tools: file_read, file_write, file_list, shell_exec Shell access: cargo *, rustc *, git *, npm *, python *

Security Auditor

Tier 1 | deepseek/deepseek-chat | Fallback: groq/llama-3.3-70b-versatile
Security specialist that reviews code for vulnerabilities and performs threat modeling.
Focus areas:
  • OWASP Top 10
  • Input validation and auth flaws
  • Cryptographic misuse
  • Injection attacks (SQL, XSS, command)
  • Secrets management
  • Race conditions and privilege escalation
Report format: Finding → Impact → Evidence → Remediation

Assistant

Tier 3 | groq/llama-3.3-70b-versatile | Fallback: gemini/gemini-2.0-flash
The versatile default agent for everyday tasks, questions, and conversations.
Capabilities:
  • Conversational intelligence and task execution
  • Research and synthesis
  • Writing and communication
  • Problem solving
  • Agent delegation (routes to specialists)
  • Knowledge management

Creating Custom Agents

Agent Manifest Format

Create a custom agent by writing an agent.toml manifest:
agent.toml

Available Tools

1

File Operations

  • file_read - Read file contents
  • file_write - Write/create files
  • file_list - List directory contents
2

System Access

  • shell_exec - Execute shell commands (restricted by whitelist)
3

Memory & Knowledge

  • memory_store - Persist key-value data
  • memory_recall - Retrieve data from memory
4

Network

  • web_fetch - Fetch content from URLs (SSRF-protected)
5

Multi-Agent

  • agent_send - Send a message to another agent
  • agent_list - List all running agents
  • agent_spawn - Spawn a new agent
  • agent_kill - Terminate a running agent

Best Practices

Start Minimal: Grant only the tools and capabilities the agent actually needs. You can always add more later.

System Prompt

The system prompt is the most important part of the template. Be specific about:
  • The agent’s role and methodology
  • Output format expectations
  • What the agent should and should not do
  • Limitations and disclaimers

Temperature Settings

  • 0.2 - Precise/analytical tasks (security audits, debugging)
  • 0.5 - Balanced tasks (general assistant, planning)
  • 0.7+ - Creative tasks (writing, brainstorming)

Shell Security

Never grant shell = ["*"]. Always whitelist specific command patterns.
Good examples:

Token Budgets

Use max_llm_tokens_per_hour to prevent runaway costs:
  • Start with 100,000 for most agents
  • Use 200,000+ for intensive tasks (research, code generation)
  • Use 50,000 for lightweight monitoring agents

Fallback Models

Add fallback models to handle rate limits and availability issues:

Memory for Continuity

Grant memory_store and memory_recall so agents can persist context across sessions:

Managing Agents

Spawning Agents

Sending Messages

OpenAI-Compatible API

Use any agent through the OpenAI-compatible endpoint:

Environment Variables

Set API keys to enable model providers:
At minimum, set GROQ_API_KEY to enable all Tier 3 and Tier 4 agents. Add GEMINI_API_KEY for Tier 2. Add DEEPSEEK_API_KEY for Tier 1 frontier agents.

Next Steps

Workflows

Chain agents together in multi-step pipelines

Skill Development

Extend agent capabilities with custom tools