jamesliangg / PrismBot

Get factual information grounded from reliable sources

Home Page:https://devpost.com/software/prismbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Started

Folder Structure

.
├── .github                                             # Github Actions
│   └── workflows                                       # Workflows
│       └── gcp_deploy.yaml                             # The cooler package
├── .gitattribute                                       # Git attributes
├── .gitignore                                          # Git ignore
├── Dockerfile                                          # Dockerfile
├── Guidelines-FINAL-4TH-EDITION-With-2023-Updates.pdf  # Sample PDF
├── README.md                                           # Readme
├── chat.py                                             # Chatbot
├── lit.py                                              # Streamlit app
├── requirements.txt                                    # Python requirements
└── vectorstore.pkl                                     # Vectorstore configuration

Redis Database

Locally

  • Run docker run -d -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
  • Connection URL = redis://localhost:6379
  • If hosting on a cloud service, can use ngrok to connect to Redis
    • Run ngrok tcp 6379
    • Example output is tcp://2.tcp.ngrok.io:17000 use 2.tcp.ngrok.io as host and 17000 as port
    • Redis url becomes redis://2.tcp.ngrok.io:17000

Cloud

All you need is the connection URL to your database

.env File

Create a .env file in the root directory with the following content:

REDIS_URL=<REDIS_URL>
GOOGLE_APPLICATION_CREDENTIALS=GOOGLE_APPLICATION_CREDENTIALS.json

You'll also need to create a service account key for Google Cloud and save it as GOOGLE_APPLICATION_CREDENTIALS.json in the root directory

Service Account Scopes

  • Compute Engine API
  • Cloud Run Admin API
  • Vertex AI API

Starting Streamlit

  • Start Streamlit with streamlit run lit.py --server.port=8080
  • Access the app at http://localhost:8080

Useful Commands

Delete all keys in Redis DB redis-cli flushall

Bash Script to Import

Run the following script in your terminal to import the data into Redis from resources.md

chmod +x process_links.sh

./process_links.sh

Document Sources

References

About

Get factual information grounded from reliable sources

https://devpost.com/software/prismbot


Languages

Language:Python 95.1%Language:Dockerfile 2.5%Language:Shell 2.3%