This sample application demonstrates how to implement a Large Language Model (LLM) and Retrieval Augmented Generation (RAG) system with a Neo4j Graph Database. This application uses Streamlit, LangChain, Neo4jVector vectorstore and Neo4j DB QA Chain
- Poetry for dependency managament.
- Duplicate the
secrets.toml.example
file tosecrets.toml
and populate with appropriate keys.
poetry update
poetry run streamlit run rag_demo/main.py --server.port=80
OR
pipenv shell
pipenv install
pipenv run streamlit run rag_demo/main.py
A hosted example of the rag-demo can be found at https://dev.neo4j.com/rag-demo. To create and run your own hosted version of this app on Google Cloud:
- First Install gcloud CLI, then:
- Update the requirements.txt file with
poetry export --without-hashes --format=requirements.txt > requirements.txt
- Make sure a copy of the streamlit secrets.toml file is in the root folder path (may have to temp comment out from .gitignore for the gcloud build to properly find the secrets.toml file)
- Run the following terminal commands
gcloud auth login
gcloud init
gcloud builds submit --tag gcr.io/<gcloud_project_id>/streamlit-app
gcloud run deploy --image gcr.io/<gcloud_project_id>/streamlit-app --platform managed --allow-unauthenticated