python/ai/rag_agent/README.md
A lightweight, high-performance Python RAG Agent built with FastAPI for RAG (Retrieval-Augmented Generation) text preprocessing operations alongside YugabyteDB.
Ubuntu System Dependencies
sudo apt-get update && sudo apt-get install -y tesseract-ocr libtesseract-dev leptonica-dev
sudo apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1
sudo apt-get install -y libpq-dev
sudo apt-get install -y poppler-utils
Python Dependencies
Pre-req: Install UV
uv venv --python=3.11
source .venv/bin/activate
uv pip install -r requirements.txt
pip install -r requirements.txt
Set environment variables for YugabyteDB connection:
export OPENAI_API_KEY=
export YUGABYTEDB_CONNECTION_STRING="postgresql://yugabyte:@127.0.0.1:5433/yugabyte"
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_REGION=us-east-2
export AWS_S3_BUCKET_NAME=
python start_rag_agent.py