Skip to main content

Crate briefcase_core

Crate briefcase_core 

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

  • async - Enable async/await support (enabled by default)
  • sqlite-storage - Enable SQLite storage backend (enabled by default)
  • lakefs-storage - Enable LakeFS storage backend (enabled by default)
  • networking - Enable HTTP client for remote storage (enabled by default)
  • compression - Enable data compression (enabled by default)
  • parallel - Enable parallel processing with Rayon
  • sync-only - Sync-only APIs for WebAssembly compatibility

Re-exports§

pub use cost::*;
pub use drift::*;
pub use models::*;
pub use replay::*;
pub use sanitization::*;

Modules§

cost
Cost calculation and management functionality
drift
Drift detection and model performance monitoring
models
Core data models and structures Core data models for AI decision tracking and observability
replay
Decision replay and validation
sanitization
Data sanitization and privacy controls
storage
Storage backends for persisting decisions and snapshots

Enums§

BriefcaseError