Give it a personality.One line of text.

It has no character yet.

The agent you have: it answers, but it has no character.

Two quick questions from last time. Guessing first helps it stick, even when it feels harder.

Take the agent.py you ended lesson 1 with and run it. It talks to the head, the trained model you downloaded in lesson 1, qwen3:8b. Ask it something.

python agent.py

Tape a label to the jar.

New: one line of text that says who the head is.

The head from lesson 1, no note yet. Drag it.

Send it in the messages.

New: the system message goes in the messages list, first.

Lesson 1 sent a list with one message in it, from the user. Put the system message first. Change the "messages" line inside the loop. Below is your whole file. New lines are highlighted.

the messages list "role": "system" "content": SYSTEM 1 "role": "user" "content": prompt 2 the head reads top to bottom, every time

Meet the attendant.

New: the same head and the same question, now with the label.

Run python agent.py and ask the same question as before. The attendant is not a new person: it is the head, playing the character from your label.

Write your own.

New: you pick the character.

The label is only text. We start you on the poet. Pick any character and watch the label change. Then the head answers Why is the sky blue? as that character.

The label on the jar.

The line for agent.py:

# pick a character, or write one below

The head says:


        
        
      

What this box does: the SYSTEM line above changes to your words. This page only replays answers we recorded, so to hear your character, paste that line into your agent.py and run it. The head lives on your PC.

What a label can’t do.

New: a system prompt is a request, not a lock.

That's lesson 2.

One line of text now decides who the head is. Your code sends it first, every time, and the head answers in character.

You also saw its limit: it forgot Ana’s name between two messages. Fixing that is lesson 3.

System prompt
Standing orders sent before anything the user says.
Role
The tag on each message in the list: "system" for your orders, "user" for the person typing.