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
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
export OPENAI_API_KEY=***
pip install -r cookbook/examples/auto_rag/requirements.txt
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
streamlit run cookbook/examples/auto_rag/app.py
-
Open localhost:8501 to view your RAG app.
-
Add websites or PDFs and ask question.
-
Example Website: https://techcrunch.com/2024/04/18/meta-releases-llama-3-claims-its-among-the-best-open-models-available/
-
Ask questions like:
- What did Meta release?
- Tell me more about the Llama 3 models?
- Whats the latest news from Meta?
- Summarize our conversation