jacobweiss2305 / pdf-ai-streamlit-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autonomous RAG

This cookbook shows how to do Autonomous retrieval-augmented generation with GPT4.

Auto-RAG is just a fancy name for giving the LLM tools like "search_knowledge_base", "read_chat_history", "search_the_web" and letting it decide how to retrieve the information it needs to answer the question.

Note: Fork and clone this repository if needed

1. Create a virtual environment

python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate

2. Export OPENAI_API_KEY

export OPENAI_API_KEY=***

3. Install libraries

pip install -r cookbook/examples/auto_rag/requirements.txt

4. Run PgVector

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

5. Run Autonomous RAG App

streamlit run cookbook/examples/auto_rag/app.py

6. Message on discord if you have any questions

7. Star ⭐️ the project if you like it.

8. Share with your friends: https://git.new/auto-rag

About


Languages

Language:Python 100.0%