TapeAgents

ServiceNowApache-2.0更新放缓

覆盖 LLM Agent 开发全流程的框架,从提示调优、微调到多智能体仿真都能一站式搞定,省去自己拼装各阶段工具链的麻烦。

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

v0.1.16发布于 2025-08-19 16:39 UTC320star44fork同步于 2026-11-07 07:29 UTC

怎么上手

由 README 提炼,执行前请确认
pip install tapeagents
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用可回放的结构化日志 Tape 贯穿 LLM Agent 开发全流程的框架

覆盖 LLM Agent 开发全流程的框架,从提示调优、微调到多智能体仿真都能一站式搞定,省去自己拼装各阶段工具链的麻烦。

核心能力

  • 把 Agent 会话记录成可回放的结构化 Tape 日志
  • 支持状态机、多 Agent 团队、多提示单 Agent 三种构建方式
  • 用 TapeAgent studio 或 TapeBrowser 调试 Agent
  • 支持响应流式服务 Agent
  • 用成功或修订过的 Tape 优化配置并微调 LLM

容易踩的坑

示例需用 uv run -m examples. 运行,需先装 uv;微调与转换器功能要额外安装 tapeagents[converters,finetune];示例默认调用 gpt-4o-mini,需自备对应 LLM 访问凭证

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.1.16
  1. v0.1.16最新正式版2025-08-19 · 2025-08-19 16:39 UTC

    这个版本没有写更新说明。

  2. v0.1.152025-06-18 · 2025-06-18 10:20 UTC

    这个版本没有写更新说明。

  3. v0.1.142025-06-17 · 2025-06-17 17:09 UTC

    这个版本没有写更新说明。

  4. v0.1.13Remote Environments2025-06-17 · 2025-06-17 15:33 UTC
    查看更新说明

    New module that allows to run remote server with multiple environment and the class to connect to them from your agent.

  5. v0.1.122025-05-29 · 2025-05-29 14:35 UTC
    查看更新说明

    Example of the RL training of the web agent solving Miniwob benchmark.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    TapeAgents

    PyPI - Version GitHub Release Documentation Paper Build Status Tests Status


    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:

    from tapeagents.agent import Agent, Node
    from tapeagents.core import Prompt
    from tapeagents.dialog_tape import AssistantStep, UserStep, DialogTape
    from tapeagents.llms import LLMStream, LiteLLM
    from tapeagents.prompting import tape_to_messages
    
    llm = LiteLLM(model_name="gpt-4o-mini")
    
    
    class MainNode(Node):
        def make_prompt(self, agent: Agent, tape: DialogTape) -> Prompt:
            # Render the whole tape into the prompt, each step is converted to message
            return Prompt(messages=tape_to_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()])
    start_tape = DialogTape(steps=[UserStep(content="Tell me about Montreal in 3 sentences")])
    final_tape = agent.run(start_tape).get_final_tape()  # agent will start executing the first node
    print(f"Final tape: {final_tape.model_dump_json(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:

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

    Installation

    Install the latest release with its minimal dependencies:

    pip install tapeagents
    

    You can also install converters and finetune optional dependencies

    pip install 'tapeagents[converters,finetune]'
    

    Building from source

    1. Install uv to manage package:

    Official documentation here

    1. Clone the repository:
    git clone https://github.com/ServiceNow/TapeAgents.git
    cd TapeAgents
    
    1. Create venv environment and install dependencies:
    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.