Prerequisites
Installation guide
Configure your project to pull from Backbase Artifactory and install bb-ai-sdk 0.1.9.
Quick setup
1. Configure environment variables
Create a.env file with your credentials:
.env
2. Create your first agent
Createagent.py with AI Gateway and Observability:
agent.py
3. Run your agent
If you see a response, you’ve successfully connected to the AI Gateway! Check your Langfuse dashboard to see the trace.
What happens next?
When you callconfigure_observability() before creating the gateway, LLM calls through AsyncAIGateway are automatically traced with OpenInference semantics. This integration gives you:
- AI Gateway: Routes your LLM calls through the Backbase AI Platform with automatic authentication, agent ID validation, and policy enforcement
- Automatic tracing: Gateway calls appear in Langfuse with tokens, latency, cost, and request/response context when export credentials are set
- Minimal setup: Call
configure_observability()at startup before gateway instances
The sync
AIGateway client does not attach OpenAIInstrumentor automatically in the SDK today. For sync scripts, attach OpenAIInstrumentor manually—see Gateway-only script—or use AsyncAIGateway as in the example above.Customize your setup
- AI Gateway: Configure streaming, tools, framework adapters, error handling, and advanced client options
- Observability: Add custom tracing, export to Langfuse, Grafana, or an OTLP endpoint, and tune export settings
Next steps
AI gateway
Learn about streaming, tools, and framework adapters
Observability
Explore custom tracing and advanced configuration
Starter kits
See SDK integrated in production templates
Examples
View complete working examples