PROMPT_ENGINEERING
BEST_PRACTICESTechniques to get the most reliable, accurate, and safe outputs from your agents.
ANATOMY_OF_A_GOOD_PROMPT#
A System Prompt isn't just a persona. It's the "Operating System" for your agent. It should define constraints, output formats, and fallback behaviors.
ADVANCED_TECHNIQUES#
CHAIN_OF_THOUGHT_(COT)
Encourage the model to "think" before answering. This significantly improves reasoning on math and logic tasks.
FEW_SHOT_PROMPTING
Give examples of input/output pairs. This is the single most effective way to fix formatting errors.
TOOL_SPECIFIC_INSTRUCTIONS
Give the model specific guidance on when and how to use each tool. Include parameter descriptions and usage examples.
OUTPUT_FORMAT_SPECIFICATION
Define exact output formats, especially for structured data. Use JSON Schema or clear formatting rules.
ERROR_HANDLING_INSTRUCTIONS
Teach the model how to handle errors gracefully and when to ask for clarification.
SAFETY_&_GUARDRAILS_INTEGRATION#
Integrate safety instructions directly into your prompts to work with AKIOS guardrails.
PII_REDACTION_AWARENESS
CONTENT_SAFETY_GUIDELINES
MULTI_STEP_REASONING_PATTERNS#
For complex tasks, break down the reasoning process into clear steps.
RESEARCH_THEN_ANSWER_PATTERN
VERIFICATION_PATTERN
MODEL_SPECIFIC_OPTIMIZATIONS#
GPT_4_/_GPT_4_TURBO
- • Excellent at complex reasoning
- • Handles long contexts well
- • Good at following detailed instructions
- • Use for analytical and creative tasks
CLAUDE_/_CLAUDE_INSTANT
- • Strong at safety and ethics
- • Good at following guardrails
- • Excellent at structured output
- • Use for safe, compliant applications
GEMINI_/_PALM
- • Fast and cost-effective
- • Good at conversational tasks
- • Strong multimodal capabilities
- • Use for simple automation
LOCAL_MODELS_(LLAMA,_MISTRAL)
- • Privacy-focused (no API calls)
- • Customizable and fine-tunable
- • May need more specific prompts
- • Use for offline, secure applications
HANDLING_HALLUCINATIONS#
THE_'I_DON'T_KNOW'_RULE
Add this to your System Prompt to reduce made-up facts: