Skip to main content

Agent AI for HEP tasks

Project description

Project

coverage

Introduction

hepagent is an AI agent framework tailored for High Energy Physics (HEP) and cosmology workflows. Key features include:

  • Multi-provider LLM support: seamlessly switch between providers such as cborg, openai, amsc, and gemini via a unified CLI (hepagent run) or programmatic API, with per-provider configuration managed in providers.toml.
  • Skill-based domain knowledge: a modular skill registry (.agents/skills/) packages domain-specific instructions (e.g. running Nyx cosmology simulations) that agents load on demand, keeping prompts concise and context-relevant.
  • Bash and REPL agents: interactive shell agents with configurable YOLO (auto-approve), CONFIRM, and HUMAN execution modes, output character limits, and turn budgets—safe for running on HPC clusters.
  • Textual TUI agent: a rich Terminal User Interface (TextualAgent) with real-time display of agent thinking, step navigation, and live cost tracking.
  • HPC / Slurm integration: built-in tooling for submitting and monitoring Slurm jobs, Globus data transfers, and IRI compute resources.
  • Extensible tool system: common and domain-specific tools are registered under src/hepagent/tools/, making it straightforward to add new capabilities without touching agent logic.

Installation

Quick start (no code checkout required)

With uv installed, you can run hepagent directly from PyPI without cloning the repository:

# Run once without installing permanently
uvx hepagent -h

# Or install as a persistent tool
uv tool install hepagent
hepagent -h

Developer setup (from source)

git clone https://github.com/xju2/hepagent.git
cd hepagent
uv python install 3.12
make sync
uv run hepagent list-platforms
uv run hepagent list-models --platform cborg

Configurations

After the installation, you can find default configurations at $HOME/.hepagent. The environment variables are stored in $HOME/.hepagent/config/env_vars.toml.

To use a LLM provider, set the corresponding API keys as environment variables. You may also want to set OPENAI_AGENTS_DISABLE_TRACING=1 to disable the tracing logs, especially if you do not have an OPENAI_API_KEY.

If you don't want to store API keys in the TOML file, you can set them to environment variables directly.

export CBORG_API_KEY="your-api-key"
export OPENAI_API_KEY="your-api-key"
export AMSC_API_KEY="your-api-key"
export GEMINI_API_KEY="your-api-key"

Instructions

Choose a platform and model

You can run the agent as in the following examples. The default model is cborg:gemini-flash if not specified.

List available models for a platform:

uv run hepagent list-models --platform cborg
uv run hepagent list-models --platform amsc
uv run hepagent list-models --platform openai
uv run hepagent list-models --platform gemini

Run an agent with a specific model and task:

uv run hepagent run --agent "shell" --model "gemini:models/gemini-flash-lite-latest" "how many python files in this code repository"
uv run hepagent run --agent "scientist" --model "cborg:gemini-flash" "I would like to simulate a cosmology sky with Nyx code." --max-turn 30
uv run hepagent run --agent "coder" --model "openai:gpt-5-mini" "Create a worktree for adding a new feature: chunkle."
uv run hepagent run --agent "scientist" --model "gemini:models/gemini-2.0-flash" "..."  # uses Gemini provider

YOLO mode (auto-approve all bash commands):

uv run hepagent run --agent "scientist" --yolo "your task here"

Interactive Bash Agent with REPL

python src/hepagent/scripts/bash_repl.py

With custom turn budget:

HEPAGENT_MAX_TURNS=80 python src/hepagent/scripts/bash_repl.py

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

hepagent-0.3.4.tar.gz (459.3 kB view details)

Uploaded Source

Built Distribution

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

hepagent-0.3.4-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

Details for the file hepagent-0.3.4.tar.gz.

File metadata

  • Download URL: hepagent-0.3.4.tar.gz
  • Upload date:
  • Size: 459.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hepagent-0.3.4.tar.gz
Algorithm Hash digest
SHA256 aefd6e207b26cac559364db07e403c428faf460a7e745aff6e611e05c53ea23d
MD5 9a90e423eb24460304475f0f6d88e476
BLAKE2b-256 ffb5be704e8f8dd70ab0a62fe6ca4905b9c5d51d94aea3c414b3f0ca5e3becc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for hepagent-0.3.4.tar.gz:

Publisher: release.yml on xju2/hepagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hepagent-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: hepagent-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hepagent-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c5aa99b471a414f1b35fe80a84b0c1941f275b56833d0f5085d55add1f43eb
MD5 307acbc046302b059e7d1f2b8907abd7
BLAKE2b-256 3a37dd3774e81069ed5c713abeade3aff4acbff2a276aa795a8689268148d221

See more details on using hashes here.

Provenance

The following attestation bundles were made for hepagent-0.3.4-py3-none-any.whl:

Publisher: release.yml on xju2/hepagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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