Skip to main content

SDK for scientific agents

Project description

Bohrium Science Agent SDK

English | 简体中文

Transform Scientific Software into AI Assistants — 3 Steps to Intelligent Transformation

📖 Introduction

The Bohrium platform introduces the bohr-agent-sdk Scientific Agent Development Kit, enabling AI systems to truly execute professional scientific tasks and helping developers quickly build their own specialized research agents. Through a three-step process — Invoking MCP Tools, Orchestrating Agent Workflows, and Deploying Services — any scientific software can be rapidly transformed into an AI assistant.

✨ Core Features

🎯 Intelligent Task Management: Simplified Development, Standardized Output

With a decorator pattern, just a few annotations can quickly transform scientific computing programs into MCP standard services. Built-in application templates turn scattered research code into standardized, reusable intelligent components.

🔧 Multi-Backend Framework Support

Supports mainstream Agent open frameworks including Google ADK, Langraph, and Camel, providing flexible choices for developers familiar with different technology stacks.

☁️ Flexible Deployment: Local Development, Cloud Production

Dual-mode architecture supports seamless transition between development and production. Local environments enable rapid iteration and feature validation, while Bohrium's cloud GPU clusters handle production-grade computing tasks. The SDK automatically manages the complete workflow of task scheduling, status monitoring, and result collection, with built-in file transfer mechanisms for handling large-scale data uploads and downloads. Developers focus on core algorithm implementation while infrastructure management is fully automated.

🖼️ Visual Interactive Interface: Professional Presentation, Intuitive Operation

Based on the modern React framework, deploy fully-featured web applications with one click. Built-in 3D molecular visualization engine supports multiple structure formats and rendering modes for interactive molecular structure display. Real-time data synchronization ensures instant computing status updates, while multi-session management supports parallel task processing. Integrated with enterprise-grade features including file management, project switching, and permission control. Transform command-line tools into professional visual applications, significantly enhancing user experience and tool usability.

🖼️ Interface Showcase

Scientific Computing Master Console

SCIMaster

Powerful scientific computing task management and monitoring platform

Visual Interactive Interface

UI

Modern web application interface providing intuitive user experience

🚀 Quick Start

Installation

pip install bohr-agent-sdk -i https://pypi.org/simple --upgrade

Build Your Research Agent in 3 Steps

Step 1: Get Project Templates

# Get calculation project template
dp-agent fetch scaffolding --type=calculation

# Get device control project template
dp-agent fetch scaffolding --type=device

# Get configuration file
dp-agent fetch config

Step 2: Develop Your Agent

Lab Mode Development Example

from typing import Dict, TypedDict
from dp.agent.device.device import Device, action, BaseParams, SuccessResult

class TakePictureParams(BaseParams):
    """Picture taking parameters"""
    horizontal_width: str  # Image horizontal width

class PictureData(TypedDict):
    """Picture data structure"""
    image_id: str

class PictureResult(SuccessResult):
    """Picture taking result"""
    data: PictureData

class MyDevice(Device):
    """Custom device class"""
    device_name = "my_device"

    @action("take_picture")
    def take_picture(self, params: TakePictureParams) -> PictureResult:
        """
        Execute picture taking action

        Through the @action decorator, automatically register this method as an MCP standard service
        """
        hw = params.get("horizontal_width", "default")
        # Execute actual device control logic
        return PictureResult(
            message=f"Picture taken with {self.device_name}",
            data={"image_id": "image_123"}
        )

Cloud Mode Development Example

"""
MCP protocol-based cloud device control example
"""
import signal
import sys
from dp.agent.cloud import mcp, get_mqtt_cloud_instance
from dp.agent.device.device import TescanDevice, register_mcp_tools

def signal_handler(sig, frame):
    """Graceful shutdown handling"""
    print("Shutting down...")
    get_mqtt_cloud_instance().stop()
    sys.exit(0)

def main():
    """Start cloud services"""
    print("Starting Tescan Device Twin Cloud Services...")

    # Register signal handler
    signal.signal(signal.SIGINT, signal_handler)

    # Create device instance
    device = TescanDevice(mcp, device)

    # Automatically register device tools to MCP server
    # register_mcp_tools implements automatic registration through Python introspection
    register_mcp_tools(device)

    # Start MCP server
    print("Starting MCP server...")
    mcp.run(transport="sse")

if __name__ == "__main__":
    main()

Step 3: Run and Deploy

# Local lab environment
dp-agent run tool device

# Cloud computing environment
dp-agent run tool cloud

# Scientific calculation mode
dp-agent run tool calculation

# Start agent (with Web UI)
dp-agent run agent --config

# Debug mode
dp-agent run debug

🏗️ Project Structure

After running dp-agent fetch scaffolding, you'll get a standardized project structure:

your-project/
├── lab/                    # Lab mode
│   ├── __init__.py
│   └── tescan_device.py    # Device control implementation
├── cloud/                  # Cloud mode
│   ├── __init__.py
│   └── mcp_server.py       # MCP service implementation
├── calculation/            # Calculation mode
│   └── __init__.py
├── .env                    # Environment configuration
└── main.py                 # Main program entry

⚙️ Configuration

Configure necessary environment variables in the .env file:

# MQTT connection configuration
MQTT_INSTANCE_ID=your_instance_id
MQTT_ENDPOINT=your_endpoint
MQTT_DEVICE_ID=your_device_id
MQTT_GROUP_ID=your_group_id
MQTT_AK=your_access_key
MQTT_SK=your_secret_key

# Computing resource configuration
BOHRIUM_USERNAME=your_username
BOHRIUM_PASSWORD=your_password

Note: The dp-agent fetch config command automatically downloads configuration files and replaces dynamic variables (such as MQTT_DEVICE_ID). For security reasons, this feature is only available in internal network environments.

🎯 Application Scenarios

  • Materials Science Computing: Molecular dynamics simulation, first-principles calculations
  • Bioinformatics Analysis: Gene sequence analysis, protein structure prediction
  • Laboratory Equipment Control: Intelligent control of research equipment such as electron microscopes and X-ray diffractometers
  • Data Processing Workflows: Automated data cleaning, analysis, and visualization
  • Machine Learning Training: Model training, hyperparameter optimization, result evaluation

🔧 Advanced Features

File Management

# Upload files to cloud
dp-agent artifact upload <path>

# Download cloud files
dp-agent artifact download <artifact_id>

Task Monitoring

The SDK provides real-time task status monitoring, supporting:

  • Task queue management
  • Computing resource scheduling
  • Automatic result collection
  • Exception handling and retry mechanisms

📚 Documentation & Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bohr_agent_sdk-0.1.105.tar.gz (488.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bohr_agent_sdk-0.1.105-py3-none-any.whl (510.9 kB view details)

Uploaded Python 3

File details

Details for the file bohr_agent_sdk-0.1.105.tar.gz.

File metadata

  • Download URL: bohr_agent_sdk-0.1.105.tar.gz
  • Upload date:
  • Size: 488.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for bohr_agent_sdk-0.1.105.tar.gz
Algorithm Hash digest
SHA256 e0a0473886742cd6bcd5b55ca77c54bc0ebd47f7d34fa45ec10b8a3d6cdeeec7
MD5 06bc672e7b9becd71db97368868d105b
BLAKE2b-256 0405bb75bb14dac502d293795cdb4cba71a539a6342407120527284eb15d07b6

See more details on using hashes here.

File details

Details for the file bohr_agent_sdk-0.1.105-py3-none-any.whl.

File metadata

File hashes

Hashes for bohr_agent_sdk-0.1.105-py3-none-any.whl
Algorithm Hash digest
SHA256 7e1c777e8040b43434130eb597a4dbc1e54fdc9b3c83c0808c81f9df21200863
MD5 6abcb7f1ca7fd542004e377a77e6dd40
BLAKE2b-256 5bc5cfd8e825535cbde45814bae6f29417ac19ed918d529a95cbed2310c23daf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page