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
  • Generation controls: temperature, seed, media policy, prompt-cache binding, and Core thinking are normalized before LLM calls
  • 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] and abstractagent[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.12.tar.gz (84.7 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.12-py3-none-any.whl (79.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstractagent-0.3.12.tar.gz
  • Upload date:
  • Size: 84.7 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.12.tar.gz
Algorithm Hash digest
SHA256 530de9e42ddce23bf33f4df41e4e35bb05d989243511c6812047f791470214c6
MD5 b95ecba6766c58fee4d53b79e6d16edc
BLAKE2b-256 042a1d760735d600703dbb9e9ef0200a0167f4eccefcf639f0508b32400f2174

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: abstractagent-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 79.0 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 abdc94c7560de5ebe37fc8b1ed51eb159d7d81050bbf0ef106d2148cffd540fb
MD5 91b1a7c314ea1b58011ffd389b873964
BLAKE2b-256 7230458288dd81aa8ac3177c615696430ad1a29e3f15d9511e7424899230a399

See more details on using hashes here.

Provenance

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