AgentX docs

Prompts

Every turn, an agent runs on a system prompt — the instructions that define who it is and how it behaves. AgentX composes that prompt fresh each turn from a few durable layers, so you can shape an agent’s voice and rules without touching code, and change them without breaking anything downstream.

How a prompt is composed

The final system prompt is assembled, in order, from:

  1. The global prompt — your core persona and house rules, applied to every agent and conversation.
  2. The auto-generated tools prompt — a description of the connected tools, built for you whenever MCP servers are attached.
  3. The agent profile’s sections — the selected profile’s enabled sections, in their configured order.
  4. Injected context — recalled memory and any request-specific overrides.

A request can also carry a full system override that replaces the whole composed prompt for that one turn. See the composition flow on the System Design page.

The global prompt

The global prompt is the one voice that persists across every profile switch — the core persona and the rules you always want honored. It carries no agent name of its own; each agent’s name is injected from its profile, so a single global prompt serves every agent. Edit it in the Prompt Library.

Profile sections

Where the global prompt is universal, profile sections tailor an individual agent. A profile is an ordered stack of typed, individually toggleable sections — switch one off to drop it, reorder them to shift emphasis:

TypePurpose
personaIdentity and personality
taskTask-specific instructions
formatOutput-format requirements
constraintsBehavioral rules and guardrails
examplesFew-shot examples
contextBackground information
customAnything else

Because sections are durable and layered, you can keep a set of reusable building blocks and compose different agents from them. The Prompt Library is where you build and preview all of it — and Enhance prompt (in the Relay) can draft or sharpen a section for you.

Under the hood

The PromptManager seeds sensible defaults, loads your customizations from data/system_prompts.yaml, and saves changes back as you edit — the whole layered stack is durable. The tools prompt is regenerated from the live tool list each turn. The programmatic surface — profiles, sections, the global prompt, and a compose-preview — is in the API Reference.