Skip to main content

Adding Python Dependencies

Add Python packages using uv from your agent/ directory:
This updates pyproject.toml and installs the package in your local environment.
After adding dependencies with uv add, you can immediately test with sb0 run --prompt without rebuilding.

Common Dependencies

Here are some commonly used packages for agents:

Development Dependencies

Add development-only dependencies with the --dev flag:
These won’t be included in production builds.

The .sb0/wheels/ Directory

Your agent includes embedded sb0 packages in .sb0/wheels/:
  • sb0-runner - Agent runtime and execution environment
  • sb0-protocol - Communication protocol definitions
These are automatically installed during sb0 init and referenced in pyproject.toml:
Don’t modify the .sb0/wheels/ directory or remove these package references.

Local Testing vs Production

Understanding dependency workflows:

Local Testing

Dependencies are installed in .venv/ and available immediately for local testing.

Production Deployment

For production, you must rebuild the Docker image to include new dependencies.

Dependency Versions

Specify version constraints in pyproject.toml:
Or use uv add with version specifiers:

Viewing Dependencies

List all installed dependencies:
View dependency tree:

Lockfile

uv creates a uv.lock file that pins exact versions for reproducible builds:
Commit uv.lock to version control to ensure consistent builds across environments.

Next Steps