Guide
Building your first chatbot
Everything you need to go from a blank project to a chatbot that gives real answers — what each file does, which functions are available, and what to try next. No prior coding experience required.
What you're building
A chatbot is a program that reads a message and writes back a reply. Instead of programming every possible answer by hand, you write a short description of who the bot is and how it should behave — a real AI model does the actual answering, guided by your instructions.
Every project has exactly four files: config.py, prompt.py, logic.py, and main.py. Each one holds a different kind of decision, so you always know exactly where to make a change.
Create your account
- Open the platform and click Register.
- Sign up with an email and a password — this creates your own workspace and gives you starter tokens to run code and chat with your bot.
- From your dashboard, click New Project to open the code editor (the IDE).
Run your first bot
Every new project already has a working chatbot in it — you're customizing something real from the very first click, not starting from a blank page.
- Click Run in the top right of the editor.
- The console fills with a few lines confirming the bot started — that's normal.
- When the chat panel says Ready, type a question and press enter.
config.py
The settings drawer
# Settings for your chatbot live here. Change a value, save, and click Run
# to see it take effect — no need to touch any other file.
BOT_NAME = "Assistant""Chef Bot", "Study Buddy".prompt.py
The personality drawer
# This is your chatbot's personality and instructions, in plain English.
# The AI reads this every single time before it answers — change it to turn
# your bot into anything: a friendly tutor, a joke-teller, a pirate, a quiz
# host. Just describe who it is and how it should behave.
SYSTEM_PROMPT = (
"You are a helpful assistant. Answer the visitor's question clearly and "
"concisely, in at most three sentences."
)logic.py
The thinking drawer
# This is where your chatbot decides what to say back. "Logic" just means
# "the thinking part" — main.py hands each message to respond() below, and
# whatever respond() returns is sent back as the reply.
from ai import ask
from prompt import SYSTEM_PROMPT
def respond(message: str) -> str:
# ask() sends your SYSTEM_PROMPT plus their message to the AI,
# and gets a real answer back.
return ask(f"{SYSTEM_PROMPT}\n\nVisitor says: {message}")prompt.py, and send back whatever the AI says.main.py
The on/off switch
# This is the starting point of your chatbot — the file that runs first.
from ai import *
from config import BOT_NAME
from logic import respond
bot = ChatBot(BOT_NAME)
# Whenever someone messages the chatbot, this runs and sends back the reply.
@bot.on_message
def handle_message(message):
return respond(message)
bot.start()Functions you can use
Everything below is available the moment you write from ai import * at the top of a file — the same list shows up as autocomplete while you type in the editor, and ctrl+click on any of these names opens its real source code.
Ready to use
ChatBot(name: str = "Assistant")A text chatbot.
@bot.on_messageChatBot method. Decorator: registers the function below it as the handler called for every incoming message. The handler receives the visitor's message (str) and must return the reply (str).
bot.start()ChatBot method. Starts the bot — the platform automatically exposes it as a live chat endpoint in the preview panel. Call this once, last, at module level.
ask(question: str) -> strAsk the AI a question and get a text answer back.
reply(text: str) -> strSame as ask() — reads more naturally inside a chatbot handler.
memory() -> MemoryCreate a new, empty conversation memory buffer.
database() -> DatabaseGet a handle to this project's simple key-value database.
save(key: str, value) -> NoneSave a value under a name so you can load() it later.
load(key: str, default=None)Load a value previously saved with save().
create_table(name: str) -> TableCreate (or open) a named table for structured rows.
query(table: str, **filters) -> list[dict]Query rows from a table made with create_table(), filtered by exact-match keyword arguments.
Coming in a future update
These already autocomplete and show docs in the editor so you can see what's planned, but calling them raises an error for now.
VoiceBot(name: str = "Assistant")A voice chatbot: turns speech into text, runs your handler, turns the reply into speech.
speech_to_text(audio)Convert spoken audio into text.
text_to_speech(text: str)Convert text into spoken audio.
RAG(pdf)Ask questions about a PDF's contents.
upload_pdf()Upload a PDF for use with RAG().
vision(image)Describe or classify what's in an image.
ocr(image)Extract text from an image.
translate(text: str, to: str = "en") -> strTranslate text into another language.
search(query: str) -> list[dict]Search the web (or a project's knowledge base) for information.
email(to: str, subject: str, body: str) -> NoneSend an email.
sms(to: str, body: str) -> NoneSend a text message.
workflow(*steps)Chain multiple AI steps together into one pipeline.
agent(tools: list | None = None)Create a tool-using AI agent that can call the functions you give it.
image(prompt: str)Generate an image from a text description.
Ideas to try
Small edits, big changes. After each one: save, click Run, and chat again.
Give it a new name
In config.py, change BOT_NAME to anything you like.
Give it a new job
In prompt.py, rewrite SYSTEM_PROMPT — try "You are a pirate who answers in pirate slang."
Make it stricter
Add a rule like "Never answer in more than one sentence" and see what changes.
Troubleshooting
The chatbot just repeats back exactly what I typed.
That's the platform's offline fallback, used when a real AI connection isn't configured yet — check with your teacher or workshop organizer.
Red text showed up in the console.
That's Python explaining what went wrong — usually a missing quote mark or a typo. Read the last line for a hint, fix it, and click Run again.
I changed the code but nothing's different.
Changes only take effect after you click Run again.
Glossary
- variable
- A named box that holds a value — like BOT_NAME holding the text "Assistant".
- string
- Text, wrapped in quotes.
- function
- A named, reusable set of steps, like respond().
- import
- Borrowing code that's already written elsewhere.
- AI model
- The actual "brain" that reads the prompt and writes the reply.
- run
- Telling the computer to execute the code right now.