Knowledge Base: is information that the Agent can search to improve its responses. This directory contains a series of cookbooks that demonstrate how to build a knowledge base for the Agent.
Note: Fork and clone this repository if needed
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
pip install -U pgvector "psycopg[binary]" sqlalchemy openai phidata
Install docker desktop first.
- Run using a helper script
./cookbook/run_pgvector.sh
- OR run using the docker run command
docker run -d \
-e POSTGRES_DB=ai \
-e POSTGRES_USER=ai \
-e POSTGRES_PASSWORD=ai \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v pgvolume:/var/lib/postgresql/data \
-p 5532:5432 \
--name pgvector \
phidata/pgvector:16
Eg: PDF URL Knowledge Base
- Install libraries
pip install -U pypdf bs4
- Run the PDF URL script
python cookbook/knowledge/pdf_url.py