Skip to main content

Library-friendly agents that work directly with your existing Python codebase.

Project description

agex: Library-Friendly Agents

agex (a portmanteau of agent execution) is a Python-native agentic framework that enables AI agents to work directly with your existing libraries and codebase.

Core Concepts

agex executes sandboxed Python directly in your process, bypassing JSON serialization to let complex objects flow freely. You define a safe, focused environment by whitelisting exactly which capabilities are available.

Key features:

  • Type-Safe Execution: Agents fulfill typed signatures by executing sandboxed Python.
  • Curated Scope: Whitelist exactly which modules and classes are available.
  • Stateful Memory: Versioned workspace enables time-travel debugging.
  • Multi-Agent Orchestration: Coordinate agents with natural Python control flow.
  • Terminal & Scripting: Agents run shell commands, Python scripts, and git — all sandboxed.
  • Flexible Hosting: Run locally (default), on HTTP servers, or serverless via Modal.

Demo of an agex agent returning pandas DataFrames and plotly figures in an IPython REPL

This works because agex agents can accept and return complex types like pandas.DataFrame and plotly.Figure objects without intermediate JSON serialization. For a deeper dive, check out the full agex101.ipynb tutorial or see geospatial routing with OSMnx for advanced multi-library integration.

For a full demo app where agex integrates with NiceGUI, see agex-ui.

Documentation

Complete documentation is hosted at ashenfad.github.io/agex.

Key sections:

Installation

Install agex with your preferred LLM provider:

# Install with a specific provider
pip install "agex[openai]"        # For OpenAI models
pip install "agex[anthropic]"     # For Anthropic Claude models
pip install "agex[gemini]"        # For Google Gemini models

# Or install with all providers
pip install "agex[all-providers]"

Project Status

⚠️ agex is a new framework in active development. While the core concepts are stabilizing, the API should be considered experimental and is subject to change.

For teams looking for a more battle-tested library built on the same "agents-that-think-in-code" philosophy, we highly recommend Hugging Face's excellent smolagents project. agex explores a different architectural path, focusing on deep runtime interoperability and a secure, sandboxed environment for direct integration with existing Python libraries.

Built On

agex is composed of several focused libraries that can also be used independently:

Library Purpose
sandtrap In-process Python sandbox via AST rewriting
kvgit Versioned key-value store with git-like semantics
monkeyfs Filesystem interception via monkey-patching
termish Virtual terminal with shell-like commands
reprobate Budget-controlled repr for Python objects

Contributing

We welcome contributions! See our Contributing Guide for details on our development workflow, code style, and how to submit pull requests. For bug reports and feature requests, please use GitHub Issues.

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

agex-0.10.2.tar.gz (206.6 kB view details)

Uploaded Source

Built Distribution

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

agex-0.10.2-py3-none-any.whl (251.7 kB view details)

Uploaded Python 3

File details

Details for the file agex-0.10.2.tar.gz.

File metadata

  • Download URL: agex-0.10.2.tar.gz
  • Upload date:
  • Size: 206.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for agex-0.10.2.tar.gz
Algorithm Hash digest
SHA256 dc78a0d817387166fd8326a918a4e230f21e3108d6f20b42b1ee3cb23469d996
MD5 68a8b883a39e8a40e0d6b54168da8d14
BLAKE2b-256 1d399bea4e1d1937438a2b3a7f9cf3b8987d549b18a91d9814b3dc1dd91141ba

See more details on using hashes here.

File details

Details for the file agex-0.10.2-py3-none-any.whl.

File metadata

  • Download URL: agex-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 251.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for agex-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6811c9d7414ebd3ff71a89108da33f17fe9fa61e81bf06711d41f71fdb2c78e5
MD5 7bb52a5742ed0020f30a7e0cfd53211e
BLAKE2b-256 25975bf505d9116397a893422f2dbaf66c55aa1636dd33b2bad244dd8617dbb3

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