gitmyhub

agents

Python ★ 5.9k updated 1y ago

An Open-source Framework for Data-centric, Self-evolving Autonomous Language Agents

A Python framework for building AI agents that improve themselves by rewriting their own instructions after each task attempt, using a training-loop approach applied to language model prompts.

Pythonpipsetup: moderatecomplexity 3/5

Agents 2.0 is a Python framework for building AI agents that can learn and improve themselves over time. An AI agent here means a program powered by a large language model (an AI text system) that can take a sequence of steps, use tools, and produce outputs in response to a goal. Most agent frameworks treat the AI's instructions and behavior as fixed once deployed. This project tries a different approach: making those components trainable.

The core idea is called symbolic learning. The framework borrows concepts from how neural networks are trained, applying them to language-based agents. A typical training run works like this: the agent executes a task (the forward pass), stores what happened at each step, then evaluates how well it did using a language-based scoring method. It then works backward through those steps producing written analyses (called language gradients) describing what went wrong or could improve at each stage. Finally, the agent uses those analyses to rewrite its own prompts and tool usage, updating itself for the next attempt.

This process is designed to let an agent get better at a task through repeated attempts without a human rewriting its instructions by hand. The framework also supports multi-agent setups where several agents work together as nodes in a pipeline, and the same learning process can improve how those agents coordinate.

Version 2.0, released in mid-2024, added the symbolic learning and evaluation features. Installation is via pip from the GitHub repository. The project is accompanied by a research paper on arXiv (arxiv.org/abs/2406.18532) that describes the method in detail. Documentation is hosted separately at agentsv2.readthedocs.io. The code is released under the Apache 2.0 license.

Where it fits