Skip to main content

Crate roboticus_db

Crate roboticus_db 

Source
Expand description

§roboticus-db

SQLite persistence layer for the Roboticus agent runtime. All state – sessions, memories, tool calls, policy decisions, cron jobs, embeddings, skills, and semantic cache – lives in a single SQLite database with WAL mode enabled.

§Key Types

  • Database – Thread-safe handle wrapping Arc<Mutex<Connection>>

§Modules

  • schema – Table definitions, initialize_db(), migration runner
  • sessions – Session CRUD, message append/list, turn persistence
  • memory – 5-tier memory CRUD (working, episodic, semantic, procedural, relationship) + FTS5
  • embeddings – BLOB embedding storage / lookup with JSON fallback
  • ann – HNSW approximate nearest-neighbor index (instant-distance)
  • hippocampus – Long-term memory consolidation and decay
  • learned_skills – Learned skill CRUD, reinforcement (success/failure), priority
  • checkpoint – Session checkpoint / restore via context_snapshots table
  • efficiency – Efficiency metrics tracking and queries
  • agents – Sub-agent registry and enabled-agent CRUD
  • backend – Storage backend abstraction trait
  • cache – Semantic cache persistence (loaded on boot, flushed every 5 min)
  • cron – Cron job state, lease acquisition, run history
  • skills – Skill definition CRUD and trigger lookup
  • tools – Tool call records
  • policy – Policy decision records
  • metrics – Inference cost tracking, proxy snapshots, transactions, turn feedback
  • routing_dataset – Historical routing decision + cost outcome JOIN for ML training
  • shadow_routing – Counterfactual ML predictions stored alongside production decisions
  • revenue_introspection – Unified introspection surface: strategy health, profitability, audit trail

Modules§

abuse
agents
ann
approvals
backend
cache
checkpoint
cron
delegation
Delegation outcome persistence — structured records of subagent delegation results for analytics and future intelligent agent scoring.
delivery_queue
efficiency
embeddings
hippocampus
hygiene_log
Audit log for retrieval-hygiene sweeps.
learned_skills
CRUD operations for the learned_skills table.
memory
metrics
model_selection
policy
revenue_accounting
revenue_feedback
revenue_introspection
Revenue Introspection
revenue_opportunity_queries
revenue_scoring
revenue_strategy_summary
revenue_swap_tasks
revenue_tax_tasks
routing_dataset
Historical routing dataset extraction pipeline.
schema
service_revenue
sessions
shadow_routing
Shadow routing predictions — counterfactual ML recommendations stored alongside production decisions for offline validation.
skills
tasks
tools
traces
Pipeline trace and heartbeat task result persistence.
typestate
Typestate pattern for session lifecycle.

Structs§

Database

Traits§

DbResultExt
Extension trait for converting any Display error into RoboticusError::Database.

Functions§

params_from_iter
Constructor function for a ParamsFromIter. See its documentation for more.