Storage and Data π‘ BETA
Botserver separates structured data, object storage, cache and vectors into four stores, each owned by a distinct crate or service.
Understanding the Storage Architecture
| Store | Owner | Holds |
|---|---|---|
| PostgreSQL | Diesel + botschema |
Bots, sessions, associations, episodes, CRM and task rows |
| Drive (OtterIO) | botdrive |
.gbai buckets: .gbkb, .gbdrive, .gbot, .gbdialog |
| Valkey | cache feature / botbasic_comms |
Session and cache keys |
| Qdrant | botqdrant |
Tenant-scoped vector collections |
| Work directory | Drive monitor | Materialised bot files and compiled .ast caches |
PostgreSQL: Structured Data Storage
table! and joinable! macros live in botschema; feature crates re-export them. Schema changes require a migration, diesel print-schema, and a botschema update.
Drive: Object Storage for Files
The bucket hierarchy is {org}.gborg β {workspace}.gbai β {bot}.g* prefixes. For git-owned bots, .gbdialog and .gbot are materialised from the bot's repository; .gbkb and .gbdrive remain Drive-owned content. See Drive Monitor.
Valkey: High-Speed Caching
The cache feature backs session initialisation flags and other short-lived keys. LLM answer caching is configured per bot with llm-cache*; see Caching.
Qdrant: Vector Storage for Semantic Search
Collections are named through KbTenantScope and queried with a server-resolved bot filter. Every point is rechecked for a trusted payload stamp and current ACL. See Vector Collections.
Local Storage: Working Directories
The Drive monitor writes materialised bot folders into the work directory; compiled .ast files are build artifacts, never sources.
Security and Access Control
Credentials for all stores come from Vault, not from committed files. Retrieval and file access are scoped by bot and branch.
Limits
- No store may be substituted for another: scripts are not stored in Qdrant and vectors are not stored in Drive.
- Work-directory files are artifacts; edits there do not change the bot's source of truth.
- Component versions come from
botserver/3rdparty.toml, not from prose.
Related
- Chapter overview - Index of this chapter.
See Also
- Module Structure - Crate ownership
- Knowledge Base - Vector tenants
- Configuration - Deployment settings