Expand description
§Briefcase AI Core Library
High-performance AI observability, replay, and decision tracking for Rust applications.
§Features
- AI Decision Tracking: Capture inputs, outputs, and context for every AI decision
- Deterministic Replay: Reproduce AI decisions exactly with full context preservation
- Comprehensive Observability: Monitor model performance, drift, and behavior
- Enterprise Security: Built-in data sanitization and privacy controls
- Flexible Storage: SQLite, cloud storage, and custom backends
- Cost Management: Track and optimize AI model usage costs
- Cross-Platform: Works on Linux, macOS, Windows, and WebAssembly
§Quick Start
use briefcase_core::*;
use briefcase_core::storage::StorageBackend;
use serde_json::json;
// Create a decision snapshot
let decision = DecisionSnapshot::new("ai_function")
.add_input(Input::new("user_query", json!("Hello world"), "string"))
.add_output(Output::new("response", json!("Hello back!"), "string").with_confidence(0.95))
.with_execution_time(120.5);
// Save to storage (requires storage feature)
#[cfg(feature = "sqlite-storage")]
{
let storage = storage::SqliteBackend::in_memory()?;
let decision_id = storage.save_decision(&decision).await?;
println!("Saved decision: {}", decision_id);
}§Feature Flags
recording- Baseline decision capture pipeline (enabled by default)async- Enable async/await runtime support (enabled by default)storage- Enable persistent storage APIs (enabled by default)sqlite-storage- SQLite storage backend (implied bystorage)vcs-storage- Version-control storage abstractionsreplay- Deterministic replay enginedrift- Drift monitoring utilitiessanitize- Built-in PII sanitizationotel- OpenTelemetry instrumentation helperstokens- Token counting utilitiesnetworking- HTTP client support for remote servicescompression- Compression helpers for storage backends
Re-exports§
pub use models::*;
Modules§
- control
- Control plane trait and implementations for client lookup
- models
- Core data models and structures
- storage
- Storage backends for persisting decisions and snapshots
Enums§
Constants§
- DEFAULT_
API_ URL - The default base URL for the Briefcase AI API.