BB AI SDK:
0.1.9 (pin when installing from Artifactory — see Installation). Starter repo version: see the repository badge / pyproject.toml (independent of the SDK).GitHub repository
View source code, releases, and issues
Prerequisites
- Python 3.11+: Managed via UV (see
pyproject.toml) - UV Package Manager: Modern Python package manager (replaces pip/poetry)
Quick start
1. Clone and install UV
2. Set up environment
3. Configure credentials
Update.env with Artifactory credentials (when resolving bb-ai-sdk from the Backbase index), AI Gateway keys, and observability. Observability vars are read by bb-ai-sdk, not src/config/config.py.
4. Install dependencies and run
Team modes
The starter demonstrates three core multi-agent patterns:Delegation mode
Content Team: Team leader delegates specific tasks sequentially (Researcher → Writer → Reviewer).
Endpoint:
/run/content_teamCollaboration mode
Collaboration Team: Agents (Researcher and Writer) work together, sharing context to solve a problem.
Endpoint:
/run/collaboration_teamCoordination mode
Coordinator Team: Team leader orchestrates workflow and uses tools directly for coordination.
Endpoint:
/run/coordinator_teamAPI usage
Project structure
Observability
Installbb-ai-sdk[guardrails,instrument-fastapi,instrument-agno]==0.1.9 from Artifactory (see pyproject.toml). In src/api/app.py:
run_team() uses await team.arun(...) (not sync run) and scope(agent_name=..., trace_name=..., trace_input=...) so you get one trace per HTTP request. Optional header X-Observability-Project sets bb.project on spans.
| Concern | Where |
|---|---|
| TracerProvider, OTLP/Langfuse, FastAPI + Agno + HTTPX + threading | configure_observability(...) in app.py |
| Service identity | service_name="starter-multi-agent" → Resource service.name |
bb.project | Header X-Observability-Project (middleware) |
bb.agent.name, bb.trace.name, bb.trace.input | scope(agent_name=..., trace_name=..., trace_input=...) in run_team() |
| Model errors → HTTP status | src/api/openai_http_errors.py (application policy) |
| NeMo guardrails per team | init_guardrails(...) in the FastAPI lifespan handler |
src/observability.py — setup lives in the SDK plus the calls above.
Full key list and constants: BB AI SDK — Backbase attribute keys.
Backends: Export paths — Langfuse via LANGFUSE_*, Grafana via init(backend="grafana", otlp_endpoint=...) then configure_observability(..., init_observability=False), or custom OTLP via OTEL_EXPORTER_OTLP_ENDPOINT (or OTLP_ENDPOINT) plus OTEL_RESOURCE_ATTRIBUTES=project=<your-project-identifier> when your operations team requires it. Evals call the same service_name from init_observability() in evals/__init__.py (no fastapi_app).
Logging and redaction
src/logger.py uses STANDARD_FORMAT, DEFAULT_DATEFMT, and LOG_LEVEL from app settings. After basicConfig, it calls bb_ai_sdk.logging.init(capture_warnings=True) so API keys and tokens are redacted in logs and share the same patterns as span attributes. Log lines include [trace_id=… span_id=…] for correlation with traces. Optional: BB_AI_SDK_REDACTION_PATTERNS* in .env.
Development
Run tests
CI/CD
Standard workflows are pre-configured in.github/workflows:
- PR Checks: Linting, testing, and validation.
- Build and Publish: Docker image creation on merge.
- Release: Automated versioning and release notes.
See CI/CD workflows for pipeline details.
Next steps
- Create Your First Agent: Deploy to a runtime
- MCP Agent: Integrate with MCP servers
- Knowledge Agent: Add RAG capabilities