Skip to main content

A library for pairing LLM agents with tools so they perform open ended tasks

Project description

Archytas: A Tools Interface for AI Agents

Implementation of the ReAct (Reason & Action) framework for Large Language Model (LLM) agents. Mainly targeting OpenAI's GPT-4.

Easily create tools from simple python functions or classes with the @tool decorator. A tools list can then be passed to the ReActAgent which will automagically generate a prompt for the LLM containing usage instructions for each tool, as well as manage the ReAct decision loop while the LLM performs its task.

Tools can be anything from internet searches to custom interpreters for your domain. Archytas provides a few built-in demo tools e.g. datetime, fibonacci numbers, and a simple calculator.

Demo

Short demo of using the PythonTool to download a COVID-19 dataset, and perform some basic processing/visualization/analysis/etc.

Watch the video
click to watch original video on youtube

Quickstart

# make sure poetry is installed
pip install poetry

# clone and install
git clone git@github.com:jataware/archytas.git
cd archytas
poetry install

# make sure OPENAI_API_KEY var is set
# or pass it in as an argument to the agent
export OPENAI_API_KEY="sk-..."

# run demo
poetry run chat-repl

Simple Usage

Import pre-made tools from the tools module

from archytas.react import ReActAgent, FailedTaskError
from archytas.tools import PythonTool

from easyrepl import REPL

# create the agent with the tools list
some_tools = [PythonTool, ..., etc.]
agent = ReActAgent(tools=some_tools, verbose=True)

# REPL to interact with agent
for query in REPL():
    try:
        answer = agent.react(query)
        print(answer)
    except FailedTaskError as e:
        print(f"Error: {e}")

Documentation

See the wiki docs for details.

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

archytas-1.2.2.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

archytas-1.2.2-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file archytas-1.2.2.tar.gz.

File metadata

  • Download URL: archytas-1.2.2.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for archytas-1.2.2.tar.gz
Algorithm Hash digest
SHA256 8ffd681971cb8cde60ba4ebcecf751f8bd1f47a5ea1bfd3d0dff24ef649785b2
MD5 038959d1c81c93a4d43befdeac2f39a0
BLAKE2b-256 c640240e0da5f836e53a75be324e0b18ce7b0bfba3bd9370920418baa85ee816

See more details on using hashes here.

Provenance

The following attestation bundles were made for archytas-1.2.2.tar.gz:

Publisher: publish.yml on jataware/archytas

Attestations:

File details

Details for the file archytas-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: archytas-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for archytas-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ce78922b4fbe6ec6416a0f7f211a13c27ab7b2fb27aad9c290c6d93d64080f42
MD5 c51156efac07115f227cc2161a537bd3
BLAKE2b-256 da4bef17a81542d2585aec9e92359af014876fdeda4f72489be71504e9cb90d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for archytas-1.2.2-py3-none-any.whl:

Publisher: publish.yml on jataware/archytas

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page