A template code to build RAG retriever API quickly.
- Python 3.8+
- pipenv
- postgres 15+
- pgvector
- DATABASE_URL
- OPENAI_API_KEY
- pipenv install
- source .env
- open knowledge.txt, update the knowledge content
- python inject_data.py #for onetime of data into vector store
- uvicorn main:app --reload
- install postgres.app - https://postgresapp.com/downloads.html
- download postgres15+
- start a postgres server version 15+
- Run the sql command in sql query interface(postgres client of your choice - pgadmin, postico)
CREATE EXTENSION vector