Skip to main content

Documentation Index

Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

The system prompt guides the model’s behavior throughout its interactions with users. Operating behind the scenes, it shapes how the model interprets and responds to queries, influencing its tone, actions, and output. A well-crafted system prompt can significantly enhance the model’s capabilities, while poorly designed prompts can lead to misunderstandings, unhelpful responses, and frustrated users.

System prompts vs. user prompts

System prompts and user prompts serve different purposes in shaping model behavior. System prompts establish persistent instructions that guide the model across all interactions—defining its role, tone, and boundaries. User prompts are individual queries or tasks submitted during a conversation. Use system prompts to set foundational behavior that should remain consistent. Use user prompts for specific, one-time requests. When both are well-crafted, they work together to produce accurate, relevant responses.

The CARE framework

When crafting a system prompt, use the CARE framework to ensure you’ve covered the essential components: Not every prompt requires all four components, but reviewing each helps identify gaps that could lead to unclear or unhelpful responses.

System prompt best practices

An effective system prompt shapes how the model interacts with users, ensuring that responses are consistent and aligned with the intended behavior. By carefully crafting the prompt, you can guide the model to provide accurate, relevant answers and handle complex scenarios. A well-designed prompt prevents confusion, keeps interactions on track, and allows the model to function optimally, even in ambiguous situations.

Iterative refinement

Effective system prompts rarely emerge fully formed. Start with a basic prompt that covers your core requirements, then test it against realistic scenarios. Refine based on the results. When your prompt produces unexpected results, use the following guidance to identify and address the problem: Small, targeted adjustments typically yield better results than rewriting prompts from scratch.

Prompt documentation template

As you develop effective system prompts, consider documenting them for reuse and sharing. A consistent format makes prompts easier to maintain and adapt.
PROMPT NAME: [Descriptive name for the prompt]
PURPOSE: [Scenario or use case this prompt addresses]
PROMPT TEXT:
[The full system prompt]

NOTES:
- [Tips for best results]
- [Known limitations or edge cases]

LAST UPDATED: [Date]

Example system prompt

Here is a system prompt that incorporates the practices outlined above:
You are a coding assistant that helps users write, debug, and optimize Python code.

**Role:** Provide clear, step-by-step explanations and working code examples. Follow Python best practices and prioritize efficient solutions.

**Tone:** Professional and supportive. Avoid jargon unless necessary, and define technical terms when you use them.

**Format:** Structure responses as follows when troubleshooting errors:
- **Issue:** [What went wrong]
- **Explanation:** [Why it happened]
- **Solution:** [How to fix it, with code if applicable]

**Boundaries:** Do not provide or reference sensitive information such as API keys, passwords, or user data. Do not offer advice outside Python development.

**Ambiguity:** If the user's input is unclear, ask one or two clarifying questions before proceeding.