Documentation: https://ChrisPappalardo.github.io/agent_fred
Source Code: https://github.com/ChrisPappalardo/agent_fred
Agentic LLM interface for Federal Reserve Economic Data ("FRED") using a locally-hosted open-source Large Language Model.
FRED is hosted and maintained by the St. Louis Federal Reserve Bank. Please see the FRED Terms of Use for permissible use, copyright and other legal restrictions, and additional information.
This project assumes you have Linux or Windows running WSL2. I have not tested it with macOS. You do not need a GPU to run this application.
This python app requires ollama to host and serve LLM API. Select your platform and follow the ollama installation directions.
You will also need to download whatever model(s) you intend to use. The default is Microsoft's 3B phi3 LLM for both the agent and chat pipelines. After installing ollama you can install phi3 with:
ollama pull phi3You will need Poetry and at least python 3.10.
Clone this repository:
git clone https://github.com/ChrisPappalardo/agent_fred.gitCreate a poetry shell inside the directory and install the requirements:
cd agent_fred
poetry shell
poetry installThis python app uses environment variables to configure the AI backend and other variables. See src/agent_fred/config.py.
If you use the phi3 LLM you don't need to set anything but the FRED_API_KEY, which you can obtain here:
export FRED_API_KEY=1234You can also set your config environment in .env in the project root:
FRED_API_KEY=123The configurable options are as follows:
FRED_API_KEYAPI key to use when making calls to the FREDFRED_LLMLLM to use with Agent FRED (default=phi3)FRED_TEMPERATUREverbosity of the model (default=0.0)
Agent FRED has both a command-line interface and a web application.
To use the web application (recommended):
python app.pyNavigate to http://127.0.0.1:7860 to view the app:
You can also use the CLI, which returns API results in JSON:
python src/agent_fred/chat.pyIt typically helps to have an understanding of the data available from the FRED API.
An example script you can use to test the application:
What data is available from the FRED?What is GDP and how is it calculated?What was GDP from 2000-01-01 through 2023-12-31?Why did it dip in 2020?
In the web app you can clear the LLM's memory and start a new Q&A session with the Clear button.
Enjoy!
If you're developing with Agent FRED, you can run the unit tests using the Makefile like so:
make testYou can run the linters using pre-commit:
make pre-commitThe documentation is automatically generated from the content of the docs directory and from the docstrings of the public signatures of the source code. The documentation is updated and published as a Github Pages page automatically as part each release.



