The Knowledge LedgerThe Knowledge LedgerFollow on WhatsApp
โ† Back to feed
August 9, 2026ยทarxiv.org

An Agent Is Just a Python Object - Introducing Object Oriented Agents

Most agent frameworks split the system across prompt templates, tool schemas, callback code, and workflow graphs. The result is fragile and hard to reason about.

A simpler model is possible. Treat the agent as an ordinary Python object. Its methods are the actions the model can take. Its fields hold state. Its docstrings serve as prompts. Its type annotations act as contracts. Methods whose body is an ellipsis are completed at runtime by an LLM-driven loop. Methods with normal bodies remain ordinary deterministic Python.

Developers and models therefore share the same interface. Agent behavior can be tested, traced, refactored, and improved like any other software. The framework also exposes several capabilities that previous systems only partially supported: typed input and output, pass-by-reference over live objects, code as action, programmable control flow, explicit object state, and model-callable APIs for context and events.

Current models use this interface effectively. On standard agent benchmarks the approach is competitive or better, and in some interactive reasoning settings it compresses multi-agent systems into a single agent with a short skill definition.

This Ledger Entry expands how the reader thinks by replacing the fragmented stack of agent tooling with a single, familiar programming model: the agent as ordinary Python software that can also reason.

Read the full articleโ†’

Share this post