MCP ExplorerExplorer

Abacus Agent Tools

@pxlxingliangon 10 days ago
4 LGPL-3.0
FreeCommunity
AI Systems
MCP tools to connect LLMs and ABACUS jobs

Overview

What is Abacus Agent Tools

ABACUS-agent-tools is a Python package designed to connect Large Language Models (LLMs) with ABACUS jobs using the Model Context Protocol (MCP).

Use cases

Use cases include automating data processing tasks, enhancing natural language understanding in ABACUS jobs, and facilitating complex workflows involving LLMs.

How to use

To use ABACUS-agent-tools, install the package via pip by running the command ‘pip install .’ in your terminal.

Key features

Key features include seamless integration between LLMs and ABACUS jobs, leveraging the Model Context Protocol for efficient communication.

Where to use

ABACUS-agent-tools can be used in various fields such as data analysis, machine learning, and any application requiring interaction between LLMs and ABACUS jobs.

Content

ABACUS Agent Tools

ABACUS-agent-tools is a Python package that provides the Model Context Protocol (MCP) tools to connect large language models (LLMs) to ABACUS computational jobs. It serves as a bridge between AI models and first principles calculations, enabling intelligent interaction with ABACUS workflows.

Installation

To use ABACUS agent tools with Google Agent Development Kit (ADK), follow the recommended installation process:

  1. Create and activate a conda enviroment:
conda create -n abacus-agent python=3.11
conda activate abacus-agent
  1. Install necessary dependencies:
pip install mcp google-adk litellm science-agent-sdk
  1. Install abacustest
git clone -b develop https://github.com/pxlxingliang/abacus-test.git
cd abacus-test
pip install .
  1. Install ABACUS-agent-tools:
cd ..
git clone -b develop https://github.com/pxlxingliang/ABACUS-agent-tools.git
cd abacus-agent
pip install .

If you haven’t installed ABACUS, you can install ABACUS to the same environment by conda:

conda install abacus "libblas=*=*mkl" mpich -c conda-forge

Using ABACUS agent tools with Google ADK

Use ABACUS agent tools and Google ADK on local machine

Starting ABACUS agent tools

Before launching abacusagent, you must provide the necessary configurations in the ~/.abacusagent/env.json file. This file defines how the ABACUS agent tools generate input files and manage ABACUS calculation workflows.

{
    "_comments": {
        "ABACUS_WORK_PATH": "The working directory for AbacusAgent, where all temporary files will be stored.",
        "ABACUS_SUBMIT_TYPE": "The type of submission for ABACUS, can be local or bohrium.",
        "ABACUSAGENT_HOST": "The host address for the AbacusAgent server.",
        "ABACUSAGENT_PORT": "The port number for the AbacusAgent server.",
        "ABACUSAGENT_MODEL": "The model to use for AbacusAgent, can be 'fastmcp', 'test', or 'dp'.",
        "BOHRIUM_USERNAME": "The username for Bohrium.",
        "BOHRIUM_PASSWORD": "The password for Bohrium.",
        "BOHRIUM_PROJECT_ID": "The project ID for Bohrium.",
        "BOHRIUM_ABACUS_IMAGE": "The image for Abacus on Bohrium.",
        "BOHRIUM_ABACUS_MACHINE": "The machine type for Abacus on Bohrium.",
        "BOHRIUM_ABACUS_COMMAND": "The command to run Abacus on Bohrium",
        "ABACUS_COMMAND": "The command to execute Abacus on local machine.",
        "ABACUS_PP_PATH": "The path to the pseudopotential library for Abacus.",
        "ABACUS_ORB_PATH": "The path to the orbital library for Abacus.",
        "_comments": "This dictionary contains the default environment variables for AbacusAgent."
    }
}

Then you can start abacusagent.

>>> abacusagent
✅ Successfully loaded: abacusagent.modules.abacus
INFO:     Started server process [25487]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://localhost:50001 (Press CTRL+C to quit)

Preparing Google ADK Agent

Organize your agent files in the following structure:

name_of_your_agent/
├── __init__.py
└── agent.py

See example files in examples\my_agent to prepare __init__.py and agent.py.

Starting Google ADK

>>> adk web
INFO:     Started server process [25799]
INFO:     Waiting for application startup.

+-----------------------------------------------------------------------------+
| ADK Web Server started                                                      |
|                                                                             |
| For local testing, access at http://localhost:8000.                         |
+-----------------------------------------------------------------------------+

INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

Accessing the agent

  1. Open your browser and navigate to the provided ADK address.
  2. Select the agent directory name you configured.
  3. Interact with the LLM, which can now leverage ABACUS agent tools for computational tasks.

Use ABACUS agent tools and Google ADK on remote server

After installing ABACUS agent tools and Google ADK on a remote server, use the exposed ports for configuration.

Example for Bohrium Nodes

# Start ABACUS agent tools with public host and port
abacusagent --host "0.0.0.0" --port 50001
# Start Google ADK with public host and port
adk web --host "0.0.0.0" --port 50002

Accessing Remotely

Visit http://your-node-address.dp.tech:50002 in your browser, where:

  • your-node-address.dp.tech is the remote node URL
  • 50002 is the configured port for Google ADK

Tools

No tools

Comments