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.6.tar.gz (84.1 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.6-py3-none-any.whl (78.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstractagent-0.3.6.tar.gz
  • Upload date:
  • Size: 84.1 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.6.tar.gz
Algorithm Hash digest
SHA256 7479bd61888366c2317e88c0c8f060777405388c2d237fff607c27f836d6435a
MD5 0942438b9ec1556f397f69abca26fc35
BLAKE2b-256 98b1c79126a5f29b4286629a572caaa667286e8e72dc4fe82357e793ae483993

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractagent-0.3.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: abstractagent-0.3.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4942a295f0d6fe042b3da451d75fc09e8def4b34650b8226773dcc9af8c947ec
MD5 32e6ed129cb0d63f2bd7079dbfe7bae8
BLAKE2b-256 9019c611f455b1a378ab682087935a7d343956065b27f03173b42741ff08cb3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractagent-0.3.6-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