Skip to main content

What is the BB AI SDK?

The 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-independent: Native support for LangChain, LangGraph, and Agno
  • Zero Vendor Lock-in: Uses standard APIs - your code is fully portable

Core modules

AI gateway

Access AI models through a unified OpenAI-compatible interface

Observability

Trace and monitor your agents with OpenTelemetry and LangFuse

Framework adapters

Integrate with LangChain, LangGraph, and Agno

Why the 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

Get started

Install the SDK and build your first agent

AI gateway

Learn about model access and authentication

Observability

Set up tracing and monitoring

Examples

View complete working examples