Transform a general LLM into a specialized agent
Learn how system prompts shape AI behavior and create specialized agents
A system prompt is a persistent instruction that shapes the AI's behavior for an entire conversation session. Think of it as giving the AI a job description.
The system prompt remains at the top and influences every subsequent interaction
Stays active for the entire conversation session
Shapes every response the AI generates
Define behavior, tone, and output format
These components are building blocks that you can mix and match as needed. Not all components are required for every system prompt. Choose the ones that fit your use case and combine them in any order that makes sense.
"You are a [specific role]..."
Establishes the AI's identity and perspective
"Your goal is to..."
Clarifies what the AI should accomplish
"Always do X, Never do Y..."
Defines how the AI should behave
"Format your response as..."
Specifies the structure of responses
"Do NOT include..."
Sets boundaries and restrictions
An AI agent is more than just a language model. It combines a specialized identity (system prompt), processing power (LLM), and capabilities (tools) to create a complete autonomous system.
Defines who the agent is, what it does, and how it behaves. This is the "personality" and "job description" of your agent.
The processing engine that understands context, generates responses, and makes decisions. This is the "intelligence" that powers the agent.
Extends the agent's capabilities beyond text generation. Tools allow the agent to interact with the external world, access information, and perform actions.
Defines the agent's role, behavior, and constraints
Uses the system prompt to understand and generate appropriate responses
When needed, tools extend capabilities beyond text generation
"You are a [profession] with expertise in [domain]..."
Makes the model adopt that perspective
"Follow these rules: 1. Always... 2. Never..."
Explicit constraints lead to predictable behavior
"Format your response as: JSON, Markdown, etc."
Controls the structure of responses
"You remember: [facts] You know that: [knowledge]"
Primes the model with relevant information
Example: "You are a Python tutor with expertise in async programming..."
Example: "Format your response as JSON with keys: title, summary, tags"
Example: "Rules: 1. Use technical terms, 2. No explanations, 3. Be concise"
System prompts are powerful: They fundamentally change how the model behaves
Detailed is better: More specific instructions = more consistent results
Structure matters: Role + Rules + Format + Constraints
No retraining needed: Same model, different behaviors