Course: Building AI Apps | Pathway: Builder | Tier: Free | Level: Beginner Estimated Reading Time: 10 minutes
In this lesson, you're going to build a working chatbot. Not a theoretical one. A real one that you can type questions into and get useful answers back.
We'll keep it simple: a chatbot that answers questions about a specific topic. It could be your business, your organisation, a hobby — whatever you like. The point is to go through the full process from idea to working tool.
By the end of this lesson, you'll have a chatbot running in your browser that you built yourself.
Before you build anything, get clear on what your chatbot should do. The more specific you are, the better it will work.
Ask yourself:
Let's use a concrete example. Say you run a small accounting firm in Auckland and you want a chatbot that answers common client questions.
Your chatbot's knowledge:
Write this information down in a simple document. This becomes the "knowledge base" for your chatbot.
This is the most important part: telling the AI how to behave. In AI terms, this is called a "system prompt" — a set of instructions that shape how the chatbot responds.
Here's a template you can adapt:
You are a helpful assistant for [Your Business Name], a [type of business] based in [location].
Your job is to answer questions about our services, hours, and general information. Be friendly, clear, and concise.
Here is what you know:
[Paste your knowledge base here]
Rules:
- Only answer questions related to the information above
- If someone asks something you don't know, say "I don't have that information, but you can reach us at [contact details]"
- Keep answers short and practical
- Be warm and professional
- Never make up information
For our accounting firm example:
You are a helpful assistant for Smith & Co Accounting, a small accounting firm based in Auckland.
Your job is to answer questions about our services, hours, pricing, and common tax questions. Be friendly, clear, and concise.
Here is what you know:
Services: We offer tax return preparation, monthly bookkeeping, GST filing, and business advisory services.
Pricing: We offer a free 30-minute initial consultation. Monthly bookkeeping packages start at $250/month. Individual tax returns from $150.
Hours: Monday to Friday, 8:30am to 5pm. Closed on public holidays.
Booking: Call us on 09 555 0123 or email hello@smithaccounting.co.nz
Common tax info:
- GST registration is required if your turnover exceeds $60,000 in 12 months
- Individual tax returns are due 7 July each year (or 31 March the following year if you use a tax agent)
- Common deductions for sole traders include home office costs, vehicle expenses, and professional development
Rules:
- Only answer questions related to the information above
- If someone asks something you don't know, say "I'm not sure about that — please give us a call on 09 555 0123 or email hello@smithaccounting.co.nz"
- Keep answers short and practical
- Be warm and professional
- Never make up information or give specific tax advice for individual situations
Now let's turn this into a working chatbot. We'll use Replit because it runs entirely in your browser — no installation needed.
Build a simple chatbot web page. It should have:
- A clean, modern chat interface
- A text input box at the bottom where users type questions
- Messages displayed in a conversation format
- The chatbot should respond based on a system prompt that I'll provide
- A header that says "Smith & Co Accounting - Ask Us Anything"
- A welcoming first message that says "Hi there! I'm the Smith & Co assistant. Ask me anything about our services, hours, or general tax questions."
Once your chatbot is running, test it properly. Don't just ask one question and call it done.
Test these scenarios:
What to look for:
Your first version won't be perfect. That's normal and expected. Here's how to improve it:
If answers are too long: Add to your system prompt: "Keep all responses under 3 sentences unless the question requires more detail."
If it's answering questions it shouldn't: Strengthen the boundaries: "You must only answer questions directly related to Smith & Co Accounting's services, hours, and general tax information. For everything else, direct the user to contact us."
If the tone is wrong: Be specific about what you want: "Respond in a warm, conversational tone. Avoid formal language. Write as if you're talking to a friend who asked you a question."
If it's making things up: Add: "Never guess. If the answer isn't in the information provided to you, say you don't know and provide contact details."
Each time you adjust the system prompt, test again. This cycle of test-refine-test is how you build something good.
Once you're happy with your chatbot, you can share it with others.
In Replit:
That's it. You've built a chatbot and put it on the internet.
Let's step back and appreciate what you've done. You:
This is the same basic process that professional developers follow. The tools are different, but the thinking is the same: define the problem, build a solution, test it, improve it, ship it.
"The chatbot just says it can't help with anything." Your system prompt might be too restrictive. Loosen the boundaries slightly, or make sure the knowledge base actually covers the questions you're asking.
"It's making up information that's wrong." This is called hallucination. Strengthen your system prompt with explicit instructions not to guess, and provide more detailed information in your knowledge base so it has less reason to fill gaps.
"The responses feel robotic." Add personality instructions to your system prompt. Something like: "Respond naturally, as if you're a helpful team member having a casual conversation. Use plain language."
"I can't get Replit to build what I want." Try being more specific in your description. Instead of "build a chatbot," describe exactly what you see on the screen — the layout, the colours, the text on buttons. The more detail you provide, the closer the result will be to what you want.
Now that you know the process, here are some ideas to try:
The process is the same every time: define what it knows, write clear instructions, build the interface, test, refine, share.
Key Takeaways: