Agent is combining LLM and self-defined tool. The core idea is we can use LLM to choose which action(=means tools) we want to take next and eventually to find out answer. By using our own defined tool, we can answer questions more accurately. For example, our tools can import our own documents or our tools can apply our own analysises.
Agent is based on ReAct Pattern(=Reason+Act).
pipenv shell
pipenv install
- need to update open api key in
.env.example
and change to.env
The repo includes 2 sample:
langchaing_csv_agent.py
: It is using langchaincreate_csv_agent
.csv_agent.py
: It is implement ReAct Pattern directly and also implement CSVReader as self-defined tool. The whole idea is referencing Simple ReAct Agent.