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

Chapter 07: Extending General Bots

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.

Chapter Contents

See Also