/agential

πŸ””πŸ§  Easily experiment with popular language agents across diverse reasoning/decision-making benchmarks!

Primary LanguagePythonMIT LicenseMIT

Language agent experimentation made easy.

codecov License: MIT

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.

πŸ€” Getting Started

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)

🧭 Project Organization


β”œβ”€β”€ 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.

πŸ™ Acknowledgement

πŸ˜€ Contributing

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!

πŸ˜Άβ€πŸŒ«οΈ Contact Us!

If you have any questions or suggestions, please feel free to reach out to tuvincent0106@gmail.com!