In this repository you will find a Python implementation of an LLM agent that can generate visualisations using public data available on the Internet.
An agent is essentially a wrapper around your LLM, that provides extra functionality like
-
Tool usage. The LLM is able to select and use tools, like internet search, to fetch relevant information it might need to accomplish the task.
-
Multi-step reasoning. The LLM can generate a plan, execute it, and adjust it based on the partial outcomes obtained.
The LLM acts as a reasoning machine, that helps the agent choose the sequence of actions to take to solve the task.
Let me show you how to build a ReAct (Reason and Act) agent in Python that can generate the plot we want.
-
Create Python virtual environment and install all dependencies using Python Poetry
$ make install
-
Set API keys for Tavily and Cohere in an
.env
file$ cp .env.sample .env
and replace placeholders with your keys.
-
Ask the agent to generate a plot example
$ make run-agent
Jon 15k+ builders to the the Real-World ML Newsletter, and learn to build real-world ML products.