Chapter 2: Architecture & Packages 🟑 BETA

Architecture and deployment reference for developers.

Overview

botserver is built in Rust with a modular architecture. Extend it by creating custom keywords, services, or entire applications.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Web Server (Axum)          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚         BASIC Runtime (Rhai)            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   LLM    β”‚ Storage  β”‚  Vector  β”‚ Cache  β”‚
β”‚ Service  β”‚ (MinIO)  β”‚ (Qdrant) β”‚(Valkey)β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚            PostgreSQL                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Deployment Options

MethodUse CaseGuide
LocalDevelopmentInstallation
DockerProductionDocker Deployment
LXCIsolated componentsContainer Deployment

Module Structure

ModulePurpose
web_serverHTTP/WebSocket handling
basicBASIC language runtime
llmLLM provider integration
driveObject storage
sharedDatabase models

Creating Custom Keywords

#![allow(unused)]
fn main() {
// In src/basic/keywords/my_keyword.rs
pub fn my_keyword(context: &mut EvalContext) -> Result<Dynamic, Box<EvalError>> {
    // Your keyword logic
    Ok(Dynamic::from("result"))
}
}

Register in keywords/mod.rs and rebuild.

Autonomous Task AI

General Bots enables autonomous task execution where the machine does the work:

Human describes intent β†’ AI plans β†’ AI generates β†’ AI deploys β†’ AI monitors

Key concepts:

  • Intent Compilation - LLM translates natural language to execution plans
  • CREATE SITE - Generates HTMX apps bound to botserver API
  • .gbdrive - Cloud-synced workspace for all task files
  • Autonomous Execution - System runs plans with approval gates

See Autonomous Task AI for complete documentation.

Chapter Contents

See Also