Code
knowledge.py
Usage
1
Set up your virtual environment
2
Set your API keys
3
Install dependencies
4
Set up PostgreSQL with pgvector
You need a PostgreSQL database with the pgvector extension installed. Adjust the
db_url in the code to match your database configuration.5
Run Agent
Save the code above as
knowledge.py, then run:6
For subsequent runs
After the first run, comment out the
knowledge.insert(...) line to avoid reloading the PDF.