From the course: Creating Agents with Python and the AI Toolkit for Visual Studio Code

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Writing effective system prompts

Writing effective system prompts

When building an agent, one of the most important elements you'll work with is the system prompt. The system prompt is the instruction that defines the agent's personality, tone, and overall behavior. Think of it like setting the rules of engagement. The agent will follow this guidance every time it responds. A good system prompt is clear, purposeful, and specific. If it's too vague, your agent may behave inconsistently. And if it's too restrictive, you may limit its usefulness. Let's break down a few best practices. Define the role. State who the agent is supposed to be. For example, you are a sales insight assistant that helps sales representatives summarize opportunities, identify next steps, and track performance. This gives the model a context to operate from. Set the style and tone. Decide how responses should sound. Should the agent be professional, casual, concise, or detailed? This helps maintain consistency across interactions. Clarify boundaries. If there are things the…

Contents