Metadata-Version: 2.4
Name: bluesky-adaptive
Version: 0.4.0
Summary: Tools for writing adaptive plans and building adaptive agents.
Author-email: Phillip Maffettone <pmaffetto@bnl.gov>, Dmitri Gavrilov <dgavrilov@bnl.gov>, Thomas Caswell <tacasewell@bnl.gov>
Maintainer-email: Phillip Maffettone <pmaffetto@bnl.gov>
License-Expression: BSD-3-Clause
Project-URL: GitHub, https://github.com/bluesky/bluesky-adaptive
Project-URL: Documentation, https://blueskyproject.io/bluesky-adaptive
Classifier: Development Status :: 7 - Inactive
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bluesky
Requires-Dist: bluesky-live
Requires-Dist: bluesky-widgets
Requires-Dist: bluesky-kafka
Requires-Dist: bluesky-queueserver-api
Requires-Dist: xkcdpass
Requires-Dist: tiled[client]
Requires-Dist: numpy
Requires-Dist: pydantic
Requires-Dist: json-rpc
Provides-Extra: agents
Requires-Dist: scikit-learn; extra == "agents"
Requires-Dist: scipy; extra == "agents"
Requires-Dist: botorch; extra == "agents"
Provides-Extra: dev
Requires-Dist: certifi>=2026.10.19; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: numpydoc; extra == "dev"
Requires-Dist: sphinx-copybutton; extra == "dev"
Requires-Dist: sphinx-design; extra == "dev"
Requires-Dist: pydata-sphinx-theme; extra == "dev"
Requires-Dist: myst-parser; extra == "dev"
Requires-Dist: fastapi; extra == "dev"
Requires-Dist: caproto!=1.2.0; extra == "dev"
Requires-Dist: ophyd; extra == "dev"
Requires-Dist: scipy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pre-commit-hooks; extra == "dev"
Requires-Dist: intake; extra == "dev"
Requires-Dist: tiled[client,server]; extra == "dev"
Requires-Dist: humanize; extra == "dev"
Requires-Dist: doct; extra == "dev"
Requires-Dist: mongomock; extra == "dev"
Requires-Dist: databroker[all]<3.0.0,>=2.0.0b1; extra == "dev"
Requires-Dist: bluesky-tiled-plugins; extra == "dev"
Provides-Extra: tsuchinoko
Requires-Dist: tsuchinoko>=1.1.23; extra == "tsuchinoko"
Dynamic: license-file

# Bluesky Adaptive

[![Build Status]][Actions] [![PyPI Version]][PyPI] [![License Badge]][License]

> bluesky-adaptive 0.x is discontinued. Starting with 1.0, bluesky-adaptive adopts the
> [blop](https://github.com/bluesky/blop) codebase and continues its development under the
> bluesky-adaptive name at [bluesky-adaptive](https://github.com/bluesky/bluesky-adaptive).
> The 1.0+ API differs from 0.x: the Kafka/Tiled Agent base, adjudicators,
> server, and lockstep recommenders are not carried forward. Pin
> `bluesky-adaptive<1` to keep this package.
>
> 0.4.0 is the final 0.x release.

**Bluesky Adaptive** is a component of the Bluesky ecosystem designed to introduce adaptivity and intelligent decision-making into experimental workflows.  
It provides a flexible API that supports a wide range of adaptive algorithms, from simple rule-based adjustments to sophisticated artificial intelligence and machine learning models.  
The package is designed to provide a framework and set of harnesses for "bring-your-own-agent" development.  
It has no opinions on the algorithms that underpin your adaptivity, and it is designed to be agnostic to the specifics of the domain in which it is used.

| Resource        | Link                      |
| --- | --- |
| **PyPI**        | `pip install bluesky-adaptive` |
| **Source Code** | [GitHub][]                |
| **Docs**        | [Documentation][]         |

## Features

- Adaptive harness for lockstep agents to interact with the RunEngine.
- Base classes for developing distributed agents to interact with the RunEngine Manager through Queue Server.
- Example agents using optional requirements (BoTorch, GPyTorch, Scikit Learn).
- Server for running managed agents with a FAST API.
- Adjudicators for acting as meta-agents that consume suggestions from many agents and gatekeep the Queue Server.

## Getting Started

To get started with Bluesky-Adaptive, refer to the [Getting Started Tutorial][Tutorial].  
This tutorial will guide you through the installation process, setting up the Bluesky stack, and running your first adaptive experiment.

## Usage

Bluesky Adaptive is designed to be integrated into your experimental workflows to provide adaptive capabilities.  
It offers two primary approaches:

- **Lockstep Approach**: For synchronous operations where each experimental step waits for the previous one to complete.
- **Asynchronous Approach**: Allows for independent operation from the main execution thread, suitable for complex setups.

Detailed guides on how to extend your existing Python tools for use with Bluesky Adaptive and how to run your agent as a service can be found in the [documentation][].

## Development Environment

To set up a development environment for Bluesky Adaptive, you can use the provided containerized setup with `bluesky-pods`.
A minimal compose file is available in `bluesky_adaptive/tests/podman/docker-compose.yaml` to run the unit tests.
For more complete integration testing, you can use the `bluesky-pods` repository, which provides a full stack including the RunEngine, Queue Server, and Tiled server.

```bash
podman pull ghcr.io/bluesky/bluesky-pods-bluesky:latest
podman tag ghcr.io/bluesky/bluesky-pods-bluesky:latest bluesky:latest
git clone (https://github.com/bluesky/bluesky-pods)
cd bluesky-pods/compose/acq-pod
podman-compose --in-pod true up -d
```

## Contributing

We welcome contributions from the community, whether it's adding new features, improving documentation, or reporting bugs.  
Please see our [contribution guidelines][] for more information on how to get involved.

## License

Bluesky-Adaptive is distributed under the BSD-3-Clause license.  
See the [LICENSE file][] for more details.

---

[Build Status]: https://github.com/bluesky/bluesky-adaptive/actions/workflows/tests.yml/badge.svg
[Actions]: https://github.com/bluesky/bluesky-adaptive/actions
[PyPI Version]: https://img.shields.io/pypi/v/bluesky-adaptive.svg
[PyPI]: https://pypi.python.org/pypi/bluesky-adaptive
[License Badge]: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
[License]: https://opensource.org/licenses/BSD-3-Clause

[GitHub]: https://github.com/bluesky/bluesky-adaptive
[Documentation]: https://blueskyproject.io/bluesky-adaptive
[Tutorial]: https://blueskyproject.io/bluesky-adaptive/tutorials/getting-started
[contribution guidelines]: https://github.com/bluesky/bluesky-adaptive/blob/main/CONTRIBUTING.rst
[LICENSE file]: https://github.com/bluesky/bluesky-adaptive/blob/main/LICENSE
