liveBook · Manning

Xml-style tag

As explained in AI Agents and Applications

XML-style prompt tags are markup-like delimiters that organize prompt content into named sections.

XML-style tags are markup-like delimiters that divide a prompt into named sections. They make roles, context, instructions, inputs, tone, and output requirements easier to distinguish, providing a more reliable structure for prompt construction. section 2.6

Structured keynote prompt

<Persona>\nYou’re an experienced Large Language Model developer.\n</Persona>\n\n<Context>\nYou’ve been invited to give a keynote speech.\n</Context>\n\n<Instruction>\nWrite the punch lines.\n</Instruction>\n\n<Input>\nInclude the supplied facts.\n</Input>\n\n<Tone>\nUse a witty but entertaining tone.\n</Tone>\n\n<OutputFormat>\nPresent two paragraphs of five lines each.\n</OutputFormat> section 2.6

Use tags flexibly when structuring prompts:

  • Name sections such as <persona>, <context>, <instruction>, <input>, and <examples> when explicit organization helps. section 2.6 section 2.7
  • Do not assume every section requires a label; context and tone can remain unnamed when the model can infer their purpose. section 2.6
  • Combine tags with prompt templates when static structure must be separated from runtime content. section 2.7

How AI Agents and Applications covers it

How deep it goes
Explains the delimiter pattern, demonstrates a complete prompt, and advises selective labeling and experimentation.
Examples
Uses a tagged keynote prompt containing persona, context, instruction, input, tone, and output-format sections.
What it assumes
Assumes only familiarity with prompts and introduces section labeling through a concrete example.
What you can do after
Apply it via prompt construction to organize instructions and content into explicit, testable sections.
How it connects
Connects XML-style tags with prompt templates, dynamic content, few-shot prompting, and chat message roles.

Related concepts

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