Agential provides clear implementations of popular LLM-based agents across a variety of reasoning/decision-making and language agent benchmarks, making it easy for researchers to evaluate and compare different agents.
First, install the library with pip
:
pip install agential
Next, let's query the ReActAgent
!
from agential.llm.llm import LLM
from agential.cog.react.agent import ReActAgent
question = 'Who was once considered the best kick boxer in the world, however he has been involved in a number of controversies relating to his "unsportsmanlike conducts" in the sport and crimes of violence outside of the ring?'
llm = LLM("gpt-3.5-turbo")
agent = ReActAgent(llm=llm, benchmark="hotpotqa")
out = agent.generate(question=question)
βββ agential <- Source code for this project.
β βββ cog
β β βββ agent <- Model/agent-related modules.
β β β βββ strategies <- Strategies encapsulate agent logic for each benchmark/benchmark type.
β β β β βββ base.py
β β β β βββ qa.py
β β β β βββ math.py
β β β β βββ code.py
β β β β
β β β βββ agent.py <- Agent class responsible for selecting the correct strategy, prompts/few-shots, and generating responses.
β β β βββ functional.py <- Functional methods for agent. The lowest level of abstraction.
β β β βββ output.py <- Output class responsible for formatting the response from the agents.
β β β βββ prompts.py <- Prompt templates.
β β β βββ <modules>.py <- Any additional modules you may have for the strategies. Agnostic to benchmarks/benchmark-types.
β β
β βββ eval <- Evaluation-related modules.
β β
β βββ llm <- LLM class.
β β
β βββ utils <- Utility methods.
β
βββ docs <- An mkdocs project.
β
βββ notebooks <- Jupyter notebooks. Naming convention is a number
β (for ordering), the creator's initials, and a short `-` delimited β description, e.g. `1.0-jqp-initial-data-exploration`.
β
βββ references <- Data dictionaries, manuals, and all other explanatory materials.
β
βββ reports <- Generated analysis as HTML, PDF, LaTeX, etc.
β βββ figures <- Generated graphics and figures to be used in reporting.
β
βββ tests <- Tests.
If you want to contribute, please check the contributing.md for guidelines! Please check out the project document timeline on Notion and reach out to us if you have any questions!
If you have any questions or suggestions, please feel free to reach out to tuvincent0106@gmail.com!