Skip to main content

What is BB AI SDK?

BB AI SDK is a Python package published on Backbase Artifactory (repo.backbase.com) that connects your agentic applications to platform services (AI Gateway, Observability) with minimal code. It enables you to build production-ready AI agents with enterprise-grade features while maintaining complete framework flexibility.
The SDK acts as a bridge between any agentic framework (Agno, LangChain, LangGraph, or custom) and Backbase platform services, requiring just a few lines of code to get started.
from bb_ai_sdk.ai_gateway import AIGateway
from bb_ai_sdk.observability import init

# Initialize observability
init(agent_name="customer-support")

# Create AI Gateway client
gateway = AIGateway.create(
    model_id="gpt-4o",
    agent_id="550e8400-e29b-41d4-a716-446655440000"
)

# Use standard OpenAI interface
response = gateway.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

Key Features

  • OpenAI-Compatible: Works with any framework that supports OpenAI SDK
  • Automatic Authentication: Handles API keys and agent ID validation
  • Built-in Observability: Automatic tracing with LangFuse via OpenTelemetry
  • Framework Agnostic: Native support for LangChain, LangGraph, and Agno
  • Zero Vendor Lock-in: Uses standard APIs—your code is fully portable

Core Modules

Why BB AI SDK?

Framework Flexibility

Use your preferred Agentic AI framework:
  • LangChain: Full support with adapters
  • LangGraph: Native async integration
  • Agno: Direct client compatibility
  • Custom: OpenAI SDK interface works anywhere

Enterprise Features

Production-ready capabilities built-in:
  • 🔐 Multi model AI Gateway with content safety filters and policies
  • 📊 Observability with LangFuse via OpenTelemetry
  • 🏢 Multi-tenant context tracking
  • 💰 Cost tracking per organization
  • 🔍 Distributed tracing across services

Zero Vendor Lock-in

Your code remains portable and future-proof:
  • Uses standard OpenAI SDK interface
  • OpenTelemetry for observability (switch backends anytime)
  • Framework-native objects—no custom abstractions
  • Works with or without the platform

Quick Examples

from bb_ai_sdk.ai_gateway import AIGateway

gateway = AIGateway.create(
    model_id="gpt-4o",
    agent_id="550e8400-e29b-41d4-a716-446655440000"
)

response = gateway.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "What is AI?"}
    ]
)

print(response.choices[0].message.content)

Next Steps