NonDev Apps

Day 05 of 07

Give your chatbot a personality

Goal: Right now your chatbot is generic Claude. Today you write the system prompt that gives it a real role, a real voice, and real knowledge about your site.

What to do

01

Write your system prompt using the 4-part formula

Open a notes app or document and write your system prompt. Keep it under 200 words. Use these four parts: who you are, what you know, what you do not say, and your tone. Use the examples in the lesson to guide the shape.

02

Add the system prompt to chat.js (your Netlify Function)

Open netlify/functions/chat.js. Find the messages.create call. Add a system property with your prompt text. Replace only the messages.create block and leave everything else unchanged:

const response = await client.messages.create({ model: 'claude-haiku-4-5-20251001', max_tokens: 300, system: 'YOUR SYSTEM PROMPT HERE - paste your written prompt between these single quotes. If your prompt contains an apostrophe, replace it with the full word instead.', messages: [{ role: 'user', content: message }], })
03

Commit, push, and test the persona

Commit the change with the message Add chatbot persona, push, wait for deploy, then open your live site and test with questions your visitors would actually ask. Ask something it should know. Ask something it should decline. If the responses feel off, adjust the system prompt and push again.

Expected result

Your chatbot has a name, a role, and answers questions about your website in the right tone. It stays on topic and handles questions it cannot answer gracefully.

Key takeaway

  • The system prompt is where your chatbot personality lives. One clear paragraph can turn generic Claude into a useful site assistant.
Day 5 — Give your chatbot a personality | 7-Day AI Chatbot Challenge | NonDev Apps