https://github.com/neo4j-examples/rag-demo
https://github.com/neo4j-examples/rag-demo
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/neo4j-examples/rag-demo
- Owner: neo4j-examples
- Created: 2023-11-30T17:11:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T13:47:29.000Z (over 1 year ago)
- Last Synced: 2025-05-08T01:42:43.194Z (7 months ago)
- Language: Python
- Size: 2.14 MB
- Stars: 95
- Watchers: 6
- Forks: 20
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Neo4j RAG Demo
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](https://python.langchain.com/docs/integrations/vectorstores/neo4jvector) vectorstore and [Neo4j DB QA Chain](https://python.langchain.com/docs/use_cases/graph/graph_cypher_qa)

## Requirements
- [Poetry](https://python-poetry.org) for dependency managament.
- Duplicate the `secrets.toml.example` file to `secrets.toml` and populate with appropriate keys.
## Usage
```
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
```
## GCloud Update
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:
1. First Install [gcloud CLI](https://cloud.google.com/sdk/docs/install), then:
2. Update the requirements.txt file with `poetry export --without-hashes --format=requirements.txt > requirements.txt`
3. 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)
4. Run the following terminal commands
```
gcloud auth login
gcloud init
gcloud builds submit --tag gcr.io//streamlit-app
gcloud run deploy --image gcr.io//streamlit-app --platform managed --allow-unauthenticated
```