generalbots/docs/src/chapter-02/gbot.md
Rodrigo Rodriguez (Pragmatismo) 892d20440e Add comprehensive documentation for GeneralBots, including keyword references, templates, and user guides
- Created detailed markdown files for keywords such as HEAR, TALK, and SET_USER.
- Added examples and usage notes for each keyword to enhance user understanding.
- Developed templates for common tasks like enrollment and authentication.
- Structured documentation into chapters covering various aspects of the GeneralBots platform, including gbapp, gbkb, and gbtheme.
- Introduced a glossary for key terms and concepts related to GeneralBots.
- Implemented a user-friendly table of contents for easy navigation.
2025-10-25 14:50:14 -03:00

2 KiB

.gbot Bot Configuration

The .gbot package contains configuration files that define bot behavior, parameters, and operational settings.

What is .gbot?

.gbot files configure:

  • Bot identity and description
  • LLM provider settings
  • Answer modes and behavior
  • Context management
  • Integration parameters

Configuration Structure

The primary configuration file is config.csv:

key,value
bot_name,Customer Support Assistant
bot_description,AI-powered support agent
answer_mode,1
llm_provider,openai
llm_model,gpt-4
temperature,0.7
max_tokens,1000
system_prompt,You are a helpful customer support agent...

Key Configuration Parameters

Bot Identity

  • bot_name: Display name for the bot
  • bot_description: Purpose and capabilities
  • version: Bot version for tracking

LLM Configuration

  • llm_provider: openai, azure, local
  • llm_model: Model name (gpt-4, claude-3, etc.)
  • temperature: Creativity control (0.0-1.0)
  • max_tokens: Response length limit

Answer Modes

  • 0: Direct LLM responses only
  • 1: LLM with tool calling
  • 2: Knowledge base documents only
  • 3: Include web search results
  • 4: Mixed mode with tools and KB

Context Management

  • context_window: Number of messages to retain
  • context_provider: How context is managed
  • memory_enabled: Whether to use bot memory

Configuration Loading

The system loads configuration from:

  1. config.csv in the .gbot package
  2. Environment variables (override)
  3. Database settings (persistent)
  4. Runtime API calls (temporary)

Configuration Precedence

Settings are applied in this order (later overrides earlier):

  1. Default values
  2. .gbot/config.csv
  3. Environment variables
  4. Database configuration
  5. Runtime API updates

Dynamic Configuration

Some settings can be changed at runtime:

REM Change answer mode dynamically
SET_BOT_MEMORY "answer_mode", "2"

Bot Memory

The SET_BOT_MEMORY and GET_BOT_MEMORY keywords allow storing and retrieving bot-specific data that persists across sessions.