AI engineering glossary · Prompt context engineering

What is message roles?

Message roles: The labels attached to each message in a chat-style API call, typically system, user, assistant and tool. The role tells the model who is speaking and how much weight to give the text. Getting the roles right keeps instructions, questions, model replies and tool outputs separate.

Level: beginnerTopic: Prompt context engineering

Message roles: an example

A request holds three messages: {role: system, ...}, {role: user, 'What is my EMI?'} and {role: assistant, 'Please share the loan amount.'}.

Related terms

More Prompt context engineering terms

Where you learn it

Message roles is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.