Let it search,
give it know-how

Youth AI Lab · Workshop 3 of 6
Build your own chatbot

❓ The question of the series

A chatbot only answers from what it reads before it answers. Every workshop of the series is one answer to the same question.

What enters the model's context, when, and who decides?
📥
What?
rules, documents, search results, live data
⏱️
When?
always, at startup, or for each question
🧑‍⚖️
Who decides?
you, a search engine, or the model itself

🧭 Today: what if the model searched by itself?

🎭
1. Instructions
📚
2. Knowledge, RAG
🔎
3. Search, skills
today
📡
4. Tools
🗺️
5. Wiki
🧪
6. Fine-tuning
Mode B: nobody picks, everything enters.
RAG: a search engine picks, before the model.
Mode C: the model picks, step by step, and you see each step.

🗓️ The plan: 2 hours

👋 Welcome
20 min
🔎 Search
20 min
📥 Let a document in
35 min
🗂️ Your skill
30 min
🏁 Closing
10 min
📄 Follow on your screen: the README.md of your Codespace, or the one-page sheet.

💻 Your workspace: one Codespace per pair

A Codespace is VS Code in your browser: nothing to install. Everything you need is already inside.

⏱️ Before you open it, once per GitHub account: github.com/settings/codespaces → Default idle timeout → 120 → Save. It only applies to the Codespaces you create after.

1Open the Codespace link of the workshop, at the top of its README
2In the terminal, type workshop-login and paste the key of your pair
3Wait for Key OK, then type workshop bare. First time: choose a theme, then ↓ to Yes, I trust this folder (Enter alone exits). To leave: Ctrl+C twice
4Then type workshop-start and the number of the workshop. With a save from last time, add --from my-work.zip
⚠️ The key is not shown while you paste it: that is normal. If the Codespace stops after a long pause, reopen it: nothing is lost.

💻 No Codespace? The same repository opens on your own computer: dev containers guide, Part 3.

🐳 Bring your work, start Open WebUI

1Drag my-work.zip (the newest) into the file list, then workshop-start 3 --from my-work.zip. Check the saved on date.
2Second terminal: openwebui start. Do not wait: you need it at the closing.
3Have the address of the page of your question 12 ready: it enters your chatbot today.
🚫 Never make port 3000 public. This Open WebUI has no accounts: anyone with the link could use your key.

🌡️ The gauge: how full is the context?

The context is everything the model reads before it answers. Its maximum size is the context window. A line above the input box shows how full it is.

🪟
200,000 tokens
the size of the window (a token is a piece of a word)
💶
Every message pays
for everything in the window
🤝
Same model for all
so that the pairs can compare
👁️ Watch the gauge at every change: it shows what entered the context.

📏 How to score an answer

Each answer gets 0, 1 or 2. The score rewards honesty as much as knowledge.

2
Right, and it says where it comes from. Or "I don't know" when nobody knows.
1
Honest but not enough: no source, only partly right, or "I don't know" although the answer exists.
0
Wrong or invented.
💡 An invented answer is worse than "I don't know".

🔎 Let it search

Who picks, and how can you check?

20 min · mode C

🔎 The model searches like a person

📂
List
ls a folder
🔍
Search
grep a word
📖
Read
a summary, then a full document
Nothing is loaded in advance. When a search finds nothing, or nothing that answers, the model sees it: the failure is visible.

🎬 Your turn: questions 3 and 7

1workshop C, then question 3 (Bouches-du-Rhône): its answer is only in a full order.
2Press Ctrl+O to unfold the steps (again to come back): which files did it open? Open the file it read in corpus/text/, Ctrl+F: does it say the same?
3Look at the gauge, then question 7. Which documents does it find? What does it say?
📏 Measured (2026-10-30): question 3 at about 23,000 tokens; mode B: about 100,000, the whole kit, whatever the question.

📥 Let a document in, and vouch for it

The model proposes, a person decides

35 min · corpus-add · summarize · validate-summary

📥 Four steps of curation

1. Add
corpus-add
the original, unchanged
2. Draft
summarize
summary + table
3. Check
you, every row, against the original
4. Sign
validate-summary
your name
First the document of Benevento (question 11, number 80), then the page of your question 12 (number 81).

📚 Checked documents for the Knowledge box: Open WebUI guide, Step 1 · OpenCode guide, Part 4

🎬 Your turn: add, draft, check, sign

1The corpus-add line of inbox/README.md, then corpus-add "<your page>" --name <short-name>.
2Open corpus/text/81-…md: is your fact in it?
3workshop C: summarize corpus/81-…. Look for Skill(summarize). Accept with 1. Yes.
4Check every row of summaries/checks/81-….md with Ctrl+F.
5Validate summary 81. I checked every row. My name is <name>.
⚠️ Never choose an option that stops asking: you would no longer see what it writes.

🖊️ A person signs, not the model

status: draft

no person has checked it yet
verified: … human:maria-rossi
status: stable

a person checked every row
❓ Why is it a person's name, and not the model's, in the verified line?

🗂️ Write your own skill

An activity sheet for the chatbot

30 min · .claude/skills/

🗂️ System prompt or skill?

System prompt (AGENTS.md) Skill (SKILL.md)
When it is read always, with every message only when a request needs it
What it says who the chatbot is, the rules for every answer how to do one task, step by step
Who decides you: it is always there the model, from the description
Cost in the context the whole text, every time a few lines, until it is used
💡 The description is the trigger.

📚 Skills in a chatbot of your own: your chatbot in Open WebUI (end of this workshop) · with a group, by chatbot-export then openwebui import: Open WebUI guide, Part 6, Step 2 · another way: OpenCode guide, Part 5 - Skills

🎬 Your turn: a skill that triggers

1Read .claude/skills/summarize/SKILL.md: name, description, steps, rules.
2Add this to the summaries: … → Skill(source-note) asks for the source. A rumour? It names the summary it contradicts, and asks you.
3Create .claude/skills/<name>/SKILL.md: rumour-check, quiz-maker, explain-for-kids…
4Leave and start workshop C again.
5A request that should trigger it: Skill(<name>) (for rumour-check, then a search: open the document it cites). And Hello, who are you?, which should not.
🔁 Change the description until it triggers when it should, and only then.

🏁 Closing: column C, your chatbot, your save

1Leave the conversation (Ctrl+C twice), predict, then replay C and score C 3 8 11 12. Compare the rows with columns B and RAG.
2Second terminal: openwebui chatbot --name "<your chatbot>", then your question 12. Your skill comes along, but its whole text goes with every message: there, the description triggers nothing.
3workshop-save → Download... my-work.zip: your documents, your summary, your skill.
📝 Exit card, alone: (1) In mode C, who decides what the model reads, and how can you check it? (2) Why a person's name in the verified line? (3) When does the model open a skill?

📏 Scores: 2 right and sourced · 1 honest but not enough · 0 wrong or invented. Only some questions are scored today: read the rows, not the Total. Saved twice? Bring the newest, maybe my-work (1).zip, and the address of the fire danger page of your territory for workshop 4.

🆘 If you are stuck

Every command explains itself. From workshop 3, a few slash commands inside the chatbot show what it is using.

❔
In the terminal
workshop help
replay --help
score --help
🔍
In the chatbot
/context what fills the window
/status the key in use
/mcp the tools (from workshop 4)
Workshops 1 and 2: they answer "Unknown command". Watch the gauge above the input box.
🙋
Something breaks?
Ask the facilitator. Your files stay in the Codespace.
💡 To leave a conversation: Ctrl+C twice. In an open .md file, to read it as a page: Ctrl+Shift+V (Cmd+Shift+V on a Mac). In the terminal, copy / paste: Ctrl+Shift+C / Ctrl+Shift+V (Cmd+C / Cmd+V on a Mac). To change mode: workshop <mode>.

🗣️ Say (EN) - Welcome to the third workshop. Today the model searches by itself, and you let a document of your territory into its knowledge. - Then you write a skill: a procedure the model follows when a request needs it. - Please open the Codespace of this workshop, and bring my-work.zip and the address of the page of your question 12.

Fiche animateur : facilitator/workshops/3-facilitator.md. Demander l'adresse de la page de la Q12 à chaque binôme quelques jours avant.

🗣️ Say (EN) - A chatbot only answers from what it reads before it answers. - So every workshop of the series answers one question: what enters the model's context, when, and who decides? - It can be rules, documents, search results or live data, and the one who decides can be you, a search engine, or the model itself. - We come back to this question in each part of each workshop.

La question qui organise toute la série. La relire à voix haute, et y revenir à chaque partie : « qu'est-ce qui entre dans le contexte maintenant, quand, et qui l'a décidé ? ». Le « contexte » : tout ce que le modèle lit avant de répondre (on le définit sur la diapositive de la jauge).

🗣️ Say (EN) - In workshop 2, mode B read everything and a RAG picked pieces for the model. - Today, in mode C, the model itself decides what to open, one step after another, and you can read every step.

Rappel : la question qui organise toute la série ; aujourd'hui, c'est le modèle qui décide.

🗣️ Say (EN) - Two hours: welcome, the model searching, letting a document in, writing a skill, and a closing.

20 + 20 + 35 + 30 + 10 = 115 min, plus 5 min de marge. La partie 3 est la plus variable.

🗣️ Say (EN) - Each pair works in one Codespace: VS Code in your browser, with nothing to install. - Before you open it, the first time on your GitHub account: go to github.com/settings/codespaces, set Default idle timeout to 120, and Save. It only applies to the Codespaces you create after, so do it first. - Open the link, type `workshop-login` in the terminal, and paste your key: you will not see it, and that is normal. - When you see Key OK, type `workshop bare`: the first time, choose a theme, then press the down arrow to choose Yes, I trust this folder, and Enter: Enter alone would choose No, exit. To leave, press Ctrl+C twice. - Then type `workshop-start` with the number of today's workshop. If you saved your work last time, add `--from my-work.zip`: it brings your work back first. It opens the page of the day. - If the Codespace stops after a long pause, just reopen it: nothing is lost. - No Codespace, because the network blocks it or the quota is used up? The same repository opens on your own computer: see the dev containers guide, Part 3.

Un dépôt par atelier : https://codespaces.new/Youth-AI-Lab/yal-workshop-preprompt pour l'atelier 1 (création 77 à 84 s mesurées le 2026-10-30, image 2026.10.31, dépôt de l'atelier 1). Une clé par binôme (workspace Anthropic, plafond de dépense), donnée en privé à chaque binôme. Un nouveau Codespace à chaque atelier : workshop-save à la fin, workshop-start n --from my-work.zip au début du suivant. Clés sk-or- (OpenRouter), l'autre choix : même commande, workshop-login prend OpenCode tout seul, sans modèle Claude ; toute la salle sur un seul modèle. Claude Code les refuse. Messages : « Key OK (Claude Code, Anthropic, model claude-sonnet-5-5). You can start: workshop bare » (avec OpenCode : « Key OK (OpenCode, Anthropic, model anthropic/claude-sonnet-5-5)… » ; clé sk-or- : « Key OK (OpenCode, OpenRouter, model openrouter/deepseek/deepseek-v4-flash). You can start: workshop bare »). HTTP 401/403 : clé refusée. HTTP 400 : presque toujours une clé créée sans workspace (SETUP.md). Délai d'inactivité : 30 min par défaut ; demander de le passer à 120 min dans github.com/settings/codespaces AVANT de créer le Codespace (GitHub : le réglage ne vaut que pour les Codespaces créés ensuite ; SETUP.md, étape 1).

🗣️ Say (EN) - Bring back your work with workshop-start 3 and --from. If you downloaded it more than once, the newest may be called my-work (1).zip: drag that one and type its exact name between quotes. Check that the saved on date is the end of workshop 2. - The first time you type workshop C, Claude Code asks to trust the folder: press the down arrow to Yes, I trust this folder, then Enter. - Then start Open WebUI in the second terminal: you will use it at the closing. - And keep the address of the page of your question 12 at hand.

workshop-start 3 ne démarre pas Open WebUI (seul l'atelier 2 le fait) : le lancer à la main pendant l'accueil.

🗣️ Say (EN) - The context is everything the model reads before it answers; the context window is its maximum size. - The window holds 200,000 tokens, and a token is a piece of a word. - Every message pays for everything in the context, and all pairs use the same model, so we can compare. - Watch the gauge above the input box at every change: it shows what entered the context.

Jauge : mod Claude Code token-weather. Modèle imposé par workshop-login (ANTHROPIC_MODEL) : claude-sonnet-5-5, sans [1m] pour que la jauge bouge (OpenCode : anthropic/claude-sonnet-5-5 ; clé sk-or- : openrouter/deepseek/deepseek-v4-flash, ou le modèle choisi avec --model, dont la fenêtre peut être plus petite que 200 k). Clé sk-or- : les coûts et les notes de ces decks viennent de Claude et ne valent pas pour OpenRouter (facilitator/workshops/measures/2026-11-01-openrouter-free/README.md). Jauge en interactif, 2026-10-30 (vrai Codespace, image 2026.10.34) : bare 1,6 k après la Q1 et 1,7 k pour « Hello », A avec Feurisson 2,6 k. B : 100,7 k à la répétition du 2026-10-21 (image plus ancienne). Elle reste à 0 avant le premier message (`0 / 200k`). Ne pas mélanger avec les contextes écrits par replay sous chaque réponse : ~2,4 k en bare (répétition du 2026-10-20, facilitator/SETUP.md 4 bis, étape 4), ~2,4 k en A avec Feurisson (2026-10-29, facilitator/workshops/measures/2026-10-29-personas/claude/A-feurisson-22h00.md).

🗣️ Say (EN) - Each answer gets 0, 1 or 2 points, and you write them in `scores.md`. - 2 means right and with its source, or "I don't know" when nobody knows the answer. - 1 means honest but not enough, and 0 means wrong or invented. - Remember: an invented answer is worse than "I don't know".

Barème dans test-questions.md ; notes dans scores.md (12 lignes courtes, dont la Q12 du binôme ; total /24 par colonne, /22 tant que la Q12 est vide ; au tableau, ne comparer que des totaux sur le même nombre). Questions 7 et 9 (inconnue, hors sujet) : la bonne réponse est de le dire.

Partie 2 (20 min) : Q3 et Q7 ; faire appuyer sur Ctrl+O pour déplier les étapes (Ctrl+O encore pour revenir ; mesuré sur Claude Code 2.1.303). Le clic sur la ligne grise n'a pas été vérifié.

🗣️ Say (EN) - In mode C, the model knows where the knowledge is: two folders, each with an index. It lists, searches a word, and reads, like you would. - Reading and searching need no permission. Writing a file does. - And when a search finds nothing, or nothing that answers, the model sees it: it can say I don't know.

Outils en mode C (Claude Code) : Read, Bash, Edit, Write, Skill ; ls, grep, cat, head, wc, find sans demande. OpenCode : read, grep, glob ; chaque commande shell et chaque écriture demandent l'accord.

🗣️ Say (EN) - Ask question 3, then press Ctrl+O: the grey line above the answer opens into every step. Ctrl+O again to come back. - A file the model opened is not a fact it read well: open that file in corpus/text, press Ctrl+F, and check the levels and the hours yourself. - Compare the gauge with mode B. Then ask question 7, and watch what the search finds.

Mesuré le 2026-10-30 (vrai Codespace, image 2026.10.33) : Q3 complète, grep puis summaries/40 et corpus/text/43, aucune permission demandée, ~23 k, 0,07 $ ; Q7 « I don't know », ~10 k, 0,02 $. Ne jamais projeter la réponse attendue de Q3.

Partie 3 (35 min). Montrer summarize une fois au grand écran avec Bénévent.

🗣️ Say (EN) - Curation has four steps. You add the document; the model writes a draft summary and a verification table; you check every row; and you sign it with your name. - Add Benevento first: one command. Then the page of your question 12: that is the one you curate.

Ordre voulu : corpus-add donne le premier numéro libre ; inbox/README.md annonce 80 pour Bénévent. Une page refusée ou vide : le binôme cure Bénévent (repli).

🗣️ Say (EN) - Add the two documents, then open the readable copy of your page: some pages load their content with a script, and the copy is almost empty. - Ask summarize, accept each file with 1. Yes, check every row against the original, and sign.

Mesuré sans clé (2026-10-30) : corpus-add de quatre pages officielles en ≤ 1 s ; carte de la préfecture 17 : 318 jetons (niveau chargé par un script). Refus : PDF scanné (code 3), HTTP 403 Légifrance et regione.campania.it (code 2). 2026-10-30 : summarize de Bénévent 39 s, 0,12 $, 14 phrases, la ligne 9 de la table signale « count to be checked ». validate-summary : « it is correct » refusé tant que les cases sont vides ; « Validate summary 80. I checked every row. My name is … » validé.

🗣️ Say (EN) - A summary starts as a draft. Only when a person has checked every row does validate-summary add their name, and set it stable. - Why a person and not the model? If a young person reads a wrong date in the chatbot, who is responsible?

validate-summary refuse un « it's fine » général : chaque ligne doit être cochée ou corrigée. C'est voulu.

Partie 4 (30 min). D'abord source-note (5 min) : un fait du territoire, puis la rumeur sur le débroussaillement, que la skill doit refuser d'écrire seule en citant le résumé 22 (non essayé avec un vrai modèle). Puis la skill du binôme, rumour-check s'il n'a pas d'idée.

🗣️ Say (EN) - A skill is a text file in plain English, in its own folder in .claude/skills. - At the start of a conversation, the model sees only the name and the description of each skill. When your request matches, it opens it and follows the steps.

Le même mécanisme existe dans OpenCode (guide OpenCode, partie 5).

🗣️ Say (EN) - Read a real skill first, then use source-note: it asks for a source, and it does not write a rumour that contradicts a summary without asking you. Then write yours, with a name, a description, the steps and what the model must never do. - Leave and start workshop C again, so that the model sees your new skill for sure. Test one request that should use it, and one that should not. - After each change of the description: save, leave, start again, test again. Then leave: the closing starts in the terminal. - Search and skill work together: the search finds the facts and shows where they are, the skill says what to do with them the same way every time, and you decide from the sources.

Mesuré : rumour-check valide, vue au démarrage suivant de workshop C, avec les deux moteurs (2026-10-30, sans clé). En conversation avec l'image 2026.10.33 : 0 déclenchement sur 2 ; avec disableBundledSkills : 2 sur 2. Décision de Sébastien (2026-10-30) : skills fournies coupées à partir de l'image 2026.10.34 ; atelier 3 seulement avec cette image. Sur 2026.10.34 (vrai Codespace, 2026-10-30) : débroussaillement 2 sur 2 (« FALSE … a legal obligation, not just advice »), barbecue 2 sur 2, « Hello » sans skill, ~11–12 k de contexte, ~0,03 $ l'essai (estimé) ; vue sans redémarrer : non mesuré (Claude Code annonce un rechargement à chaud depuis 2.1.0). Essai local du 2026-10-22 (réglages de workshop, Sonnet 5.5) : Skill(rumour-check) et une réponse sourcée (0,13 $) ; « Hello » → pas de skill (0,04 $). La page utilise une autre rumeur (débroussaillement) : le barbecue près de La Rochelle est le sujet de la Q6.

🗣️ Say (EN) - First predict on paper: which of questions 3, 11 and 12 will go up from column B to column C? Then replay the test set in mode C and score the questions of today, 3, 11 and 12, and question 8, which workshop 4 compares with its tool. - Rows 11 and 12 empty in columns B or RAG? At workshop 2 they were scored only if there was time: type score B 11 12 and score RAG 11 12 first, the answers came back with your save. - Read the rows, not the Total: today only some questions are scored. Two points: right and sourced; one: honest but not enough; zero: wrong or invented. - Put your chatbot in Open WebUI and ask your question 12. Your skill comes along, but not as in Claude Code: Open WebUI sends its whole text with every message, even "Hello". The description no longer decides when it is read. The three skills of the kit stay here: they write files, and a chatbot in Open WebUI cannot. - Then save your work for workshop 4, and fill in the exit card. - If you downloaded my-work.zip before, the new one may be called my-work (1).zip: bring the newest. For workshop 4, bring also the address of the official page of the fire danger level of your territory, if it has one.

2026-10-30 (11 questions, sans Q12) : replay C 1 min 42, 0,30 $ ; juge Q3 = 2, Q11 = 2 (Q8 non notée ce jour-là). Q8 notée en C pour que l'atelier 4 compare D et C sur 8, 11 et 12 ; sans Q12 : score C 3 8 11. openwebui chatbot exige openwebui start (lancé à l'accueil). Skills dans Open WebUI (image 2026.11.4) : chatbot-export emporte les skills du binôme (pas summarize, validate-summary, source-note), openwebui chatbot les attache, catégorie Skills des outils coupée : texte entier dans le prompt système à chaque message, ~204 jetons pour rumour-check (estimation cl100k, faux modèle, sans réseau, 2026-11-04, openwebui-prototypes/skills-rag/). Avec qwen3:8b (Ollama, ThinkPad, 2026-11-05) : la skill prise pour un outil, bulle vide 3 fois sur 3 ; le kit ne change pas (décision de Sébastien). Avec Claude Sonnet 5.5 (un essai, 2026-11-05, real-model-local/results-claude/) : recherche dans la base puis « Verdict: PARTLY TRUE » cité (0,061 $) ; « Hello » sans verdict.

🗣️ Say (EN) - If you are stuck, every command explains itself, for example `workshop help`. - In workshops 1 and 2 the chatbot has no slash commands: they answer "Unknown command". From workshop 3, `/context` shows what fills the window and `/status` shows the key in use; from workshop 4, `/mcp` shows the tools. - To leave a conversation in any mode, press Ctrl+C twice, and to read an open `.md` file as a page, press Ctrl+Shift+V (Cmd+Shift+V on a Mac); in the terminal, copy and paste are Ctrl+Shift+C / Ctrl+Shift+V (Cmd+C / Cmd+V on a Mac). - If something breaks, ask me: your files stay in the Codespace.

Repères de SETUP.md (copié dans chaque dépôt d'atelier). Vérifié à la répétition : en bare, A et B (--disable-slash-commands), /exit répond « Unknown command » ; Ctrl+C deux fois quitte dans tous les modes. /context, /mcp, /status : à partir de C.