Skip to main content

Agent implementations using AbstractRuntime and AbstractCore

Project description

AbstractAgent

Agent patterns (ReAct / CodeAct / MemAct) built on AbstractRuntime (durable execution) and AbstractCore (tools + LLM integration).

AbstractAgent is part of the AbstractFramework ecosystem:

Start here: docs/getting-started.md (then docs/README.md for the full index)

How it fits (high level)

flowchart LR
  Host[Your app / service] --> Agent[AbstractAgent<br/>ReAct / CodeAct / MemAct]
  Agent --> RT[AbstractRuntime<br/>WorkflowSpec + Effects]
  RT --> Core[AbstractCore<br/>LLM + tool-call normalization]
  RT --> Stores[RunStore + LedgerStore]
  Agent --> Tools[Tool callables<br/>(abstractcore common_tools + agent tools)]

Documentation

What you get

  • ReAct: tool-first Reason → Act → Observe loop
  • CodeAct: executes Python (tool call or fenced ```python``` blocks)
  • MemAct: memory-enhanced agent using runtime-owned Active Memory
  • Durable runs: pause/resume via run_id + runtime stores
  • Tool control: explicit tool bundles + per-run allowlists
  • Observability: durable ledger of LLM calls, tool calls, and waits

Where this lives in code (source of truth):

  • Agents: src/abstractagent/agents/*
  • Workflows/adapters: src/abstractagent/adapters/*_runtime.py
  • Prompting/parsing logic (runtime-agnostic): src/abstractagent/logic/*
  • Default tool bundle: src/abstractagent/tools/__init__.py

Requirements

  • Python >=3.10 (see pyproject.toml)

Installation

From source (development):

pip install -e .

With dev dependencies:

pip install -e ".[dev]"

From PyPI:

pip install abstractagent

Native Python hardware profile cascades are available for deployment manifests: abstractagent[apple], abstractagent[gpu], abstractagent[all-apple], and abstractagent[all-gpu]. These delegate to the matching AbstractCore and AbstractRuntime profiles; AbstractAgent itself remains provider/runtime agnostic.

Note: the repository may be ahead of the latest published PyPI release. To verify what you installed:

python -c "import importlib.metadata as md; print(md.version('abstractagent'))"

Quick start (ReAct)

from abstractagent import create_react_agent

agent = create_react_agent(provider="ollama", model="qwen3:1.7b-q4_K_M")
agent.start("List the files in the current directory")
state = agent.run_to_completion()
print(state.output["answer"])

Persistence (resume across restarts)

By default, the factory helpers use an in-memory runtime store. For resume across process restarts, pass a persistent RunStore/LedgerStore (example below uses JSON files).

from abstractagent import create_react_agent
from abstractruntime.storage.json_files import JsonFileRunStore, JsonlLedgerStore

run_store = JsonFileRunStore(".runs")
ledger_store = JsonlLedgerStore(".runs")

agent = create_react_agent(run_store=run_store, ledger_store=ledger_store)
agent.start("Long running task")
agent.save_state("agent_state.json")

# ... later / after restart ...

agent2 = create_react_agent(run_store=run_store, ledger_store=ledger_store)
agent2.load_state("agent_state.json")
state = agent2.run_to_completion()
print(state.output["answer"])

More details: docs/persistence.md

CLI

This repository still installs a react-agent entrypoint, but it is deprecated and only prints a migration hint (see src/abstractagent/repl.py and pyproject.toml).

Interactive UX lives in AbstractCode.

License

MIT (see LICENSE).

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

abstractagent-0.3.9.tar.gz (84.3 kB view details)

Uploaded Source

Built Distribution

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

abstractagent-0.3.9-py3-none-any.whl (78.7 kB view details)

Uploaded Python 3

File details

Details for the file abstractagent-0.3.9.tar.gz.

File metadata

  • Download URL: abstractagent-0.3.9.tar.gz
  • Upload date:
  • Size: 84.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for abstractagent-0.3.9.tar.gz
Algorithm Hash digest
SHA256 55c2877718aadcb179114037e5e937e18823983ce3a67b87d2193cd5c0bf1abb
MD5 0515428c6ec896193a328b3f550e9bb0
BLAKE2b-256 19029cf75cf1ecbd42f21068f012ce54033bd9dac02217e4beb8729c5b91c60b

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractagent-0.3.9.tar.gz:

Publisher: release.yml on lpalbou/AbstractAgent

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

File details

Details for the file abstractagent-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: abstractagent-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 78.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for abstractagent-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1bbda44f5e6cb4b34c426b2c273551b7f47415e6dec73136f12bc6d8a18f67ed
MD5 ddfa4360920c1ae3144dbb6f53a4dbca
BLAKE2b-256 bd901ab26ffe24a34ef92026ac3862d1a64f4582d3a75a61525f295cc77f5d15

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractagent-0.3.9-py3-none-any.whl:

Publisher: release.yml on lpalbou/AbstractAgent

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