This project is a simple AI agent powered by Groq cloud (via LangChain), delivered through a Flask backend.
- Fast, production-ready backend (Flask)
- Modular integration with Groq's LLM via LangChain
- Runs on Windows, Linux, and macOS
Details
The Python version needs to be the same as mentioned in the .tool-versions file.
Make sure the correct Python version has been set up using asdf before you work on this project.
python3 --version
Details
-
The Python version needs to be the same as mentioned in the
.python-versionfile using pyenv-win. -
Make sure the correct Python version has been set by running
python --version
- Go to Groq and create API Key
- Put your Groq API key in
code/.envfile
- Install and setup PostgreSQL in you local
- Adjust your username and password in
code/.envfile
git clone https://github.com/Madhyamakist/ai-agent-boilerplate.git myprojectDetails
- To create a virtual environment called "venv", runpython -m venv venv- To activate the environment
venv\Scripts\activateDetails
- Create a virtual environment named "venv",
python3 -m venv venv- To activate the environment
source venv/bin/activateAfter activating your virtual environment, install dependencies by
cd code
pip install -r requirements.txtCope .env.example into .env (gitignored).
cp .env.example .env
Replace the values (get it from team members?)
GROQ_API_KEY=randomstring
DATABASE_URL=postgresql://username:password@localhost:5432/
If virtual environment is activated and dependencies are installed then run chatbot by:
cd code
python app.pyNow visit http://127.0.0.1:5000/ in your browser. For newer APIs visit http://127.0.0.1:5001/api/docs.
If flask is rendered successfully, then test APIs by:
cd code/test
pytest --html=test_report.html --self-contained-html -vUsing ruff (example inside code/)
ruff check app.py --fix