Metadata-Version: 2.4
Name: archytas
Version: 2.0.0b1
Summary: A library for pairing LLM agents with tools so they perform open ended tasks
Project-URL: Homepage, https://github.com/jataware/archytas
Project-URL: Bug Tracker, https://github.com/jataware/archytas/issues
Author-email: David Andrew Samson <david.andrew.engineer@gmail.com>, Matthew Printz <matt@jataware.com>
License: GPL-3.0-or-later
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.70
Requires-Dist: azure-ai-inference>=1.0.0b9
Requires-Dist: botocore>=1.37
Requires-Dist: docstring-parser>=0.16
Requires-Dist: frozendict>=2.3.8
Requires-Dist: jinja2>=3.1.6
Requires-Dist: langchain-anthropic>=1.0
Requires-Dist: langchain-aws>=1.0
Requires-Dist: langchain-community>=0.4
Requires-Dist: langchain-core>=1.0
Requires-Dist: langchain-google-genai>=4.2
Requires-Dist: langchain-groq>=1.0
Requires-Dist: langchain-mcp-adapters>=0.1.0
Requires-Dist: langchain-ollama>=1.0
Requires-Dist: langchain-openai>=1.0
Requires-Dist: langchain>=1.0
Requires-Dist: openai>=2.0
Requires-Dist: pydantic>=1.9.0
Requires-Dist: pytz>=2023.3
Requires-Dist: rich>=13.3.4
Requires-Dist: toki>=0.2.8
Requires-Dist: toml>=0.10.2
Provides-Extra: dev
Requires-Dist: easyrepl>=0.1.2; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: pytest-xdist; extra == 'dev'
Requires-Dist: pytest>=8.4.2; extra == 'dev'
Provides-Extra: testing
Requires-Dist: fastmcp>=0.1.0; extra == 'testing'
Requires-Dist: pytest-asyncio; extra == 'testing'
Requires-Dist: pytest-xdist; extra == 'testing'
Requires-Dist: pytest>=8.4.2; extra == 'testing'
Description-Content-Type: text/markdown

# Archytas: A Tools Interface for AI Agents
<img src="https://raw.githubusercontent.com/jataware/archytas/main/assets/logo.png" width="150" height="150" align="left" style="padding-right:0.5em;"/>

Implementation of the [ReAct (Reason & Action)](https://arxiv.org/abs/2210.03629) framework for Large Language Model (LLM) agents. Extensible to a variety of LLMs and LLM providers.

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.

<div style="clear:left;"></div>

# Demos

Short demo of using the `PythonTool` to download a COVID-19 dataset, and perform some basic processing/visualization/analysis/etc.
<div align="center">
  <a href="https://youtu.be/52e4xN8SIi8">
    <img src="https://raw.githubusercontent.com/jataware/archytas/main/assets/covid_repl_demo.gif" alt="Watch the video">
  </a>
  <br/>
  click to watch original video on youtube
</div>

## MCP Demos

```bash
# Install with MCP support (includes langchain-mcp-adapters + fastmcp)
uv pip install -e ".[mcp]"

# Vision demo with local MCP server
python demos/demo_mcp_vision.py

# External MCP server (DuckDuckGo search via npx)
python demos/demo_mcp_duckduckgo.py

# HTTP MCP server (Context7 - requires API key)
export CONTEXT7_API_KEY="your-api-key"
python demos/demo_mcp_context7.py
```
To use mcp tools with archytas, you will need to install the optional deps
`uv pip install -e ".[mcp]"`

Read the [mcp quick start doc](docs/MCP_QUICK_START.md)  for more info

# Quickstart
```bash
# clone and install
git clone git@github.com:jataware/archytas.git
cd archytas
uv pip install -e .

# 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
uv run chat-repl
```

# Simple Usage
Import pre-made tools from the tools module
```python
from archytas.react import ReActAgent, FailedTaskError
from archytas.tools import PythonTool

from easyrepl import REPL

# create the agent with the tools list or a `custom_prelude` (if desired)
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](https://github.com/jataware/archytas/wiki) for details.

