botserver/docs/src/chapter-06-gbdialog/README.md

2.9 KiB

Chapter 06: BASIC + LLM - The Perfect Match

Why BASIC?

In 1964, John Kemeny and Thomas Kurtz created BASIC with a revolutionary idea: programming should be for everyone. Today, General Bots brings this philosophy to the AI era.

With BASIC + LLM, you write:

TALK "What's your name?"
HEAR name
poem = LLM "Create a heartfelt poem for " + name
TALK poem

Not 50 lines of boilerplate.

The Core Keywords

Just SEVEN main keywords power everything:

Keyword Purpose Example
TALK Output TALK "Hello!"
HEAR Input HEAR name AS NAME
USE KB Knowledge USE KB "docs"
USE TOOL Functions USE TOOL "weather"
GET Data GET "api/users"
IF/THEN Logic IF age >= 18 THEN ...
FOR/NEXT Loops FOR i = 1 TO 10 ...

Your First Tool

In the LLM world, you write tools that AI can use:

' enrollment.bas - An LLM-callable tool
PARAM name AS STRING LIKE "John Smith" DESCRIPTION "Full name"
PARAM email AS STRING LIKE "john@example.com" DESCRIPTION "Email"
PARAM course AS STRING LIKE "Introduction to AI" DESCRIPTION "Course"

DESCRIPTION "Enrolls a student in a course"

SAVE "enrollments.csv", name, email, course, NOW()
TALK "Enrolled " + name + " in " + course

The LLM handles the conversation. You define the action.

Everyone Can Program

You don't need:

  • A computer science degree
  • Years of experience
  • Understanding of algorithms

You just need:

  • An idea
  • 10 minutes to learn BASIC
  • Creativity

Getting Started

Time Goal
Minute 1 TALK "Hello, world!"
Minute 5 Add HEAR and LLM
Day 1 Production-ready bot

Documentation Guide

Document Purpose
Basics Core LLM-first concepts
Keywords Reference Complete keyword list
Templates Real-world examples
Universal Messaging Multi-channel support

Keyword Categories

The Philosophy

BASIC in General Bots isn't about controlling conversation flow - it's about providing tools and context that LLMs use intelligently.

Write simple tools. Let AI handle the complexity.


"The beauty of BASIC lies not in what it can do, but in who it enables to do it."