https://github.com/drbenjamin/rag-on-snow
LLM utilizing RAG on Snowflake.
https://github.com/drbenjamin/rag-on-snow
llm rag snowflake streamlit
Last synced: about 2 months ago
JSON representation
LLM utilizing RAG on Snowflake.
- Host: GitHub
- URL: https://github.com/drbenjamin/rag-on-snow
- Owner: DrBenjamin
- License: gpl-2.0
- Created: 2024-10-03T06:36:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-30T08:43:40.000Z (11 months ago)
- Last Synced: 2025-10-25T08:47:30.526Z (8 months ago)
- Topics: llm, rag, snowflake, streamlit
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# RAG on Snow
This application stores unstructured data from documents and other sources like
images and video in a Snowflake DB utilizing Langchain to query this data. The
application is built using Streamlit and uses `StreamlitChatMessageHistory` for
memory of the Snowflake Cortex generated embeddings.
## Langchain implementation (langchain-snowrag)
[Tutorial on Medium](https://medium.com/snowflake/integrating-langchain-with-snowflake-cortex-0367f934f1c1).
See the [documentation](https://docs.snowflake.com/user-guide/snowflake-cortex/vector-embeddings#snowflake-python-connector)
on Snowflake for more information.
## Setup
First create an environment using the `environment.yml` file:
```bash
# Creating a conda environment
conda env create --file environment.yml
# Activate the environment
conda activate snowrag
```
Now configure the Streamlit app in the `.streamlit/secrets.toml` file:
```toml
# Configuring LLM
[LLM]
LLM_CHATBOT_NAME = ""
LLM_SYSTEM = "Please write a short answer."
LLM_SYSTEM_PLUS = "Prioritize the most relevant information from the similarity search!"
LLM_ASSISTANT = "How can I help?"
LLM_USER_EXAMPLE = ""
LLM_ASSISTANT_EXAMPLE = "<>assistant_example>"
# Configuring Snowflake
[snowflake]
user = ""
account = ""
private_key_file = ""
role = ""
warehouse = ""
database = ""
schema = ""
# Configuring MinIO storage
[MinIO]
endpoint = "http://127.0.0.1:9000"
bucket = ""
access_key = ""
secret_key = ""
```
## Streamlit web app
Just run the following code:
```bash
# Running the Streamlit app
python -m streamlit run snowrag.py
# Checking the Streamlit app
lsof -i :8501
```