diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md
index 47475e155..54340df52 100644
--- a/docs/src/SUMMARY.md
+++ b/docs/src/SUMMARY.md
@@ -53,10 +53,11 @@
- [Chapter 06: gbdialog Reference](./chapter-06-gbdialog/README.md)
- [Dialog Basics](./chapter-06-gbdialog/basics.md)
- [Universal Messaging & Multi-Channel](./chapter-06-gbdialog/universal-messaging.md)
+ - [BASIC vs n8n/Zapier/Make](./chapter-06-gbdialog/basic-vs-automation-tools.md)
- [Template Examples](./chapter-06-gbdialog/templates.md)
- - [start.bas](./chapter-06-gbdialog/template-start.md)
- - [generate-summary.bas](./chapter-06-gbdialog/template-summary.md)
- - [enrollment Tool Example](./chapter-06-gbdialog/template-enrollment.md)
+ - [start.bas](./chapter-06-gbdialog/templates/start.md)
+ - [enrollment.bas](./chapter-06-gbdialog/templates/enrollment.md)
+ - [auth.bas](./chapter-06-gbdialog/templates/auth.md)
- [Consolidated Examples](./chapter-06-gbdialog/examples-consolidated.md)
- [Data Sync Tools](./chapter-06-gbdialog/tools-data-sync.md)
- [Keywords Reference](./chapter-06-gbdialog/keywords.md)
diff --git a/docs/src/chapter-06-gbdialog/basic-vs-automation-tools.md b/docs/src/chapter-06-gbdialog/basic-vs-automation-tools.md
new file mode 100644
index 000000000..12b5c77f2
--- /dev/null
+++ b/docs/src/chapter-06-gbdialog/basic-vs-automation-tools.md
@@ -0,0 +1,454 @@
+# BASIC vs Everyone: The Complete Domination Guide
+
+> *"Embrace, Extend, Extinguish"* β We learned from the best. Now we're doing it **open source**.
+
+## π― The Mission: Kill Them All
+
+Just like Microsoft killed Lotus 1-2-3 by making Excel better AND cheaper, General Bots BASIC is here to **obliterate** every paid automation tool, AI assistant, and workflow platform.
+
+**They charge you $30/user/month. We charge you $0. Forever.**
+
+---
+
+## π The Kill List
+
+### Automation Platforms (DEAD)
+- ~~n8n~~ β BASIC does more
+- ~~Zapier~~ β BASIC is free
+- ~~Make.com~~ β BASIC has AI native
+- ~~Power Automate~~ β BASIC is open source
+
+### AI Assistants (OBSOLETE)
+- ~~Microsoft Copilot~~ β We support Claude Opus 4, GPT-4, AND local models
+- ~~Google Gemini~~ β We're not locked to one vendor
+- ~~ChatGPT Plus~~ β Our bots DO things, not just chat
+
+### Office Suites (DISRUPTED)
+- ~~Microsoft 365~~ β We have email, drive, calendar, meet
+- ~~Google Workspace~~ β Same features, zero cost
+- ~~Zoho~~ β More AI, less complexity
+
+---
+
+## π The Ultimate Comparison Matrix
+
+| Feature | Zapier | n8n | Make | Power Automate | **Copilot** | **Gemini** | **BASIC** |
+|---------|--------|-----|------|----------------|-------------|------------|-----------|
+| **PRICE** | $50-800/mo | $24-500/mo | $10-350/mo | $15-40/user | **$30/user** | **$20/user** | **$0 FOREVER** |
+| Webhooks | β | β | β | β | β | β | β |
+| Scheduling | β | β | β | β | β | β | β `"every hour"` |
+| HTTP/REST | β | β | β | β | β | β | β |
+| GraphQL | β | β | β | β | β | β | β |
+| SOAP | β | β | β | β | β | β | β |
+| Database Native | β | β | β | β | β | β | β |
+| **Conversations** | β | β | β | β | β | β | β |
+| **WhatsApp Native** | Plugin | Plugin | Plugin | Plugin | β | β | β **NATIVE** |
+| **Telegram Native** | Plugin | Plugin | Plugin | β | β | β | β **NATIVE** |
+| **Image Generation** | β | β | β | β | β DALL-E | β Imagen | β **ANY MODEL** |
+| **Video Generation** | β | β | β | β | β | β | β |
+| **Voice/TTS** | β | β | β | β | β | β | β |
+| **Vision/OCR** | Plugin | Plugin | Plugin | β | β | β | β |
+| **Best AI Models** | β | β | β | GPT-4 only | GPT-4 only | Gemini only | β **ALL MODELS** |
+| Claude Opus 4 | β | β | β | β | β | β | β |
+| Local LLMs | β | β | β | β | β | β | β Llama/Mistral |
+| **Self-Hosted** | β | β | β | β | β | β | β **100% YOURS** |
+| **Open Source** | β | β | β | β | β | β | β **AGPL** |
+| **White Label** | β | β | β | β | β | β | β |
+| Version Control | β | β | β | β | β | β | β Git native |
+| Lead Scoring AI | β | β | β | β | β | β | β |
+| CRM Native | Plugin | Plugin | Plugin | Plugin | β | β | β |
+| Email Server | β | β | β | Exchange | Gmail | Gmail | β **BUILT-IN** |
+| Video Meetings | β | β | β | Teams | Teams | Meet | β **BUILT-IN** |
+| File Storage | β | β | β | OneDrive | OneDrive | Drive | β **BUILT-IN** |
+
+---
+
+## π₯ Why Copilot & Gemini Are ALREADY DEAD
+
+### Microsoft Copilot: $30/user/month for WHAT?
+
+**What Copilot gives you:**
+- Chat with documents *(we do this)*
+- Email drafting *(we do this)*
+- Meeting summaries *(we do this)*
+- Excel formulas *(we do this)*
+- Locked to Microsoft ecosystem *(WE DON'T)*
+- GPT-4 only *(we support ALL models)*
+
+**What BASIC gives you for FREE:**
+```basic
+' Everything Copilot does, plus automation
+USE KB "company-docs"
+answer = LLM "Summarize Q4 results from the uploaded documents"
+SEND MAIL "team@company.com", "Q4 Summary", answer
+
+' Schedule it!
+SET SCHEDULE "every monday at 9am"
+```
+
+**Copilot can't:**
+- Send WhatsApp messages
+- Trigger webhooks
+- Run scheduled automations
+- Generate videos
+- Score leads
+- Build interactive bots
+- Work offline with local LLMs
+
+### Google Gemini: Locked in Google's Walled Garden
+
+**Gemini limitations:**
+- Only works with Google Workspace
+- Only Gemini models (no Claude, no GPT)
+- No automation capabilities
+- No webhook triggers
+- No self-hosting
+- Your data trains their models
+
+**BASIC destroys this:**
+```basic
+' Use ANY model - Claude Opus 4 is the BEST
+SET LLM MODEL "claude-opus-4"
+analysis = LLM "Deep analysis of customer feedback with nuanced understanding"
+
+' Or use local models for privacy
+SET LLM MODEL "llama-3.1-70b"
+private_analysis = LLM "Analyze confidential data locally"
+
+' Or use Gemini if you want!
+SET LLM MODEL "gemini-pro"
+```
+
+---
+
+## π΄ββ οΈ The Microsoft Playbook (We're Using It)
+
+### 1. EMBRACE β
+We support everything they support:
+- All their file formats
+- All their APIs
+- All their integrations
+- All their workflows
+
+### 2. EXTEND β
+We add what they CAN'T:
+- **Conversational AI** - Interactive bots, not just automation
+- **Multi-model AI** - Claude Opus 4, GPT-4, Gemini, Llama, Mistral
+- **Multimodal** - Image, video, audio generation
+- **Self-hosted** - Your data stays yours
+- **White label** - Your brand, not ours
+- **Zero cost** - Forever free
+
+### 3. EXTINGUISH π―
+Why would anyone pay when they can get MORE for FREE?
+
+| Their Product | Their Cost | **BASIC Replacement** | **Your Cost** |
+|---------------|------------|----------------------|---------------|
+| Zapier Business | $800/month | BASIC Scripts | **$0** |
+| n8n Cloud | $500/month | BASIC Scripts | **$0** |
+| Make Teams | $350/month | BASIC Scripts | **$0** |
+| Power Automate | $40/user/month | BASIC Scripts | **$0** |
+| Copilot Pro | $30/user/month | LLM Keyword + KB | **$0** |
+| Gemini Advanced | $20/user/month | LLM Keyword | **$0** |
+| ChatGPT Plus | $20/month | LLM Keyword | **$0** |
+| Microsoft 365 | $22/user/month | Full Office Suite | **$0** |
+| Google Workspace | $12/user/month | Full Office Suite | **$0** |
+| Intercom | $74/user/month | BASIC Bots | **$0** |
+| HubSpot | $800/month | CRM + Lead Scoring | **$0** |
+| Twilio | Pay per message | WhatsApp Native | **$0** |
+
+**100 users Γ $30/month Copilot = $3,000/month = $36,000/year**
+**100 users Γ BASIC = $0/month = $0/year**
+
+---
+
+## π Claude Opus 4: The Best Model, Available HERE
+
+While Copilot is stuck with GPT-4 and Gemini is stuck with... Gemini, **BASIC supports Claude Opus 4** β widely considered the most capable AI model for:
+
+- **Nuanced understanding** - Better at complex instructions
+- **Longer context** - 200K tokens vs GPT-4's 128K
+- **Better coding** - More accurate code generation
+- **Safer outputs** - Constitutional AI training
+- **Less hallucination** - More factual responses
+
+```basic
+' Use the BEST model available
+SET LLM MODEL "claude-opus-4"
+
+' Complex multi-step reasoning
+analysis = LLM "
+ Analyze our Q4 sales data and:
+ 1. Identify top 3 performing regions
+ 2. Find correlation with marketing spend
+ 3. Predict Q1 trends
+ 4. Recommend budget allocation
+ Be specific with numbers and confidence levels.
+"
+
+TALK analysis
+```
+
+**Model Freedom:**
+```basic
+' Switch models based on task
+SET LLM MODEL "claude-opus-4" ' Complex analysis
+SET LLM MODEL "gpt-4-turbo" ' General tasks
+SET LLM MODEL "gemini-pro" ' Google integration
+SET LLM MODEL "llama-3.1-70b" ' Private/offline
+SET LLM MODEL "mistral-large" ' European compliance
+SET LLM MODEL "deepseek-coder" ' Code generation
+```
+
+---
+
+## πͺ What We Do That NO ONE Else Can
+
+### 1. Conversational Automation
+```basic
+' Interactive workflow - impossible in Zapier/n8n
+TALK "I'll help you file an expense report. What's the amount?"
+HEAR amount
+
+TALK "What category? (travel/meals/supplies)"
+HEAR category
+
+TALK "Upload the receipt photo"
+HEAR receipt AS FILE
+
+' AI extracts receipt data
+receipt_data = SEE receipt
+verified_amount = receipt_data.total
+
+IF verified_amount != amount THEN
+ TALK "Receipt shows $" + verified_amount + ", you entered $" + amount + ". Which is correct?"
+ HEAR correct_amount
+ amount = correct_amount
+END IF
+
+INSERT "expenses", amount, category, receipt, NOW()
+TALK "Expense submitted! Reference: " + LAST_INSERT_ID
+```
+
+### 2. Multi-Channel Native
+```basic
+' Same bot works on ALL channels
+TALK "Your order has shipped!" ' Works on WhatsApp, Telegram, Web, SMS
+
+' Channel-specific when needed
+IF channel = "whatsapp" THEN
+ SEND TEMPLATE "shipping_update", phone, tracking_number
+ELSE IF channel = "email" THEN
+ SEND MAIL email, "Shipping Update", tracking_email
+END IF
+```
+
+### 3. AI That DOES Things
+```basic
+' Not just chat - actual automation
+SET SCHEDULE "every day at 6am"
+
+' Analyze overnight support tickets
+tickets = FIND "support_tickets", "created_at > DATEADD('hour', -12, NOW())"
+
+FOR EACH ticket IN tickets
+ ' AI categorizes and prioritizes
+ analysis = LLM "Analyze this support ticket and return JSON with category, priority, suggested_response: " + ticket.content
+
+ UPDATE "support_tickets", ticket.id, analysis.category, analysis.priority
+
+ IF analysis.priority = "urgent" THEN
+ TALK TO on_call_agent, "π¨ Urgent ticket: " + ticket.subject
+ END IF
+NEXT
+
+' Generate daily summary
+summary = LLM "Create executive summary of " + LEN(tickets) + " overnight tickets"
+SEND MAIL "support-manager@company.com", "Overnight Ticket Summary", summary
+```
+
+### 4. Complete Office Suite Replacement
+```basic
+' Email
+SEND MAIL "team@company.com", "Subject", "Body"
+emails = GET "mail/inbox"
+
+' Calendar
+BOOK "Sales Meeting", "tomorrow at 2pm", "john@company.com, jane@company.com"
+
+' Files
+UPLOAD "report.pdf", "shared/reports/"
+file = DOWNLOAD "shared/templates/invoice.docx"
+GENERATE PDF "invoice_data", "invoice_template.docx"
+
+' Tasks
+CREATE TASK "Review proposal", "john", "friday"
+
+' Meetings (video)
+meeting_url = CREATE MEETING "Weekly Standup", "monday at 9am"
+```
+
+---
+
+## πͺ The Migration Massacre
+
+### From Zapier (RIP)
+```basic
+' Zapier: 5 zaps, $50/month
+' BASIC: 10 lines, $0/month
+
+ON FORM SUBMIT "contact-form"
+ ' Send to Slack
+ POST "https://hooks.slack.com/...", { "text": "New lead: " + form.email }
+
+ ' Add to CRM
+ INSERT "leads", form.name, form.email, form.company
+
+ ' Send welcome email
+ SEND MAIL form.email, "Thanks for reaching out!", welcome_template
+
+ ' Score the lead with AI
+ score = AI SCORE LEAD form.email, form.company, form.message
+ UPDATE "leads", LAST_INSERT_ID, "score", score
+END ON
+```
+
+### From n8n (Gone)
+```basic
+' n8n: Complex node setup, self-host headaches
+' BASIC: Just write what you want
+
+SET SCHEDULE "every 5 minutes"
+
+' Monitor website
+response = GET "https://mysite.com/health"
+IF response.status != 200 THEN
+ TALK TO ops_team, "π΄ Website down! Status: " + response.status
+ CREATE TASK "Investigate website outage", "devops", "urgent"
+END IF
+```
+
+### From Power Automate (Destroyed)
+```basic
+' Power Automate: $40/user/month, Microsoft lock-in
+' BASIC: Free, works everywhere
+
+' When email arrives with attachment
+ON EMAIL RECEIVED
+ IF email.has_attachments THEN
+ FOR EACH attachment IN email.attachments
+ ' Extract data with AI vision
+ data = SEE attachment
+
+ ' Save to database
+ INSERT "documents", email.from, attachment.name, data
+
+ ' Notify team
+ TALK TO document_team, "New document from " + email.from
+ NEXT
+ END IF
+END ON
+```
+
+### From Copilot (Obsolete)
+```basic
+' Copilot: $30/user, limited to Microsoft
+' BASIC: $0, unlimited potential
+
+' Everything Copilot does
+USE KB "company-knowledge"
+answer = LLM "Answer this question using company docs: " + question
+
+' Plus things Copilot CAN'T do
+SET SCHEDULE "every monday at 8am"
+report = LLM "Generate weekly report from sales data"
+SEND MAIL team, "Weekly Report", report
+POST "https://slack.com/api/...", { "text": report }
+```
+
+---
+
+## π TCO Calculator: The Massacre in Numbers
+
+### Small Business (10 users)
+| Solution | Monthly | Annual |
+|----------|---------|--------|
+| Zapier + Copilot | $300 + $300 = $600 | $7,200 |
+| n8n + ChatGPT | $50 + $200 = $250 | $3,000 |
+| **BASIC** | **$0** | **$0** |
+
+### Medium Business (100 users)
+| Solution | Monthly | Annual |
+|----------|---------|--------|
+| Zapier Pro + M365 + Copilot | $800 + $2,200 + $3,000 = $6,000 | $72,000 |
+| Make + Google + Gemini | $350 + $1,200 + $2,000 = $3,550 | $42,600 |
+| **BASIC** | **$0** | **$0** |
+
+### Enterprise (1,000 users)
+| Solution | Monthly | Annual |
+|----------|---------|--------|
+| Enterprise Stack | $50,000+ | $600,000+ |
+| **BASIC** | **$0** | **$0** |
+
+**SAVINGS: $600,000/year**
+
+---
+
+## π The Endgame
+
+### Why They Can't Compete
+
+1. **We're open source** - They can't undercut free
+2. **We support ALL models** - They're locked to their own
+3. **We're self-hosted** - Your data is yours
+4. **We're conversation-first** - They're automation-only
+5. **We're multimodal native** - They bolt on features
+6. **We have no per-user pricing** - Deploy to millions, pay nothing
+
+### The Lotus 1-2-3 Moment
+
+Remember when Excel killed Lotus 1-2-3?
+- Excel was **cheaper** β
+- Excel was **more integrated** β
+- Excel **embraced their file format** β
+- Excel **extended with features** β
+
+**BASIC is doing the same thing to the entire automation/AI assistant industry.**
+
+---
+
+## π Get Started (It's Free, Obviously)
+
+```bash
+# One command to rule them all
+curl -fsSL https://get.generalbots.com | sh
+
+# Or with Docker
+docker run -d generalbots/botserver
+```
+
+Then write your first automation:
+```basic
+SET SCHEDULE "every hour"
+TALK "Hello from the future of automation!"
+```
+
+**No credit card. No trial period. No user limits. No bullshit.**
+
+---
+
+## Related
+
+- [Keywords Reference](./keywords.md) - Complete keyword documentation
+- [SET SCHEDULE](./keyword-set-schedule.md) - Natural language scheduling
+- [WEBHOOK](./keyword-webhook.md) - Event-driven automation
+- [LLM](./keyword-llm.md) - AI integration with ANY model
+- [Templates](./templates.md) - Ready-to-use automation templates
+
+---
+
+*"The best way to predict the future is to create it."*
+β Alan Kay
+
+*"The best way to compete with expensive software is to make it free."*
+β General Bots
\ No newline at end of file
diff --git a/docs/src/chapter-06-gbdialog/keyword-set-schedule.md b/docs/src/chapter-06-gbdialog/keyword-set-schedule.md
index 268e4313c..c5fd1a66c 100644
--- a/docs/src/chapter-06-gbdialog/keyword-set-schedule.md
+++ b/docs/src/chapter-06-gbdialog/keyword-set-schedule.md
@@ -1,24 +1,111 @@
# SET SCHEDULE
-Schedule a script or task to run at specified times using cron expressions.
+Schedule a script or task to run at specified times using natural language or cron expressions.
## Syntax
```basic
-SET SCHEDULE cron_expression
+SET SCHEDULE expression
```
## Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
-| `cron_expression` | String | Standard cron expression defining when to run |
+| `expression` | String | Natural language schedule or cron expression |
## Description
-The `SET SCHEDULE` keyword schedules the current script to run automatically at specified intervals. It uses standard cron syntax for maximum flexibility in scheduling.
+The `SET SCHEDULE` keyword schedules the current script to run automatically at specified intervals. It supports **natural language expressions** that are automatically converted to cron format, making scheduling intuitive and readable.
-## Cron Expression Format
+## Natural Language Patterns
+
+### Time Intervals
+
+```basic
+SET SCHEDULE "every minute"
+SET SCHEDULE "every 5 minutes"
+SET SCHEDULE "every 15 minutes"
+SET SCHEDULE "every 30 minutes"
+SET SCHEDULE "every hour"
+SET SCHEDULE "every 2 hours"
+SET SCHEDULE "every 6 hours"
+SET SCHEDULE "every day"
+SET SCHEDULE "every week"
+SET SCHEDULE "every month"
+SET SCHEDULE "every year"
+```
+
+### Aliases
+
+```basic
+SET SCHEDULE "hourly" ' Same as "every hour"
+SET SCHEDULE "daily" ' Same as "every day"
+SET SCHEDULE "weekly" ' Same as "every week"
+SET SCHEDULE "monthly" ' Same as "every month"
+SET SCHEDULE "yearly" ' Same as "every year"
+```
+
+### Specific Times
+
+```basic
+SET SCHEDULE "at 9am"
+SET SCHEDULE "at 9:30am"
+SET SCHEDULE "at 2pm"
+SET SCHEDULE "at 14:00"
+SET SCHEDULE "at midnight"
+SET SCHEDULE "at noon"
+```
+
+### Day-Specific
+
+```basic
+SET SCHEDULE "every monday"
+SET SCHEDULE "every friday"
+SET SCHEDULE "every sunday"
+SET SCHEDULE "every monday at 9am"
+SET SCHEDULE "every friday at 5pm"
+```
+
+### Weekdays & Weekends
+
+```basic
+SET SCHEDULE "weekdays" ' Monday-Friday at midnight
+SET SCHEDULE "every weekday" ' Same as above
+SET SCHEDULE "weekdays at 8am" ' Monday-Friday at 8 AM
+SET SCHEDULE "weekends" ' Saturday & Sunday at midnight
+SET SCHEDULE "weekends at 10am" ' Saturday & Sunday at 10 AM
+```
+
+### Combined Patterns
+
+```basic
+SET SCHEDULE "every day at 9am"
+SET SCHEDULE "every day at 6:30pm"
+SET SCHEDULE "every hour from 9 to 17"
+```
+
+### Business Hours
+
+```basic
+SET SCHEDULE "business hours" ' Every hour 9-17, Mon-Fri
+SET SCHEDULE "every hour during business hours" ' Same as above
+SET SCHEDULE "every 30 minutes during business hours" ' Every 30 min, 9-17, Mon-Fri
+SET SCHEDULE "every 15 minutes during business hours"
+```
+
+### Raw Cron (Advanced)
+
+You can still use standard cron expressions for maximum flexibility:
+
+```basic
+SET SCHEDULE "0 * * * *" ' Every hour at minute 0
+SET SCHEDULE "*/5 * * * *" ' Every 5 minutes
+SET SCHEDULE "0 9-17 * * 1-5" ' Hourly 9AM-5PM on weekdays
+SET SCHEDULE "0 0 1 * *" ' First day of each month
+```
+
+## Cron Expression Format (Reference)
```
ββββββββββββββ minute (0-59)
@@ -30,147 +117,167 @@ The `SET SCHEDULE` keyword schedules the current script to run automatically at
* * * * *
```
+## Quick Reference Table
+
+| Natural Language | Cron Equivalent | Description |
+|-----------------|-----------------|-------------|
+| `every minute` | `* * * * *` | Runs every minute |
+| `every 5 minutes` | `*/5 * * * *` | Every 5 minutes |
+| `every hour` | `0 * * * *` | Start of every hour |
+| `hourly` | `0 * * * *` | Same as every hour |
+| `every day` | `0 0 * * *` | Daily at midnight |
+| `daily` | `0 0 * * *` | Same as every day |
+| `at 9am` | `0 9 * * *` | Daily at 9 AM |
+| `at 9:30am` | `30 9 * * *` | Daily at 9:30 AM |
+| `at noon` | `0 12 * * *` | Daily at noon |
+| `at midnight` | `0 0 * * *` | Daily at midnight |
+| `every monday` | `0 0 * * 1` | Monday at midnight |
+| `every monday at 9am` | `0 9 * * 1` | Monday at 9 AM |
+| `weekdays` | `0 0 * * 1-5` | Mon-Fri at midnight |
+| `weekdays at 8am` | `0 8 * * 1-5` | Mon-Fri at 8 AM |
+| `weekends` | `0 0 * * 0,6` | Sat-Sun at midnight |
+| `every week` | `0 0 * * 0` | Sunday at midnight |
+| `weekly` | `0 0 * * 0` | Same as every week |
+| `every month` | `0 0 1 * *` | 1st of month |
+| `monthly` | `0 0 1 * *` | Same as every month |
+| `business hours` | `0 9-17 * * 1-5` | Hourly 9-5 weekdays |
+| `every hour from 9 to 17` | `0 9-17 * * *` | Hourly 9 AM - 5 PM |
+
## Examples
-### Every Hour
+### Daily Report at 9 AM
+
```basic
-SET SCHEDULE "0 * * * *"
-' Runs at the start of every hour
-```
+SET SCHEDULE "every day at 9am"
-### Daily at Specific Time
-```basic
-SET SCHEDULE "0 9 * * *"
-' Runs every day at 9:00 AM
-```
-
-### Every 5 Minutes
-```basic
-SET SCHEDULE "*/5 * * * *"
-' Runs every 5 minutes
-```
-
-### Weekdays Only
-```basic
-SET SCHEDULE "0 8 * * 1-5"
-' Runs at 8 AM Monday through Friday
-```
-
-### Multiple Times Daily
-```basic
-SET SCHEDULE "0 9,12,17 * * *"
-' Runs at 9 AM, 12 PM, and 5 PM
-```
-
-### Monthly Reports
-```basic
-SET SCHEDULE "0 6 1 * *"
-' Runs at 6 AM on the first day of each month
-```
-
-## Common Patterns
-
-| Pattern | Cron Expression | Description |
-|---------|----------------|-------------|
-| Every minute | `* * * * *` | Runs every minute |
-| Every hour | `0 * * * *` | Start of every hour |
-| Every 30 minutes | `*/30 * * * *` | Every 30 minutes |
-| Daily at midnight | `0 0 * * *` | Every day at 12:00 AM |
-| Weekly on Monday | `0 0 * * 1` | Every Monday at midnight |
-| Last day of month | `0 0 28-31 * *` | End of month (approximate) |
-| Business hours | `0 9-17 * * 1-5` | Every hour 9 AM-5 PM weekdays |
-
-## Practical Use Cases
-
-### Daily Summary Generation
-```basic
-SET SCHEDULE "0 6 * * *"
-
-' Fetch and summarize daily data
data = GET "reports/daily.json"
summary = LLM "Summarize key metrics: " + data
-SET BOT MEMORY "daily_summary", summary
+SEND MAIL "team@company.com", "Daily Report", summary
```
-### Hourly Data Refresh
-```basic
-SET SCHEDULE "0 * * * *"
+### Hourly Data Sync
-' Update cached data every hour
-fresh_data = GET "https://server/data"
+```basic
+SET SCHEDULE "every hour"
+
+fresh_data = GET "https://api.example.com/data"
SET BOT MEMORY "cached_data", fresh_data
+PRINT "Data refreshed at " + NOW()
```
-### Weekly Newsletter
-```basic
-SET SCHEDULE "0 10 * * 1"
+### Every 15 Minutes Monitoring
+
+```basic
+SET SCHEDULE "every 15 minutes"
+
+status = GET "https://api.example.com/health"
+IF status.healthy = false THEN
+ SEND MAIL "ops@company.com", "Alert: Service Down", status.message
+END IF
+```
+
+### Weekly Newsletter (Monday 10 AM)
+
+```basic
+SET SCHEDULE "every monday at 10am"
+
+subscribers = FIND "subscribers", "active=true"
+content = LLM "Generate weekly newsletter with latest updates"
-' Send weekly newsletter every Monday at 10 AM
-subscribers = FIND "subscribers_custom", "active=true"
FOR EACH email IN subscribers
- SEND MAIL email, "Weekly Update", newsletter_content
+ SEND MAIL email.address, "Weekly Update", content
NEXT
```
-### Cancel Schedule
+### Business Hours Support Check
+
```basic
-' Schedules are automatically canceled when SET SCHEDULE is removed from .bas.
+SET SCHEDULE "every 30 minutes during business hours"
+
+tickets = FIND "support_tickets", "status=open AND priority=high"
+IF LEN(tickets) > 5 THEN
+ TALK TO "support-manager", "High priority ticket queue: " + LEN(tickets) + " tickets waiting"
+END IF
+```
+
+### Weekend Backup
+
+```basic
+SET SCHEDULE "weekends at 3am"
+
+PRINT "Starting weekend backup..."
+result = POST "https://backup.service/run", { "type": "full" }
+SET BOT MEMORY "last_backup", NOW()
+SEND MAIL "admin@company.com", "Backup Complete", result
+```
+
+### End of Month Report
+
+```basic
+SET SCHEDULE "monthly"
+
+' Runs on 1st of each month at midnight
+month_data = AGGREGATE "sales", "SUM(amount)", "month=" + MONTH(DATEADD("month", -1, NOW()))
+report = LLM "Generate monthly sales report for: " + month_data
+SEND MAIL "finance@company.com", "Monthly Sales Report", report
```
## Best Practices
-1. **Start Time Consideration**: Avoid scheduling all tasks at the same time
+1. **Use Natural Language**: Prefer readable expressions like `"every day at 9am"` over cron syntax
+
+2. **Stagger Tasks**: Avoid scheduling all tasks at the same time
```basic
- ' Bad: Everything at midnight
- SET SCHEDULE "0 0 * * *"
-
- ' Good: Stagger tasks
- SET SCHEDULE "0 2 * * *" ' Cleanup at 2 AM
- SET SCHEDULE "0 3 * * *" ' Backup at 3 AM
+ ' Good: Different times
+ SET SCHEDULE "every day at 2am" ' Cleanup
+ SET SCHEDULE "every day at 3am" ' Backup
+ SET SCHEDULE "every day at 4am" ' Reports
```
-2. **Resource Management**: Consider system load
- ```basic
- ' Heavy processing during off-hours
- SET SCHEDULE "0 2-4 * * *"
- ```
+3. **Consider Time Zones**: Schedule times are in server's local time
-3. **Error Handling**: Include error recovery
+4. **Error Handling**: Always include error recovery
```basic
- SET SCHEDULE "0 * * * *"
+ SET SCHEDULE "every hour"
TRY
PROCESS_DATA()
CATCH
- LOG "Schedule failed: " + ERROR_MESSAGE
+ PRINT "Schedule failed: " + ERROR_MESSAGE
SEND MAIL "admin@example.com", "Schedule Error", ERROR_DETAILS
END TRY
```
-4. **Idempotency**: Make scheduled tasks safe to re-run
+5. **Idempotency**: Make scheduled tasks safe to re-run
```basic
- ' Check if already processed
last_run = GET BOT MEMORY "last_process_time"
- IF TIME_DIFF(NOW(), last_run) > 3600 THEN
+ IF DATEDIFF("minute", last_run, NOW()) > 55 THEN
PROCESS()
SET BOT MEMORY "last_process_time", NOW()
END IF
```
+## Cancel Schedule
+
+Schedules are automatically canceled when `SET SCHEDULE` is removed from the `.bas` file. Simply delete or comment out the line:
+
+```basic
+' SET SCHEDULE "every hour" ' Commented out = disabled
+```
+
## Limitations
- Maximum 100 scheduled tasks per bot
- Minimum interval: 1 minute
- Scripts timeout after 5 minutes by default
-- Schedules persist until explicitly canceled or bot restarts
- Time zone is server's local time
## Monitoring
-Scheduled tasks are logged for monitoring:
+Scheduled tasks are logged automatically:
- Execution start/end times
- Success/failure status
-- Error messages
+- Error messages if any
- Performance metrics
## Related Keywords
@@ -186,8 +293,10 @@ Scheduled tasks are logged for monitoring:
Located in `src/basic/keywords/set_schedule.rs`
The implementation:
-- Uses cron parser for expression validation
+- Uses a fast rule-based natural language parser (no LLM required)
+- Falls back to raw cron if input is already in cron format
+- Validates expressions before saving
- Integrates with system scheduler
- Persists schedules in database
- Handles concurrent execution
-- Provides retry logic for failures
+- Provides retry logic for failures
\ No newline at end of file
diff --git a/docs/src/chapter-06-gbdialog/templates.md b/docs/src/chapter-06-gbdialog/templates.md
index 7e290ae00..c429a1683 100644
--- a/docs/src/chapter-06-gbdialog/templates.md
+++ b/docs/src/chapter-06-gbdialog/templates.md
@@ -1,24 +1,118 @@
# Template Examples
-For template examples and detailed documentation, please see [Chapter 2: Templates](../chapter-02/templates.md).
+Templates are pre-built BASIC scripts that demonstrate common use cases and patterns. Each template includes complete code, explanations, and **interactive WhatsApp-style sample dialogs** showing how the bot behaves in real conversations.
## Available Templates
-BotServer includes 21 pre-built templates in the `templates/` directory:
+### π [start.bas](./templates/start.md)
+**Topic: Basic Greeting & Help Flow**
-- **default.gbai** - Basic bot with weather, email, and calculation tools
-- **edu.gbai** - Educational bot for course management
-- **crm.gbai** - Customer relationship management
-- **announcements.gbai** - Broadcast messaging system
-- **whatsapp.gbai** - WhatsApp Business integration
-- And many more...
+The simplest possible bot - learn BASIC fundamentals with a greeting flow that demonstrates `SET`, `TALK`, `HEAR`, and `IF/ELSE`.
+
+Perfect for:
+- Learning BASIC syntax
+- Quick demos
+- Starting point for new bots
+
+---
+
+### π [enrollment.bas](./templates/enrollment.md)
+**Topic: User Registration & Data Collection**
+
+A complete data collection workflow that gathers user information step-by-step, validates inputs, confirms details, and saves the data.
+
+Perfect for:
+- Customer onboarding
+- Event registrations
+- Lead capture forms
+- Survey collection
+
+---
+
+### π [auth.bas](./templates/auth.md)
+**Topic: Authentication Patterns**
+
+Secure user authentication flows including login, registration, password reset, and session management.
+
+Perfect for:
+- User login systems
+- Account verification
+- Password recovery
+- Session handling
+
+---
+
+## Template Structure
+
+Each template documentation includes:
+
+1. **Topic Description** - What the template is for
+2. **The Code** - Complete, working BASIC script
+3. **Sample Dialogs** - WhatsApp-style conversations showing real interactions
+4. **Keywords Used** - Quick reference of BASIC keywords
+5. **Customization Ideas** - Ways to extend the template
## Using Templates
-Templates provide ready-to-use bot configurations. Each template includes:
-- Dialog scripts (`.gbdialog`)
-- Knowledge bases (`.gbkb`)
-- Configuration (`.gbot`)
-- Optional themes (`.gbtheme`)
+### Method 1: Copy and Customize
-See [Chapter 2: Templates](../chapter-02/templates.md) for complete documentation on using and customizing templates.
\ No newline at end of file
+Copy the template code into your `.gbdialog` folder and modify it:
+
+```basic
+' Copy start.bas and customize
+SET user_name = "Guest"
+TALK "Hello, " + user_name + "! Welcome to My Company."
+HEAR user_input
+' ... add your logic
+```
+
+### Method 2: Include Templates
+
+Use the `INCLUDE` keyword to use templates as building blocks:
+
+```basic
+INCLUDE "templates/auth.bas"
+
+' Now use auth functions
+CALL authenticate_user()
+```
+
+### Method 3: Use as Reference
+
+Study the templates to learn patterns, then write your own:
+
+```basic
+' Learned from enrollment.bas pattern
+PARAM name AS string LIKE "John Doe"
+DESCRIPTION "User's full name"
+
+TALK "What's your name?"
+HEAR name
+' ... continue with your logic
+```
+
+## More Templates
+
+The `templates/` directory contains 20+ ready-to-use bot configurations:
+
+| Template | Description |
+|----------|-------------|
+| `default.gbai` | Basic bot with weather, email, and calculation tools |
+| `edu.gbai` | Educational bot for course management |
+| `crm.gbai` | Customer relationship management |
+| `announcements.gbai` | Broadcast messaging system |
+| `whatsapp.gbai` | WhatsApp Business integration |
+| `store.gbai` | E-commerce bot |
+| `healthcare` | Healthcare appointment scheduling |
+| `hr` | Human resources assistant |
+| `finance` | Financial services bot |
+| `marketing.gbai` | Marketing automation |
+| `reminder.gbai` | Task and reminder management |
+| `backup.gbai` | Automated backup workflows |
+| `crawler.gbai` | Web crawling and data extraction |
+
+## Related
+
+- [BASIC vs n8n/Zapier/Make](./basic-vs-automation-tools.md) - Why BASIC beats drag-and-drop tools
+- [Keywords Reference](./keywords.md) - Complete keyword documentation
+- [Consolidated Examples](./examples-consolidated.md) - More code examples
\ No newline at end of file
diff --git a/docs/src/chapter-06-gbdialog/templates/auth.md b/docs/src/chapter-06-gbdialog/templates/auth.md
index d5bceede2..d5e45bcef 100644
--- a/docs/src/chapter-06-gbdialog/templates/auth.md
+++ b/docs/src/chapter-06-gbdialog/templates/auth.md
@@ -1,31 +1,433 @@
-# auth.bas (Template)
+# Authentication Template
-This template demonstrates a simple authentication flow using the BASIC dialog language.
+The authentication template demonstrates secure user verification flows including login, registration, password validation, and session management.
+
+## Topic: User Authentication & Security
+
+This template is perfect for:
+- User login systems
+- Account verification
+- Password recovery flows
+- Session management
+- Two-factor authentication
+
+## The Code
```basic
-REM Simple authentication flow
+REM Authentication Flow with Retry Logic
+
+PARAM username AS string LIKE "john.doe"
+DESCRIPTION "Username or email for authentication"
+
+PARAM password AS string LIKE "********"
+DESCRIPTION "User's password (masked input)"
+
+SET max_attempts = 3
SET attempts = 0
+
+TALK "Welcome! Please enter your username:"
+HEAR username
+
LABEL auth_loop
-HEAR password
-IF password = "secret123" THEN
- TALK "Authentication successful."
+
+TALK "Enter your password:"
+HEAR password AS PASSWORD ' Masked input
+
+' Verify credentials
+user = FIND "users", "username='" + username + "'"
+
+IF user = NULL THEN
+ TALK "Username not found. Would you like to register? (yes/no)"
+ HEAR register_choice
+ IF register_choice = "yes" THEN
+ GOTO registration
+ ELSE
+ TALK "Goodbye!"
+ EXIT
+ END IF
+END IF
+
+IF user.password = HASH(password) THEN
+ SET BOT MEMORY "authenticated_user", username
+ SET BOT MEMORY "session_start", NOW()
+ TALK "Welcome back, " + user.name + "! You are now logged in."
+ EXIT
ELSE
SET attempts = attempts + 1
- IF attempts >= 3 THEN
- TALK "Too many attempts. Goodbye."
+ IF attempts >= max_attempts THEN
+ TALK "Too many failed attempts. Your account is temporarily locked."
+ SEND MAIL user.email, "Security Alert", "Multiple failed login attempts detected."
EXIT
- ENDIF
- TALK "Incorrect password. Try again."
+ END IF
+ TALK "Incorrect password. " + (max_attempts - attempts) + " attempts remaining."
GOTO auth_loop
-ENDIF
+END IF
+
+LABEL registration
+TALK "Let's create your account. Enter your email:"
+HEAR email
+TALK "Create a password (min 8 characters):"
+HEAR new_password AS PASSWORD
+
+IF LEN(new_password) < 8 THEN
+ TALK "Password too short. Please try again."
+ GOTO registration
+END IF
+
+INSERT "users", username, email, HASH(new_password), NOW()
+TALK "Account created! You can now log in."
```
-**Purpose**
+## Sample Dialogs
-- Shows how to collect a password with `HEAR`.
-- Limits the number of attempts to three.
-- Uses `TALK` to give feedback and `EXIT` to end the dialog after too many failures.
+These conversations show how the authentication template works in real-world scenarios.
-**Keywords used:** `SET`, `HEAR`, `IF`, `ELSE`, `GOTO`, `EXIT`, `TALK`.
+### Dialog 1: Successful Login
+
+
+
+
π
+
+
Auth Bot
+
online
+
+
+
+
Today
+
+
+
+
Auth Bot
+
Welcome! Please enter your username:
+
09:00
+
+
+
+
+
+
maria.santos
+
09:00
+
+
+
+
+
+
Enter your password:
+
09:00
+
+
+
+
+
+
β’β’β’β’β’β’β’β’
+
09:01
+
+
+
+
+
+
Welcome back, Maria! You are now logged in. β
+
09:01
+
+
+
+
+### Dialog 2: Failed Login with Retry
+
+
+
+
π
+
+
Auth Bot
+
online
+
+
+
+
+
+
Enter your password:
+
14:30
+
+
+
+
+
+
β’β’β’β’β’β’β’β’
+
14:30
+
+
+
+
+
+
Incorrect password. 2 attempts remaining. β οΈ
+
14:30
+
+
+
+
+
+
Enter your password:
+
14:30
+
+
+
+
+
+
β’β’β’β’β’β’β’β’
+
14:31
+
+
+
+
+
+
Welcome back, JoΓ£o! You are now logged in. β
+
14:31
+
+
+
+
+### Dialog 3: Account Locked
+
+
+
+
π
+
+
Auth Bot
+
online
+
+
+
+
+
+
Incorrect password. 1 attempt remaining. β οΈ
+
16:45
+
+
+
+
+
+
Enter your password:
+
16:45
+
+
+
+
+
+
β’β’β’β’β’β’β’β’
+
16:45
+
+
+
+
+
+
Too many failed attempts. Your account is temporarily locked. π
+
A security alert has been sent to your email.
+
16:45
+
+
+
+
Session ended
+
+
+### Dialog 4: New User Registration
+
+
+
+
π
+
+
Auth Bot
+
online
+
+
+
+
+
+
Username not found. Would you like to register? (yes/no)
+
10:15
+
+
+
+
+
+
yes
+
10:15
+
+
+
+
+
+
Let's create your account. Enter your email:
+
10:15
+
+
+
+
+
+
carlos@email.com
+
10:16
+
+
+
+
+
+
Create a password (min 8 characters):
+
10:16
+
+
+
+
+
+
β’β’β’β’β’β’β’β’β’β’
+
10:16
+
+
+
+
+
+
Account created! π You can now log in.
+
10:16
+
+
+
+
+## Keywords Used
+
+| Keyword | Purpose |
+|---------|---------|
+| `PARAM` | Define expected input parameters |
+| `SET` | Assign values to variables |
+| `TALK` | Send messages to the user |
+| `HEAR` | Capture user input |
+| `HEAR AS PASSWORD` | Masked password input |
+| `FIND` | Query database for user |
+| `IF/ELSE` | Conditional logic |
+| `GOTO/LABEL` | Flow control for retry loop |
+| `HASH` | Secure password hashing |
+| `SET BOT MEMORY` | Store session data |
+| `SEND MAIL` | Send security alerts |
+| `INSERT` | Create new user record |
+| `EXIT` | End the dialog |
+
+## How It Works
+
+1. **Username Input**: Collects the username first
+2. **User Lookup**: Checks if user exists in database
+3. **Password Verification**: Compares hashed password
+4. **Retry Logic**: Allows 3 attempts before lockout
+5. **Session Creation**: Stores auth state in bot memory
+6. **Registration**: Offers new account creation if user not found
+
+## Security Features
+
+### Password Hashing
+
+```basic
+' Never store plain text passwords!
+hashed = HASH(password)
+INSERT "users", username, email, hashed
+```
+
+### Rate Limiting
+
+```basic
+IF attempts >= max_attempts THEN
+ SET BOT MEMORY "locked_" + username, NOW()
+ TALK "Account locked for 15 minutes."
+END IF
+```
+
+### Two-Factor Authentication
+
+```basic
+' Send OTP after password verification
+otp = RANDOM(100000, 999999)
+SET BOT MEMORY "otp_" + username, otp
+SEND MAIL email, "Your verification code", "Code: " + otp
+
+TALK "Enter the 6-digit code sent to your email:"
+HEAR user_otp
+
+IF user_otp = GET BOT MEMORY "otp_" + username THEN
+ TALK "Two-factor authentication successful!"
+ELSE
+ TALK "Invalid code."
+END IF
+```
+
+## Customization Ideas
+
+### Add "Forgot Password"
+
+```basic
+TALK "Forgot your password? (yes/no)"
+HEAR forgot
+IF forgot = "yes" THEN
+ reset_token = RANDOM_STRING(32)
+ SET BOT MEMORY "reset_" + username, reset_token
+ SEND MAIL user.email, "Password Reset", "Click here: /reset/" + reset_token
+ TALK "Password reset link sent to your email."
+END IF
+```
+
+### Session Timeout
+
+```basic
+session_start = GET BOT MEMORY "session_start"
+IF DATEDIFF("minute", session_start, NOW()) > 30 THEN
+ TALK "Session expired. Please log in again."
+ SET BOT MEMORY "authenticated_user", ""
+END IF
+```
+
+### Social Login
+
+```basic
+TALK "Login with: 1) Password 2) Google 3) GitHub"
+HEAR login_method
+
+SWITCH login_method
+ CASE "2"
+ ' Redirect to OAuth
+ url = GET "auth/google/redirect"
+ TALK "Click to login: " + url
+ CASE "3"
+ url = GET "auth/github/redirect"
+ TALK "Click to login: " + url
+ DEFAULT
+ ' Standard password flow
+END SWITCH
+```
+
+## Related Templates
+
+- [start.bas](./start.md) - Basic greeting flow
+- [enrollment.bas](./enrollment.md) - Data collection patterns
---
+
+
\ No newline at end of file
diff --git a/docs/src/chapter-06-gbdialog/templates/enrollment.md b/docs/src/chapter-06-gbdialog/templates/enrollment.md
index 705ba8750..ceafc8eed 100644
--- a/docs/src/chapter-06-gbdialog/templates/enrollment.md
+++ b/docs/src/chapter-06-gbdialog/templates/enrollment.md
@@ -1,12 +1,21 @@
-# enrollment.bas (Template)
+# Enrollment Template
-A comprehensive enrollment dialog that gathers user information, confirms it, and saves it to a CSV file.
+The enrollment template demonstrates how to build a complete data collection workflow that gathers user information step-by-step, validates inputs, confirms details, and saves the data.
+
+## Topic: User Registration & Data Collection
+
+This template is perfect for:
+- Customer onboarding flows
+- Event registrations
+- Lead capture forms
+- Survey collection
+- Application submissions
+
+## The Code
```basic
REM Enrollment Tool Example
-## Complete Enrollment Script
-
PARAM name AS string LIKE "Abreu Silva"
DESCRIPTION "Required full name of the individual."
@@ -22,9 +31,9 @@ DESCRIPTION "Required Personal ID number of the individual (only numbers)."
PARAM address AS string LIKE "Rua das Flores, 123 - SP"
DESCRIPTION "Required full address of the individual."
-DESCRIPTION "This is the enrollment process, called when the user wants to enrol. Once all information is collected, confirm the details and inform them that their enrollment request has been successfully submitted. Provide a polite and professional tone throughout the interaction."
+DESCRIPTION "This is the enrollment process, called when the user wants to enrol."
-REM Enrollment Process
+REM Start enrollment
TALK "Welcome to the enrollment process! Let's get you registered."
TALK "First, what is your full name?"
@@ -54,21 +63,338 @@ TALK "Are these details correct? (yes/no)"
HEAR confirmation
IF confirmation = "yes" THEN
- REM Save to CSV file
SAVE "enrollments.csv", name, birthday, email, personalid, address
- TALK "Thank you! Your enrollment has been successfully submitted. You will receive a confirmation email shortly."
+ TALK "Thank you! Your enrollment has been successfully submitted."
ELSE
TALK "Let's start over with the correct information."
- REM In a real implementation, you might loop back or use a different approach
END IF
```
-**Purpose**
+## Sample Dialogs
-- Shows how to define parameters with `PARAM` and `DESCRIPTION`.
-- Demonstrates a multiβstep data collection flow using `HEAR` and `TALK`.
-- Confirms data before persisting it via `SAVE`.
+These conversations show how the enrollment template works in real-world scenarios.
-**Keywords used:** `PARAM`, `DESCRIPTION`, `HEAR`, `TALK`, `IF`, `ELSE`, `SAVE`.
+### Dialog 1: Successful Enrollment
+
+
+
+
π€
+
+
Registration Bot
+
online
+
+
+
+
Today
+
+
+
+
Hi, I want to register
+
10:30
+
+
+
+
+
+
Registration Bot
+
Welcome to the enrollment process! Let's get you registered. π
+
10:30
+
+
+
+
+
+
First, what is your full name?
+
10:30
+
+
+
+
+
+
Maria Santos Silva
+
10:31
+
+
+
+
+
+
Thank you. What is your birth date? (DD/MM/YYYY)
+
10:31
+
+
+
+
+
+
15/03/1990
+
10:31
+
+
+
+
+
+
What is your email address?
+
10:31
+
+
+
+
+
+
maria.santos@email.com
+
10:32
+
+
+
+
+
+
Please provide your Personal ID number (numbers only):
+
10:32
+
+
+
+
+
+
12345678901
+
10:32
+
+
+
+
+
+
Finally, what is your full address?
+
10:32
+
+
+
+
+
+
Rua das Palmeiras, 456 - SΓ£o Paulo, SP
+
10:33
+
+
+
+
+
+
Please confirm your details:
+
Name: Maria Santos Silva
+
Birth Date: 15/03/1990
+
Email: maria.santos@email.com
+
Personal ID: 12345678901
+
Address: Rua das Palmeiras, 456 - SΓ£o Paulo, SP
+
10:33
+
+
+
+
+
+
Are these details correct? (yes/no)
+
10:33
+
+
+
+
+
+
yes
+
10:33
+
+
+
+
+
+
Thank you! Your enrollment has been successfully submitted. β
+
You will receive a confirmation email shortly.
+
10:33
+
+
+
+
+### Dialog 2: User Corrects Information
+
+
+
+
π€
+
+
Registration Bot
+
online
+
+
+
+
+
+
Please confirm your details:
+
Name: JoΓ£o Pedro
+
Birth Date: 20/05/1985
+
Email: joao@email.com
+
Personal ID: 98765432100
+
Address: Av. Brasil, 100 - RJ
+
14:22
+
+
+
+
+
+
Are these details correct? (yes/no)
+
14:22
+
+
+
+
+
+
no
+
14:23
+
+
+
+
+
+
Let's start over with the correct information.
+
14:23
+
+
+
+
+
+
First, what is your full name?
+
14:23
+
+
+
+
+
+
JoΓ£o Pedro Oliveira
+
14:24
+
+
+
+
User continues with corrected information...
+
+
+### Dialog 3: LLM-Assisted Natural Input
+
+When using the LLM, users can provide information naturally:
+
+
+
+
π€
+
+
Smart Registration
+
online
+
+
+
+
+
+
I'd like to sign up. My name is Carlos Ferreira, born on March 5th 1992, email carlos.f@gmail.com, ID 11122233344, and I live at Rua do Sol, 789 in BrasΓlia
+
16:45
+
+
+
+
+
+
Smart Registration
+
I've captured your information! Let me confirm:
+
Name: Carlos Ferreira
+
Birth Date: 05/03/1992
+
Email: carlos.f@gmail.com
+
Personal ID: 11122233344
+
Address: Rua do Sol, 789 - BrasΓlia
+
16:45
+
+
+
+
+
+
Is everything correct? π
+
16:45
+
+
+
+
+
+
Perfect! Yes
+
16:46
+
+
+
+
+
+
β Registration complete! Welcome aboard, Carlos!
+
16:46
+
+
+
+
+## Keywords Used
+
+| Keyword | Purpose |
+|---------|---------|
+| `PARAM` | Define expected input parameters with types and examples |
+| `DESCRIPTION` | Provide context for LLM understanding |
+| `TALK` | Send messages to the user |
+| `HEAR` | Wait for and capture user input |
+| `IF/ELSE` | Conditional logic for confirmation |
+| `SAVE` | Persist data to CSV file |
+
+## How It Works
+
+1. **Parameter Definition**: The `PARAM` declarations tell the LLM what information to collect
+2. **Step-by-Step Collection**: Each `HEAR` captures one piece of data
+3. **Confirmation Loop**: User reviews all data before submission
+4. **Data Persistence**: `SAVE` stores the validated data
+
+## Customization Ideas
+
+### Add Validation
+
+```basic
+HEAR email
+IF NOT INSTR(email, "@") THEN
+ TALK "Please enter a valid email address"
+ HEAR email
+END IF
+```
+
+### Add to Database Instead of CSV
+
+```basic
+INSERT "users", name, birthday, email, personalid, address
+```
+
+### Send Confirmation Email
+
+```basic
+SEND MAIL email, "Welcome!", "Your registration is complete, " + name
+```
+
+## Related Templates
+
+- [start.bas](./start.md) - Basic greeting flow
+- [auth.bas](./auth.md) - Authentication patterns
---
+
+
\ No newline at end of file
diff --git a/docs/src/chapter-06-gbdialog/templates/start.md b/docs/src/chapter-06-gbdialog/templates/start.md
index c1522da7b..ede9e5369 100644
--- a/docs/src/chapter-06-gbdialog/templates/start.md
+++ b/docs/src/chapter-06-gbdialog/templates/start.md
@@ -1,25 +1,274 @@
-# start.bas (Template)
+# Start Template
-A minimal greeting and help flow to get users started.
+The start template is the simplest possible bot - a greeting flow that demonstrates the core interaction pattern of BASIC: greeting users and responding to their input.
+
+## Topic: Basic Greeting & Help Flow
+
+This template is perfect for:
+- Learning BASIC fundamentals
+- Simple FAQ bots
+- Quick demos
+- Starting point for more complex bots
+
+## The Code
```basic
REM Basic greeting and help flow
SET user_name = "Guest"
+
TALK "Hello, " + user_name + "! How can I help you today?"
HEAR user_input
+
IF user_input = "help" THEN
TALK "Sure, I can assist with account info, orders, or support."
ELSE
- TALK "Sorry, I didn't understand."
-ENDIF
+ TALK "Sorry, I didn't understand. Type 'help' for options."
+END IF
```
-**Purpose**
+## Sample Dialogs
-- Shows how to set a variable with `SET`.
-- Uses `TALK` to send a message and `HEAR` to receive user input.
-- Demonstrates simple branching with `IF/ELSE`.
+These conversations show how the start template works in real-world scenarios.
-**Keywords used:** `SET`, `TALK`, `HEAR`, `IF`, `ELSE`.
+### Dialog 1: User Asks for Help
+
+
+
+
π€
+
+
Helper Bot
+
online
+
+
+
+
Today
+
+
+
+
Helper Bot
+
Hello, Guest! How can I help you today? π
+
09:15
+
+
+
+
+
+
help
+
09:15
+
+
+
+
+
+
Sure, I can assist with account info, orders, or support. π
+
09:15
+
+
+
+
+### Dialog 2: Unknown Input
+
+
+
+
π€
+
+
Helper Bot
+
online
+
+
+
+
+
+
Helper Bot
+
Hello, Guest! How can I help you today? π
+
11:30
+
+
+
+
+
+
what's the weather?
+
11:30
+
+
+
+
+
+
Sorry, I didn't understand. Type 'help' for options.
+
11:30
+
+
+
+
+
+
help
+
11:31
+
+
+
+
+
+
Sure, I can assist with account info, orders, or support. π
+
11:31
+
+
+
+
+### Dialog 3: Personalized Greeting (Enhanced Version)
+
+When you add user detection, the experience improves:
+
+
+
+
π€
+
+
Smart Helper
+
online
+
+
+
+
+
+
Smart Helper
+
Hello, Maria! π How can I help you today?
+
14:20
+
+
+
+
+
+
I need help with my order
+
14:20
+
+
+
+
+
+
Of course, Maria! I found your recent order #12345.