Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dialog Basics

BASIC dialogs in General Bots are designed for the LLM era - you write tools and context setters, not complex conversation flows.

Core Concepts

ConceptDescription
LLM ToolsBASIC scripts that become callable tools for the LLM
ContextSET CONTEXT provides knowledge to the LLM
SuggestionsADD SUGGESTION guides conversations
MemoryGET/SET BOT/USER MEMORY for persistent data

LLM-First Example

' Load context from memory
resume = GET BOT MEMORY "announcements"
context = GET BOT MEMORY "company_info"

' Give LLM the context it needs
SET CONTEXT "announcements" AS resume
SET CONTEXT "company" AS context

' Guide the conversation
CLEAR SUGGESTIONS
ADD SUGGESTION "announcements" AS "Show me this week's updates"
ADD SUGGESTION "company" AS "Tell me about the company"

' Start conversation
TALK "What would you like to know?"

Creating LLM Tools

Instead of parsing user input, create tools the LLM can call:

' update-summary.bas - A tool the LLM can invoke
PARAM topic AS STRING LIKE "Q4 Results" DESCRIPTION "Topic to summarize"
PARAM length AS STRING LIKE "brief" DESCRIPTION "brief or detailed"

DESCRIPTION "Creates a summary of the requested topic"

data = GET BOT MEMORY topic
summary = LLM "Summarize this " + length + ": " + data
TALK summary

Traditional vs LLM Approach

TraditionalLLM + BASIC
Parse user input manuallyLLM understands naturally
Complex IF/ELSE treesTools with PARAMs
Validate every fieldLLM handles validation
Design conversation flowsLLM manages conversation

Tool Pattern Example

' schedule-appointment.bas
PARAM service AS STRING LIKE "consultation" DESCRIPTION "Type of appointment"
PARAM date AS DATE LIKE "tomorrow at 3pm" DESCRIPTION "Preferred date/time"

DESCRIPTION "Schedules an appointment and sends confirmation"

appointment = GET "api/appointments/available" WITH service, date
IF appointment.available THEN
  SET BOT MEMORY "last_appointment" AS appointment.id
  SEND EMAIL TO user.email WITH appointment.details
  TALK "Scheduled your " + service + " for " + date
ELSE
  alternatives = GET "api/appointments/suggest" WITH service, date
  TALK "That time isn't available. Alternatives: " + alternatives
END IF

Best Practices

DoDon’t
Write focused toolsCreate complex conversation flows
Use context wiselyMicromanage the LLM
Trust the LLMParse user input manually
Use suggestionsForce rigid paths

See Also