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 AIGatewayfrom bb_ai_sdk.observability import init# Initialize observabilityinit(agent_name="customer-support")# Create AI gateway clientgateway = AIGateway.create( model_id="gpt-4o", agent_id="550e8400-e29b-41d4-a716-446655440000")# Use standard OpenAI interfaceresponse = gateway.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}])
from bb_ai_sdk.ai_gateway import AIGatewaygateway = 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)
from bb_ai_sdk.ai_gateway import AIGatewayfrom bb_ai_sdk.ai_gateway.adapters.langchain import to_langchaingateway = AIGateway.create( model_id="gpt-4o", agent_id="550e8400-e29b-41d4-a716-446655440000")# Convert to LangChain modelmodel = to_langchain(gateway)# Use with LangChain componentsfrom langchain.schema.output_parser import StrOutputParserchain = model | StrOutputParser()response = chain.invoke("Tell me a joke")print(response)