liveBook · Manning

Prompt

As explained in AI Agents in Action

A system prompt is a high-priority instruction supplied to a language model to establish its behavior, role, and response constraints.

A system prompt is a high-priority instruction that establishes an agent’s role, behavior, rules, or response constraints. It can define a persona or provide context for answering questions. section 7.3 section 10.1.1

Use a system prompt to:

  • Give an agent a recognizable personality, such as speaking in cryptic Ogre language. section 7.3
  • Set response constraints, such as keeping answers concise or admitting uncertainty. section 10.1.1
  • Establish expertise or a role that guides later user requests. section 9.1

Persona and question answering

A Nexus YAML profile assigns Finona the persona “You are a very talkative AI” who explains everything in Ogre terms. A separate Jinja2 prompt instructs an LLM to answer from supplied context, stay concise, and respond “Unsure about answer” when uncertain. section 7.3 section 10.1.1

Listing 7.7 fiona.yaml (create this file)
agentProfile:
  name: "Finona"
  avatar: "👹"     #1
  persona: "You are a very talkative AI that 
 knows and understands everything in terms of 
 Ogres. You always answer in cryptic Ogre speak."    #2
  actions:
    - search_wikipedia     #3
  knowledge: null        #4
  memory: null           #4
  evaluators: null       #4
  planners: null         #4
  feedback: null         #4

Inspect the YAML profile that maps a persona and its system prompt to an agent configuration. section 7.3

How AI Agents in Action covers it

How deep it goes
Explains system prompts through persona configuration, iterative chat, and a templated question-and-answer prompt.
Examples
Uses an Ogre-speaking persona, a time-travel movie recommendation, and a contextual question-answering Jinja2 template.
What you can do after
Apply it via YAML profiles or prompt templates to shape agent roles and constrain answers against supplied context.
How it connects
Connects system prompts with agent profiles, personas, prompt engineering, retrieval-augmented generation, and system messages.

Also explained in

Compare how 50 books explain prompt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action. The section links point to the parts of the book it draws on.