Skip to main content

Quick Start Guide

This guide walks you through the core features of Briefcase SDK.

1. lakeFS Versioning​

Automatically capture commit SHAs when accessing versioned knowledge bases:

from briefcase.integrations.lakefs import versioned_context

# Automatic versioning
with versioned_context(client, "acme-healthcare", "main") as lakefs:
policy = lakefs.read_object("policies/policy.pdf")
guidelines = lakefs.read_object("guidelines/cms_coverage.json")
# Both reads automatically tracked with commit SHA

Decorator​

from briefcase.integrations.lakefs import versioned

@versioned(repository="acme-healthcare")
def evaluate_claim(claim_data, versioned_client):
policy = versioned_client.read_object("policies/policy.pdf")
return process(claim_data, policy)

# Call normally - versioned_client is injected
result = evaluate_claim(claim_data, briefcase_client=client)

What's captured:

  • lakefs.commit.sha - Exact commit SHA
  • lakefs.file.path - File paths accessed
  • lakefs.artifact.{path} - Per-file commit SHAs

2. Multi-Agent Correlation​

Automatically correlate traces across multi-agent workflows:

from briefcase.correlation import briefcase_workflow

# All agents automatically correlated
with briefcase_workflow("prior_authorization", client) as workflow:
# Agent 1: Intake
intake_result = intake_agent.process(claim)

# Agent 2: Clinical Review - automatically linked!
clinical_result = clinical_agent.process(intake_result)

# Agent 3: Decision - automatically linked!
decision = decision_agent.process(clinical_result)

# Dashboard shows: Intake → Clinical → Decision

Features:

  • Automatic trace context propagation
  • Agent chain visualization
  • Cross-service correlation via HTTP headers
  • <5ms overhead per agent

3. Compliance Reporting​

Generate compliance reports:

from briefcase.compliance.reports import SOC2ReportGenerator
from datetime import datetime, timedelta

generator = SOC2ReportGenerator(briefcase_client=client)

report = generator.evaluate(
engagement_id="acme-healthcare",
workstream_id="main",
start_date=datetime.now() - timedelta(days=90),
end_date=datetime.now()
)

# View results
print(f"Status: {report.overall_status.value}")
print(f"Score: {report.overall_score:.1f}%")
print(f"Controls: {report.controls_passed}/{report.total_controls_evaluated}")

# Export
markdown = report.to_markdown()
json_data = report.to_json()

4. RAG Versioning​

Version RAG components:

from briefcase.rag import VersionedEmbeddingPipeline, Document

# Create versioned embeddings
pipeline = VersionedEmbeddingPipeline(
versioned_client=lakefs,
embedding_model=model,
repository="acme-kb"
)

documents = [
Document(id="doc1", content="...", metadata={}, path="docs/doc1.md")
]

batch = pipeline.create_embedding_batch(documents)
print(f"Batch {batch.batch_id} with commit {batch.source_commit}")

5. External Data Tracking​

Track external API calls and database queries:

from briefcase.external_data import ExternalDataTracker

tracker = ExternalDataTracker(versioned_client=lakefs, repository="external-data")

# Track API call with snapshot
tracking_info = tracker.track_api_call(
api_name="ofac_sdn_list",
endpoint="https://api.ofac.gov/sanctions",
method="GET",
response_data={"sanctions": ["entity1", "entity2"]},
store_snapshot=True
)

print(f"Snapshot: {tracking_info['snapshot_id']}")
print(f"Hash: {tracking_info['data_hash']}")

6. Prompt-Knowledge Validation​

Validate that AI outputs are grounded in source knowledge:

from briefcase.validation import PromptValidationEngine

engine = PromptValidationEngine(
versioned_client=lakefs,
repository="acme-healthcare",
mode="tolerant"
)

result = engine.validate(
prompt="What is the coverage policy for MRI? Per policy DOC-2024-v3, section 4.2..."
)

print(f"Valid: {result.is_valid}")
print(f"Errors: {result.errors}")
print(f"Warnings: {result.warnings}")

Configuration​

Set up environment variables:

# lakeFS — Python SDK (VersionedClient, ArtifactLineageClient)
export LAKEFS_ENDPOINT="https://briefcasebrain.us-east-1.lakefscloud.io/api/v1"
export LAKEFS_ACCESS_KEY="your_access_key"
export LAKEFS_SECRET_KEY="your_secret_key"

# lakeFS — Rust SDK (LakeFSBackend / briefcase-core)
# Note: BRIEFCASE_LAKEFS_ENDPOINT must NOT include the /api/v1 suffix — the client appends it.
export BRIEFCASE_LAKEFS_ENDPOINT="https://briefcasebrain.us-east-1.lakefscloud.io"
export BRIEFCASE_LAKEFS_ACCESS_KEY="your_access_key"
export BRIEFCASE_LAKEFS_SECRET_KEY="your_secret_key"
export BRIEFCASE_LAKEFS_REPOSITORY="my-repo"
export BRIEFCASE_LAKEFS_BRANCH="main"

# OpenTelemetry
export OTEL_SERVICE_NAME="my-ai-service"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"

Next Steps​

Explore detailed feature documentation: