Skip to main content

multi-agent system for autonomous discovery, made by cosmologists, powered by ag2

Project description

License arXiv HuggingFace PyPI version

Subscribe on YouTube Join us on Discord

Multi-Agent System for Science, Powered by AG2.

Try cmbagent on HuggingFace!

We are currently deploying cmbagent on the cloud, it will be in production soon!

Cmbagent is part of Denario, our end-to-end research system.

Check our demo videos on YouTube!

Join our Discord Server to ask all your questions!

This is open-source research-ready software.

We emphasize that cmbagent is under active development and apologize for any bugs.

The backbone of cmbagent is AG2. Please star the AG2 repo ⭐ and cite Wu et al (2023)!

Strategy

Cmbagent acts according to a Planning and Control strategy with no human-in-the-loop.

You give a task to solve, then:

Planning

  • A plan is designed from a conversation between a planner and a plan reviewer.
  • Once the number of feedbacks (reviews) is exhausted the plan is recorded in context and cmbagent switches to control.

Control

  • The plan is executed step-by-step.
  • Sub-tasks are handed over to a single agent in each step.

Install

With Python 3.12 or above:

python3 -m venv cmbagent_env
source cmbagent_env/bin/activate
pip install cmbagent

Go ahead and launch the GUI:

cmbagent run

See below if you need to run in terminal, notebooks etc.

Install for developers

git clone https://github.com/CMBAgents/cmbagent.git
cd cmbagent
python3 -m venv cmbagent_env
source cmbagent_env/bin/activate
pip install -e .

You can then open the folder in your VSCode/Cursor/Emacs/... and work on the source code.

Run

We assume you are in the virtual environment where you installed cmbagent.

Here is a one-liner you can run in terminal:

python -c "import cmbagent; task='''Draw two random numbers and give me their sum'''; results=cmbagent.one_shot(task, agent='engineer', engineer_model='gpt-4o-mini');"

If you want to run the notebooks, first create the ipykernel (assuming your virtual environment is called cmbagent_env):

python -m ipykernel install --user --name cmbagent_env --display-name "Python (cmbagent_env)"

Then launch jupyterlab:

jupyter-lab

Select the cmbagent kernel, and run the the notebook.

API Keys

Before you can use cmbagent, you need to set your OpenAI API key as an environment variable. Do this in a terminal, before launching Jupyter-lab.

For Unix-based systems (Linux, macOS), do:

export OPENAI_API_KEY="sk-..."  ## mandatory for the RAG agents
export ANTHROPIC_API_KEY="sk-..." ## optional 
export GEMINI_API_KEY="AI...." ## optional 

(paste in your bashrc or zshrc file, if possible.)

For Windows, use WSL and the same command.

By default, cmbagent uses models from oai/anthropic/google. If you want to pick different LLMs, just adapat agent_llm_configs as above, or the default_agent_llm_configs in utils.py.

Docker

You can run the cmbagent GUI in a docker container. You may need sudo permission to run docker, or follow the instructions of this link. To build the docker image run:

docker build -t cmbagent .

To run the cmbagent GUI:

docker run -p 8501:8501 --rm cmbagent

That command exposes the default streamlit port 8501, change it to use a different port. You can mount additional volumes to share data with the docker container using the -v flag.

If you want to enter the docker container in interactive mode to use cmbagent without the GUI, run:

docker run --rm -it cmbagent bash

References

    @misc{xu2025opensourceplanning,
        title={Open Source Planning & Control System with Language Agents for Autonomous Scientific Discovery}, 
        author={Licong Xu and Milind Sarkar and Anto I. Lonappan and Íñigo Zubeldia and Pablo Villanueva-Domingo and Santiago Casas and Christian Fidler and Chetana Amancharla and Ujjwal Tiwari and Adrian Bayer and Chadi Ait Ekiou and Miles Cranmer and Adrian Dimitrov and James Fergusson and Kahaan Gandhi and Sven Krippendorf and Andrew Laverick and Julien Lesgourgues and Antony Lewis and Thomas Meier and Blake Sherwin and Kristen Surrao and Francisco Villaescusa-Navarro and Chi Wang and Xueqing Xu and Boris Bolliet},
        year={2025},
        eprint={2507.07257},
        archivePrefix={arXiv},
        primaryClass={cs.AI},
        url={https://arxiv.org/abs/2507.07257}, 
    }


   @misc{Laverick:2024fyh,
      author = "Laverick, Andrew and Surrao, Kristen and Zubeldia, Inigo and Bolliet, Boris and Cranmer, Miles and Lewis, Antony and Sherwin, Blake and Lesgourgues, Julien",
      title = "{Multi-Agent System for Cosmological Parameter Analysis}",
      eprint = "2412.00431",
      archivePrefix = "arXiv",
      primaryClass = "astro-ph.IM",
      month = "11",
      year = "2024"
   }

Acknowledgments

Our project is funded by the Cambridge Centre for Data-Driven Discovery Accelerate Programme. We are grateful to Mark Sze for help with AG2.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

cmbagent-0.0.1.post52-py3-none-any.whl (680.3 kB view details)

Uploaded Python 3

File details

Details for the file cmbagent-0.0.1.post52-py3-none-any.whl.

File metadata

File hashes

Hashes for cmbagent-0.0.1.post52-py3-none-any.whl
Algorithm Hash digest
SHA256 877906e179ed9a9cc9e3a318ba4465a1148664fdf46e3744cbaaddcc70d3bd75
MD5 ea82f83cecc1e6470e876ce4c2333ade
BLAKE2b-256 5dd71d6a930723c9f8e0fbf4c122b05884d9e67b2a73033e1b6ea3bbec45b0f0

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