Skip to content

georgetsouvaltzis/agents-react-pattern

Repository files navigation

Agents ReAct pattern

From scratch implementation of the ReAct pattern for agents that basically approaches user's request in Thought/Action/Observation manner with tool calling support

Project Structure

Directories

  • notebooks contains init_playground.ipynb that served as a playground during testing/implementation phase.

Files

  • extraction_result.py a simple python dataclass that contrains extracted content information
  • message.py simple python dataclass that contains role and content of the message.
  • react_agent.py implementation of the ReAct agent that leverages groq to interact with LLM
  • tool.py helper class to construct list of available tools for LLM
  • main.py contains base usage of the ReactAgent and contains predefined tools + message

Usage

To run the project first you need to clone the repository

git clone https://github.com/georgetsouvaltzis/agents-react-pattern.git

then navigate to project repo by using

cd agents-react-pattern

create .env file based on .env.example

cp .env.example .env

supply the GROQ_API_KEY(required) in .env file

GROQ_API_KEY=<"your-key-here">

create virtual environment(.venv) and activate by typing:

python3 -m venv .venv
source .venv/bin/activate

install the project requirements:

pip install -r requirements.txt

to see an example run the main.py by using:

python main.py

About

From scratch implementation of the agents ReAct pattern.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors