ashenfad
Joined 14 years ago
Karma
4
Submissions
4
Member since
Dec 11
Joined 14 years ago
Its closest relative is Hugging Face's excellent `smol-agents`. While both "think-in-code", `agex` focuses on interoperability, allowing agents to receive and return complex Python objects like DataFrames, Plotly figures, or even callables.
For example:
import math
from typing import Callable
from agex import Agent
agent = Agent(primer="You are an expert at writing small, useful functions.")
# Equip the agent with the math module
agent.module(math)
# The fn sig is the contract; the agent provides the implementation at runtime
@agent.task
def build_function(prompt: str) -> Callable:
"""Build a callable function from a text prompt."""
pass
# The agent returns a real, callable Python function, not a JSON blob
is_prime = build_function("a function that checks if a number is prime")
# You can use it immediately
print(f"Is 13 prime? {is_prime(13)}")
# > Is 13 prime? True
From the agent's point-of-view, it lives in a Python REPL with its own stdout, allowing it to inspect data, see errors, and self-correct. An agent's REPL is persisted across tasks, so it can build its own helpers and improve over time.Highlights:
* Code-as-Action: AST-style Python sandbox for agent actions.
* Library Integration: Plug into libraries rather than tools (& skip the JSON).
* Workspace Persistence: Git-like versioning for agent state (w/ time-travel debugging).
* Multi-Agent: Orchestrate agents with natural Python control flow.
* Observability: Real-time, notebook-friendly event streams.
* Benchmarking: A framework for data-driven agent evaluation.
The project is early stage but the core concepts are stabilizing. I'm hoping to find a few brave souls to kick the tires. Feedback is welcome.GitHub: https://github.com/ashenfad/agex
Docs & Examples: https://ashenfad.github.io/agex/
Queries are lazy—you build expressions first, then execute via slicing.
Example – find when a team is free for a 2+ hour meeting:
Features:- Set operations on any timeline source
- Recurring patterns via RFC 5545 (dateutil under the hood)
- Filter by duration, metadata, or custom properties
- Google Calendar read/write
- iCalendar (.ics) import/export
Fwiw, I think focused DSLs are a great pairing with code-focused agents like huggingface's smol-agents or agex (my other hobby project).
Video of a calgebra-enabled agent: https://youtu.be/10kG4tw0D4k
Would love feedback!