tapeagents

TapeAgents is a framework that facilitates all stages of the LLM Agent development lifecycle

https://github.com/servicenow/tapeagents

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

agentic agents ai-agents finetuning llm-agent multi-agent multi-agent-simulation prompt-tuning
Last synced: 6 months ago · JSON representation ·

Repository

TapeAgents is a framework that facilitates all stages of the LLM Agent development lifecycle

Basic Info
Statistics
  • Stars: 294
  • Watchers: 12
  • Forks: 36
  • Open Issues: 29
  • Releases: 17
Topics
agentic agents ai-agents finetuning llm-agent multi-agent multi-agent-simulation prompt-tuning
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Citation Notice

README.md

TapeAgents

PyPI - Version GitHub Release Documentation Paper Build Status Tests Status


TapeAgents Logo

TapeAgents is a framework that leverages a structured, replayable log (Tape) of the agent session to facilitate all stages of the LLM Agent development lifecycle. In TapeAgents, the agent reasons by processing the tape and the LLM output to produce new thoughts, actions, control flow steps and append them to the tape. The environment then reacts to the agent’s actions by likewise appending observation steps to the tape.

Why TapeAgents

Key features:

  • Build your agent as a low-level state machine, as a high-level multi-agent team configuration, or as a mono-agent guided by multiple prompts
  • Debug your agent with TapeAgent studio or TapeBrowser apps
  • Serve your agent with response streaming
  • Optimize your agent's configuration using successful tapes; finetune the LLM using revised tapes.

The Tape-centric design of TapeAgents will help you at all stages of your project:

  • Build with ultimate flexibility of having access to tape for making prompts and generating next steps
  • Change your prompts or team structure and resume the debug session as long as the new agent can continue from the older tape
  • Fully control the Agent's tape and the Agent's acting when you use a TapeAgent in an app
  • Optimize tapes and agents using the carefully crafted metadata structure that links together tapes, steps, llm calls and agent configurations

TapeAgents at a glance

TapeAgents Overview

Getting Started

Tutorial

Start with the introductory Jupyter notebook to quickly learn the core concepts of the framework.

Hello TapeAgents

The simplest agent just to show the basic structure of the agent:

```python from tapeagents.agent import Agent, Node from tapeagents.core import Prompt from tapeagents.dialogtape import AssistantStep, UserStep, DialogTape from tapeagents.llms import LLMStream, LiteLLM from tapeagents.prompting import tapeto_messages

llm = LiteLLM(model_name="gpt-4o-mini")

class MainNode(Node): def makeprompt(self, agent: Agent, tape: DialogTape) -> Prompt: # Render the whole tape into the prompt, each step is converted to message return Prompt(messages=tapeto_messages(tape))

def generate_steps(self, agent: Agent, tape: DialogTape, llm_stream: LLMStream):
    # Generate single tape step from the LLM output messages stream.
    yield AssistantStep(content=llm_stream.get_text())

agent = Agent[DialogTape].create(llm, nodes=[MainNode()]) starttape = DialogTape(steps=[UserStep(content="Tell me about Montreal in 3 sentences")]) finaltape = agent.run(starttape).getfinaltape() # agent will start executing the first node print(f"Final tape: {finaltape.modeldumpjson(indent=2)}") ```

TapeAgents Examples

The examples/ directory contains examples of how to use the TapeAgents framework for building, debugging, serving and improving agents. Each example is a self-contained Python script (or module) that demonstrates how to use the framework to build an agent for a specific task:

Other notable examples that demonstrate the main aspects of the framework:

To run these examples, simply use:

zsh uv run -m examples.<MODULE> <ARGS>

Installation

Install the latest release with its minimal dependencies:

zsh pip install tapeagents

You can also install converters and finetune optional dependencies

zsh pip install 'tapeagents[converters,finetune]'

Building from source

  1. Install uv to manage package:

Official documentation here

  1. Clone the repository:

zsh git clone https://github.com/ServiceNow/TapeAgents.git cd TapeAgents

  1. Create venv environment and install dependencies:

```zsh make setup

equivalent to uv sync --all-extras

```

Learn more

See our full TapeAgents documentation.

For an in-depth understanding of the design principles, architecture, and research behind TapeAgents, see our technical report.

Contacts

Feel free to reach out to the team:

Acknowledgements

We acknowledge the inspiration we took from prior frameworks, in particular LangGraph, AutoGen, AIWaves Agents and DSPy.

Owner

  • Name: ServiceNow
  • Login: ServiceNow
  • Kind: organization

Works for you™

Citation (CITATION.cff)

cff-version: 1.2.0
title: >-
  TapeAgents: a Holistic Framework for Agent Development and
  Optimization
message: 'If you want to refer to our paper or code, please cite it as below.'
type: software
authors:
  - family-names: Bahdanau
    given-names: Dzmitry
  - family-names: Gontier
    given-names: Nicolas
  - family-names: Huang
    given-names: Gabriel
  - family-names: Kamalloo
    given-names: Ehsan
  - family-names: Pardinas
    given-names: Rafael
  - family-names: Piché
    given-names: Alex
  - family-names: Scholak
    given-names: Torsten
  - family-names: Shliazhko
    given-names: Oleh
  - family-names: Jordan Prince
    given-names: Tremblay
  - family-names: Ghanem
    given-names: Karam
  - family-names: Parikh
    given-names: Soham
  - family-names: Tiwari
    given-names: Mitul
  - family-names: Vohra
    given-names: Quaizar
identifiers:
  - type: url
    value: 'https://arxiv.org/abs/2412.08445'
repository-code: 'https://github.com/ServiceNow/TapeAgents'
abstract: >-
  TapeAgents is a framework that facilitates all stages of
  the LLM Agent development lifecycle.
license: Apache-2.0
date-released: '2024-10-16'

GitHub Events

Total
  • Create event: 148
  • Commit comment event: 2
  • Release event: 12
  • Delete event: 91
  • Member event: 7
  • Pull request event: 248
  • Fork event: 29
  • Issues event: 36
  • Watch event: 267
  • Issue comment event: 101
  • Public event: 1
  • Push event: 1,421
  • Pull request review comment event: 321
  • Pull request review event: 381
Last Year
  • Create event: 148
  • Commit comment event: 2
  • Release event: 12
  • Delete event: 91
  • Member event: 7
  • Pull request event: 248
  • Fork event: 29
  • Issues event: 36
  • Watch event: 267
  • Issue comment event: 101
  • Public event: 1
  • Push event: 1,421
  • Pull request review comment event: 321
  • Pull request review event: 381

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 78
  • Average time to close issues: N/A
  • Average time to close pull requests: 12 days
  • Total issue authors: 6
  • Total pull request authors: 12
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.41
  • Merged pull requests: 47
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 8
  • Pull requests: 78
  • Average time to close issues: N/A
  • Average time to close pull requests: 12 days
  • Issue authors: 6
  • Pull request authors: 12
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.41
  • Merged pull requests: 47
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rizar (13)
  • ollmer (3)
  • AlexPiche (3)
  • gabrielhuang (3)
  • haozaiiii (2)
  • XvHaidong (1)
  • mitultiwari (1)
  • sky-fly97 (1)
  • emrecanacikgoz (1)
Pull Request Authors
  • ollmer (45)
  • AlexPiche (22)
  • jpt-sn (21)
  • rizar (18)
  • danieltremblay (9)
  • NicolasAG (5)
  • gabrielhuang (5)
  • rafapi (5)
  • ehsk (4)
  • dependabot[bot] (2)
  • mitultiwari (1)
  • amilios (1)
  • christyler3030 (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 3,242 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 19
  • Total maintainers: 2
pypi.org: tapeagents

TapeAgents framework for building, tuning and evaluating LLM Agents

  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,242 Last month
Rankings
Dependent packages count: 10.0%
Average: 33.0%
Dependent repos count: 56.1%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/python-tests.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
examples/optimize/requirements.txt pypi
  • dspy-ai ==2.4.10
pyproject.toml pypi
requirements.converters.txt pypi
  • SpeechRecognition ==3.10.4
  • easyocr ==1.7.1
  • lxml ==5.2.2
  • mammoth ==1.8.0
  • markdownify ==0.13.1
  • openpyxl ==3.1.5
  • pandas ==2.2.2
  • pdfminer ==20191125
  • pdfminer.six ==20240706
  • puremagic ==1.26
  • pydub ==0.25.1
  • pyparsing ==3.1.2
  • python-pptx ==0.6.23
  • readability-lxml *
  • xlrd ==2.0.1
  • youtube-transcript-api ==0.6.2
requirements.dev.txt pypi
  • dspy-ai ==2.4.10 development
  • flake8 ==6.0.0 development
  • nbconvert ==7.16.4 development
  • pytest ==8.3.3 development
  • ruff ==0.6.6 development
  • testbook ==0.4.2 development
requirements.finetune.txt pypi
  • accelerate ==0.34.2
  • datasets ==2.21.0
  • deepspeed ==0.15.1
  • numpy ==1.26.4
  • peft ==0.12.0
  • transformers ==4.44.2
  • trl ==0.10.1
  • wandb ==0.17.8
requirements.txt pypi
  • Levenshtein ==0.25.1
  • beautifulsoup4 ==4.12.3
  • browsergym ==0.3.5
  • fastapi ==0.112.4
  • googlesearch-python ==1.2.4
  • gradio ==4.39.0
  • hydra-core ==1.3.2
  • ipykernel ==6.29.5
  • ipywidgets ==8.1.5
  • jsonref ==1.1.0
  • langchain-community ==0.0.38
  • langchain-core ==0.1.52
  • litellm ==1.37.9
  • matplotlib ==3.9.0
  • pathvalidate ==3.2.0
  • podman ==5.0
  • pydantic ==2.9.1
  • seaborn ==0.13.2
  • tavily-python ==0.3.4
  • termcolor ==2.4.0
  • transformers ==4.44.2
examples/rl_gsm8k/requirements.txt pypi
  • vllm ==0.6.3
requirements.rl.txt pypi
  • vllm ==0.6.1