{"id":31753725,"url":"https://github.com/servicenow/tapeagents","last_synced_at":"2025-10-09T17:53:52.398Z","repository":{"id":258333368,"uuid":"856917013","full_name":"ServiceNow/TapeAgents","owner":"ServiceNow","description":"TapeAgents is a framework that facilitates all stages of the LLM Agent development lifecycle","archived":false,"fork":false,"pushed_at":"2025-09-26T19:42:22.000Z","size":196864,"stargazers_count":296,"open_issues_count":30,"forks_count":37,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-09-26T21:06:08.441Z","etag":null,"topics":["agentic","agents","ai-agents","finetuning","llm-agent","multi-agent","multi-agent-simulation","prompt-tuning"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2412.08445","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ServiceNow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-13T13:03:23.000Z","updated_at":"2025-09-16T09:07:30.000Z","dependencies_parsed_at":"2024-11-19T18:35:53.100Z","dependency_job_id":"1a6446a8-e8b7-47e9-bd91-5021c136232e","html_url":"https://github.com/ServiceNow/TapeAgents","commit_stats":null,"previous_names":["servicenow/tapeagents"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/ServiceNow/TapeAgents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceNow%2FTapeAgents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceNow%2FTapeAgents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceNow%2FTapeAgents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceNow%2FTapeAgents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ServiceNow","download_url":"https://codeload.github.com/ServiceNow/TapeAgents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceNow%2FTapeAgents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001805,"owners_count":26083197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic","agents","ai-agents","finetuning","llm-agent","multi-agent","multi-agent-simulation","prompt-tuning"],"created_at":"2025-10-09T17:53:50.641Z","updated_at":"2025-10-09T17:53:52.392Z","avatar_url":"https://github.com/ServiceNow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TapeAgents\n\n[![PyPI - Version](https://img.shields.io/pypi/v/TapeAgents?logo=pypi\u0026logoColor=white)](https://pypi.org/project/TapeAgents/)\n[![GitHub Release](https://img.shields.io/github/v/release/ServiceNow/TapeAgents?logo=bookstack\u0026logoColor=white)](https://github.com/ServiceNow/TapeAgents/releases)\n[![Documentation](https://img.shields.io/badge/MkDocs-Documentation-blue?logo=materialformkdocs\u0026logoColor=white)](https://servicenow.github.io/TapeAgents/)\n[![Paper](https://img.shields.io/badge/Arxiv-Paper-B31B1B?logo=arxiv)](https://arxiv.org/abs/2412.08445)\n![Build Status](https://github.com/ServiceNow/TapeAgents/actions/workflows/build.yml/badge.svg)\n![Tests Status](https://github.com/ServiceNow/TapeAgents/actions/workflows/python-tests.yml/badge.svg)\n\n---\n\n\u003cimg src=\"assets/logo.jpg\" width=\"250\" align=\"left\" alt= \"TapeAgents Logo\" style=\"margin-right: 30px; margin-bottom: 30px\"/\u003e\n\n**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.\n\n## Why TapeAgents\n\nKey features:\n\n- 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\n- Debug your agent with TapeAgent studio or TapeBrowser apps\n- Serve your agent with response streaming\n- Optimize your agent's configuration using successful tapes; finetune the LLM using revised tapes.\n\nThe Tape-centric design of TapeAgents will help you at all stages of your project:\n\n- Build with ultimate flexibility of having access to tape for making prompts and generating next steps\n- Change your prompts or team structure and resume  the debug session as long as the new agent can continue from the older tape\n- Fully control the Agent's tape and the Agent's acting when you use a TapeAgent in an app\n- Optimize tapes and agents using the carefully crafted metadata structure that links together tapes, steps, llm calls and agent configurations\n\n## TapeAgents at a glance\n\n![TapeAgents Overview](assets/overview.jpg)\n\n## Getting Started\n\n### Tutorial\n\nStart with the [introductory Jupyter notebook](https://github.com/ServiceNow/TapeAgents/blob/main/intro.ipynb) to quickly learn the core concepts of the framework.\n\n### Hello TapeAgents\n\nThe simplest agent just to show the basic structure of the agent:\n\n```python\nfrom tapeagents.agent import Agent, Node\nfrom tapeagents.core import Prompt\nfrom tapeagents.dialog_tape import AssistantStep, UserStep, DialogTape\nfrom tapeagents.llms import LLMStream, LiteLLM\nfrom tapeagents.prompting import tape_to_messages\n\nllm = LiteLLM(model_name=\"gpt-4o-mini\")\n\n\nclass MainNode(Node):\n    def make_prompt(self, agent: Agent, tape: DialogTape) -\u003e Prompt:\n        # Render the whole tape into the prompt, each step is converted to message\n        return Prompt(messages=tape_to_messages(tape))\n\n    def generate_steps(self, agent: Agent, tape: DialogTape, llm_stream: LLMStream):\n        # Generate single tape step from the LLM output messages stream.\n        yield AssistantStep(content=llm_stream.get_text())\n\n\nagent = Agent[DialogTape].create(llm, nodes=[MainNode()])\nstart_tape = DialogTape(steps=[UserStep(content=\"Tell me about Montreal in 3 sentences\")])\nfinal_tape = agent.run(start_tape).get_final_tape()  # agent will start executing the first node\nprint(f\"Final tape: {final_tape.model_dump_json(indent=2)}\")\n```\n\n### TapeAgents Examples\n\nThe [examples/](https://github.com/ServiceNow/TapeAgents/tree/main/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:\n\n- How to build a single agent that [does planning, searches the web and uses code interpreter](https://github.com/ServiceNow/TapeAgents/tree/main/examples/gaia_agent) to answer knowledge-grounded questions, solving the tasks from the [GAIA benchmark](https://huggingface.co/spaces/gaia-benchmark/leaderboard).\n- How to build [a team of TapeAgents](https://github.com/ServiceNow/TapeAgents/tree/main/examples/data_science) with [AutoGen](https://github.com/microsoft/autogen)-style low-code programming paradigm\n- How to [finetune a TapeAgent](https://github.com/ServiceNow/TapeAgents/tree/main/examples/gsm8k_tuning) with a small LLM to be better at math problem solving on GSM-8k dataset.\n\nOther notable examples that demonstrate the main aspects of the framework:\n\n- [workarena](https://github.com/ServiceNow/TapeAgents/tree/main/examples/workarena) - custom agent that solves [WorkArena](https://github.com/ServiceNow/WorkArena) benchmark using [BrowserGym](https://github.com/ServiceNow/BrowserGym) environment.\n- [tape_improver.py](https://github.com/ServiceNow/TapeAgents/tree/main/examples/tape_improver) - the agent that revisit and improves the tapes produced by another agent.\n\nTo run these examples, simply use:\n\n```zsh\nuv run -m examples.\u003cMODULE\u003e \u003cARGS\u003e\n```\n\n## Installation\n\nInstall the latest release with its minimal dependencies:\n\n```zsh\npip install tapeagents\n```\n\nYou can also install converters and finetune optional dependencies\n\n```zsh\npip install 'tapeagents[converters,finetune]'\n```\n\n## Building from source\n\n0. Install uv to manage package:\n\nOfficial documentation [here](https://docs.astral.sh/uv/getting-started/installation/)\n\n1. Clone the repository:\n\n```zsh\ngit clone https://github.com/ServiceNow/TapeAgents.git\ncd TapeAgents\n```\n\n2. Create `venv` environment and install dependencies:\n\n```zsh\nmake setup\n# equivalent to `uv sync --all-extras`\n```\n\n## Learn more\n\nSee our full TapeAgents [documentation](https://servicenow.github.io/TapeAgents/).\n\nFor an in-depth understanding of the design principles, architecture, and research behind TapeAgents, see our [technical report](https://arxiv.org/abs/2412.08445).\n\n## Contacts\n\nFeel free to reach out to the team:\n\n- Dzmitry Bahdanau, \u003cdzmitry.bahdanau@servicenow.com\u003e\n- Oleh Shliazhko, \u003coleh.shliazhko@servicenow.com\u003e\n- Jordan Prince Tremblay, \u003cjordanprince.t@servicenow.com\u003e\n- Alexandre Piché, \u003calexandre.piche@servicenow.com\u003e\n\n## Acknowledgements\n\nWe acknowledge the inspiration we took from prior frameworks, in particular [LangGraph](https://github.com/langchain-ai/langgraph), [AutoGen](https://github.com/microsoft/autogen), [AIWaves Agents](https://github.com/aiwaves-cn/agents) and [DSPy](https://github.com/stanfordnlp/dspy).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservicenow%2Ftapeagents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fservicenow%2Ftapeagents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservicenow%2Ftapeagents/lists"}