Documentation
Concepts

Agents

Flapjack agents are AI assistants with system prompts, model selection, temperature, and attached tools. Learn how agents work.

An agent is a configured AI assistant hosted on Flapjack. Each agent has a system prompt that defines its behavior, a model that powers it, and optional tools that extend its capabilities.

Agent Fields

FieldTypeDescription
idstringUnique identifier (UUID)
org_idstringOrganization this agent belongs to
namestringDisplay name
descriptionstring | nullWhat this agent does
stable_preamblestring?System prompt (only from getAgent(), not listAgents())
default_modelstringLLM model ID (e.g., gpt-5.4, claude-sonnet-4-6)
temperaturenumber?Sampling temperature (0–1). Only from getAgent().
created_atstringISO 8601 timestamp
tool_profilesToolProfiles | nullOptional. Named tool subsets for mode-based interactions
default_profilestring | nullOptional. Default tool profile key

TypeScript Type

type Agent = {
  id: string;
  org_id: string;
  name: string;
  description: string | null;
  /** Populated by getAgent() but not by listAgents(). */
  stable_preamble?: string;
  default_model: string;
  /** Populated by getAgent() but not by listAgents(). */
  temperature?: number;
  created_at: string;
  published_chats?: { slug: string; is_active: boolean }[];
  computer?: ComputerConfig | { enabled: false };
  tool_profiles?: ToolProfiles | null;
  default_profile?: string | null;
};

Creating an Agent

Agents are created via the Flapjack dashboard or the API.

Via Dashboard

  1. Go to Agents β†’ Create Agent
  2. Set name, description, and system prompt
  3. Choose a model (default: gpt-5.4)
  4. Optionally attach tools, MCP servers, knowledge, or integrations

Via API

curl -X POST https://api.flapjack.dev/api/agents \
  -H "Authorization: Bearer fj_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support Agent",
    "description": "Answers customer questions",
    "stablePreamble": "You are a helpful support agent. Be concise and accurate.",
    "defaultModel": "gpt-5.4"
  }'
πŸ“‹ Copy as prompt

Create a Flapjack agent via the API called "Support Agent" with a system prompt "You are a helpful support agent. Be concise and accurate." using the gpt-5.4 model.

Via SDK

// Agents are created via dashboard or API, then accessed via SDK
const agents = await client.listAgents();
const agent = await client.getAgent('agent-id');

System Prompt

The stable_preamble field (called stablePreamble in API requests) is the system prompt. It defines the agent's personality, constraints, and behavior. Write it like any LLM system prompt:

You are a technical support agent for Acme Corp.

Rules:
- Be concise and helpful
- Only answer questions about Acme products
- If you don't know, say so
- Never share internal pricing

Supported Models

Model IDVendorBest For
gpt-5.4OpenAIGeneral purpose (default)
gpt-5.4-miniOpenAIFaster, cheaper
gpt-5.4-nanoOpenAIHigh-volume, lowest cost
claude-opus-4-7AnthropicDeep reasoning, 1M context
claude-sonnet-4-6AnthropicNear-Opus quality, 1M context
claude-haiku-4-5AnthropicFastest, lowest cost

Agent Capabilities

Agents can be extended with capabilities configured in the dashboard:

CapabilityDescription
Webhook ToolsCustom API endpoints the agent can call
MCP ServersExternal tool servers via Model Context Protocol
Database IntegrationsDirect Postgres/Supabase queries
Knowledge/RAGDocument upload for retrieval-augmented generation
MemoryPersistent recall and store across conversations
Web ToolsSearch, research, read, and crawl the web
Computer UseExecute code in sandboxed environments

These are configured through the dashboard and automatically available during conversations β€” no SDK-side configuration needed.

Next Steps

Docs last updated May 11, 2026