botserver/docs/src/chapter-02/README.md

78 lines
2 KiB
Markdown
Raw Normal View History

2025-11-24 14:15:01 -03:00
# Chapter 02: About Packages
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
How bots are organized in General Bots.
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
## What You'll Learn
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
- Package structure (`.gbai` folders)
- Dialog scripts in BASIC
- Knowledge bases
- Configuration basics
- How packages load
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
## Package Structure
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
A bot is just a folder ending in `.gbai`:
2025-11-21 10:44:29 -03:00
2025-11-24 09:49:25 -03:00
```
2025-11-24 14:15:01 -03:00
my-bot.gbai/
├── my-bot.gbdialog/ # BASIC scripts
├── my-bot.gbkb/ # Documents
├── my-bot.gbot/ # Configuration
├── my-bot.gbtheme/ # Optional styling
└── my-bot.gbdrive/ # Optional storage
2025-11-24 09:49:25 -03:00
```
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
Drop the folder in `templates/`, it loads automatically.
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
## Key Concepts
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
### Dialogs (.gbdialog)
- BASIC scripts that control conversation
- `start.bas` is optional (but needed to activate tools/KB with USE TOOL/USE KB)
2025-11-24 14:15:01 -03:00
- Simple commands like TALK and HEAR
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
### Knowledge Base (.gbkb)
- Put PDFs and documents in folders
- Automatically becomes searchable
- Bot can answer questions from documents
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
### Configuration (.gbot)
- Single `config.csv` file
- Simple name,value pairs
- Missing values use defaults
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
### Themes (.gbtheme)
- Optional CSS styling
- Most bots don't need this
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
### Storage (.gbdrive)
- Links to S3-compatible storage
- For large files and uploads
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
## How It Works
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
1. **Discovery**: Finds `.gbai` folders
2. **Loading**: Reads all components
3. **Indexing**: Processes documents
4. **Activation**: Bot is ready
2025-11-21 10:44:29 -03:00
2025-11-24 14:15:01 -03:00
No build process. No compilation. Just folders and files.
2025-11-23 20:12:09 -03:00
2025-11-29 17:27:13 -03:00
The web UI uses **HTMX with server-side rendering** - minimal JavaScript, no build process, just HTML templates powered by Rust.
2025-11-24 14:15:01 -03:00
## Topics Covered
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
- [.gbai Architecture](./gbai.md) - Package details
- [.gbdialog Dialogs](./gbdialog.md) - BASIC scripting
- [.gbkb Knowledge Base](./gbkb.md) - Document management
- [.gbot Configuration](./gbot.md) - Settings
- [.gbtheme UI Theming](./gbtheme.md) - Styling
- [.gbdrive File Storage](./gbdrive.md) - Storage integration
- [Bot Templates](./templates.md) - Example bots
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
---
2025-11-24 09:49:25 -03:00
2025-11-24 14:15:01 -03:00
<div align="center">
<img src="https://pragmatismo.com.br/icons/general-bots-text.svg" alt="General Bots" width="200">
</div>