botserver/docs/src/chapter-07-gbapp
2025-12-01 02:22:35 -03:00
..
assets - SVG UI. 2025-12-01 02:22:35 -03:00
architecture.md - SVG UI. 2025-12-01 02:22:35 -03:00
building.md - 7 docs revised. 2025-11-24 08:42:58 -03:00
containers.md - SVG UI. 2025-12-01 02:22:35 -03:00
crates.md - SVG UI. 2025-12-01 02:22:35 -03:00
custom-keywords.md - From 4 to 7. 2025-11-23 20:12:09 -03:00
dependencies.md - SVG UI. 2025-12-01 02:22:35 -03:00
docker-deployment.md - SVG UI. 2025-12-01 02:22:35 -03:00
example-gbapp.md - 7 docs revised. 2025-11-24 08:42:58 -03:00
infrastructure.md - SVG UI. 2025-12-01 02:22:35 -03:00
keyword-refactoring.md Looking at this diff, I can see it's a comprehensive documentation 2025-11-30 10:53:59 -03:00
observability.md - SVG UI. 2025-12-01 02:22:35 -03:00
philosophy.md - SVG UI. 2025-12-01 02:22:35 -03:00
README.md - SVG UI. 2025-12-01 02:22:35 -03:00
scaling.md ``` Add KB Statistics keywords and infrastructure documentation 2025-11-30 16:25:51 -03:00
services.md - SVG UI. 2025-12-01 02:22:35 -03:00

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

Method Use Case Guide
Local Development Installation
Docker Production Docker Deployment
LXC Isolated components Container Deployment

Module Structure

Module Purpose
web_server HTTP/WebSocket handling
basic BASIC language runtime
llm LLM provider integration
drive Object storage
shared Database models

Creating Custom Keywords

// 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