This is the UI backend for the dr.sai project.
Project description
OpenDrSai
An integrated framework for rapid development and deployment of agents and multi-agent systems, developed by the HepAI team at the Institute of High Energy Physics, Chinese Academy of Sciences. It enables the fast creation and deployment of backend and frontend services for customized agent and multi-agent collaboration systems.
This framework is built upon Microsoft’s open-source project AutoGen (current version 0.5.7). While maintaining compatibility with the complete structure and ecosystem of AutoGen, it redesigns the components and development logic of agent and multi-agent systems, making it more suitable for building professional scientific agents and multi-agent systems 🤖: such as complex multi-task execution 💡, state management and human-computer interaction 🙋♂️🙋♀️, professional scientific tool management and execution 🛠️, long-duration task execution ⏰, and memory management 🧠.
It ensures strong compatibility with mainstream MCP and A2A protocols, the HepAI ecosystem, and RAGFlow as a representative RAG architecture. Furthermore, it provides integrated capabilities for both development and deployment: agent or multi-agent system code can be launched with a single command, registered as an OpenAI ChatCompletions format service or HepAI Worker service, and directly exposed as an API. Together with the bundled human-computer interaction frontend, developers can rapidly build and deploy complete end-to-end applications.
1. Features
- Flexible switching of base models for agents via the HepAI platform, along with dynamic configuration of components such as tools and knowledge bases. Supports integration of OpenAI ChatCompletions, Ollama, and other model formats.
- Provides pre-defined components for perception, reasoning, memory, execution, and state management in agent and multi-agent systems. These are plugin-based and extensible, supporting a wide variety of professional agent design use cases.
- Offers a one-click launch for human-computer interaction frontends and backends, enabling immediate application deployment. Compatible backend interfaces (OpenAI ChatCompletions, OpenWebUI-Pipeline) allow the system to be served as a third-party model or agent API.
2. Quick Start
2.1 Install OpenDrSai
From source (recommended)
conda create -n drsai python=>3.11
conda activate drsai
git clone https://code.ihep.ac.cn/hepai/drsai drsai
cd your/path/to/drsai/python/packages/drsai && pip install -e . # for OpenDrSai backend and agent components
cd your/path/to/drsai/python/packages/drsai_ui && pip install -e . # for DrSai-UI human-computer interaction frontend
Install via pip
conda create -n drsai python=>3.11
conda activate drsai
pip install drsai drsai_ui -U
Configure HepAI Platform API Key
Set the environment variables for the HepAI DDF2 platform API key (based on bash):
Linux/macOS:
vi ~/.bashrc
export HEPAI_API_KEY=your_api_key
source ~/.bashrc
Windows:
setx "HEPAI_API_KEY" "your_api_key"
# Note: Windows environment variables require a restart to take effect
Agent Example Test
See examples/oai_client/assistant_R1_oai.py for a demonstration of quickly developing an agent system with OpenDrSai.
2.2 Launch Human-Computer Interaction Frontend
Configure npm environment
Install Node.js
# install nvm to install node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install node
Install frontend dependencies
cd your/path/to/drsai/frontend
npm install -g gatsby-cli
npm install --global yarn
yarn install
# cp .env.default .env.development or .env.production # copy .env.default to .env.development or .env.production
# Development variables: frontend/.env.development
# Production variables: frontend/.env.production
# yarn build # build frontend static resources
yarn run dev # start frontend development environment
2.3 Start OpenDrSai Service via CLI
# pip install drsai_ui -U # ensure drsai_ui is installed
cp .env.example .env # copy .env.example to .env
drsai ui # start Magenti-UI backend and static frontend
drsai console --agent-config agent_config.yaml # start CLI-based agent/multi-agent service
drsai backend --agent-config agent_config.yaml # deploy agent/multi-agent as OpenAI-compatible backend service
NOTE:
- The
agent_config.yamlfile defines configuration information for agents and multi-agent systems. It allows quick setup for testing, or for frontend users to customize their agents. Example:
# Define your base agent model
model_config: &client
provider: drsai.HepAIChatCompletionClient
config:
model: openai/gpt-4o
api_key: sk-****
base_url: "https://aiapi.ihep.ac.cn/apiv2"
max_retries: 10
# Assemble your agent
myassistant:
type: AssistantAgent # agent type, provided by OpenDrSai or user-developed
name: myassistant
system_message: "You are a helpful assistant who responds to user requests based on your tools and knowledge."
description: "An agent that provides assistance with ability to use tools."
model_client: *client
For detailed configuration, see Configuration Documentation. On our AI platform, we provide a wide selection of base models, MCP/HEPAI Worker tools, RAG memory plugins, various agent and multi-agent frameworks, and pre-defined workflows. You can combine these in the frontend or backend to rapidly construct your own agent or multi-agent collaboration system. For detailed instructions on configuration-based construction, see: docs/agent_factory.md.
3. Documentation
Tutorials (in development, contact us for issues):
tutorials/base01-hepai.md: Model configuration and usage on the HepAI platform
tutorials/base02-worker.md: Configuration and usage of HEPAI Worker remote functions
tutorials/base03-use_claude-code.md: Using Claude-Code via the HepAI platform
tutorials/agents: Agent and multi-agent system examples
tutorials/components: Agent component development examples
Documentation (in development, contact us for issues):
docs/develop.md: Agent/multi-agent system development guide
docs/agent_factory.md: Agent/multi-agent open development and community contribution guide
docs/drsai_ui.md: Human-computer interaction frontend user guide
docs/open-webui.md: Using OpenAI-compatible frontend and OpenWebUI Pipeline plugin
4. Contribution
We welcome contributions to OpenDrSai, including code, documentation, issues, and suggestions. Contributions can take many forms, such as:
- Code contributions: agent/multi-agent system components, system examples, frontend UI development.
- Documentation contributions: system guides, tutorials, FAQs.
- Issue reporting: bug reports, feature suggestions, usage problems.
- Community activities: offline events, online meetups, knowledge sharing.
5. Contact
- Email: hepai@ihep.ac.cn / xiongdb@ihep.ac.cn
- WeChat: xiongdongbo_12138
- WeChat Group: HepAI LLM Tech Exchange Group 3:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drsai_ui-0.0.7.tar.gz.
File metadata
- Download URL: drsai_ui-0.0.7.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df25704dc090eb93e220c2c672a37317cba47b454f99a25fbf382af0f956d77
|
|
| MD5 |
2097edd851101f60d244070d67842741
|
|
| BLAKE2b-256 |
40f696e05d621f94ddc68b484834f02358ce943f4a11fd2d03a2397ccb179003
|
File details
Details for the file drsai_ui-0.0.7-py3-none-any.whl.
File metadata
- Download URL: drsai_ui-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14953f717a78dfd23074c810e6223521e9948e0b987bfe4b89554810cf8fe244
|
|
| MD5 |
4790c92dd759e754d8dc47dcfbfa7305
|
|
| BLAKE2b-256 |
1b73f7df2f91b6f32183bb9b3bf18aa0d355fc18167f014e2a74e3dcdc220e34
|