From 08e7eaa3da884660013ada4350ef7945350cf2cc Mon Sep 17 00:00:00 2001 From: Kahhow Lee <44336310+ghostleek@users.noreply.github.com> Date: Sun, 14 Sep 2025 15:22:52 +0800 Subject: [PATCH] Enhance README with RAG support and quickstart guide Updated README to include RAG support and deployment instructions. --- README.md | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 132 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c4c0e7..e6ddfcb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,133 @@ -# Chergpt-Basic: Custom Chat Assistant -Added RAG (create vector embeddings using a sep python script) +# Chergpt-Basic: Custom Chat Assistant -See https://github.com/String-sg/chergpt-basic/ for original repo +Chergpt-Basic is a **simplified, login-free ChatGPT-like interface** designed for quick deployment. + +- βœ… Mobile-friendly +- βœ… Easy to deploy on [Streamlit](https://streamlit.io/) +- βœ… Beginner-friendly +- πŸ†• Now with RAG support (via vector embeddings via the admin web-interface) + +## Desktop Preview +![image](https://github.com/String-sg/chergpt-basic/assets/44336310/73912243-d638-4b48-a2a8-2ed54d79ec80) + +## Mobile Preview +![image](https://github.com/String-sg/chergpt-basic/assets/44336310/d77d5654-699a-405e-a65d-880f983b22b4) + +--- + +## ⚑ Quickstart (copy–paste setup) + + +Before deploying, you only need **3 things** in your `Secrets.toml`: + +```toml +OPENAI_API_KEY = "your_api_key_here" +DB_CONNECTION_STRING = "your_neondb_string_here" +ADMIN_PASSWORD = "set this to what you want" +GLOBAL_PASSWORD = "optional_password_here" +``` + +**Don't have the values? Detailed instructions in the section below** +OPENAI_API_KEY = from OpenAI +DB_CONNECTION_STRING: from NeonDB +ADMIN_PASSWORD: compulsory, you need this to setup and customize your bot +GLOBAL_PASSWORD: optional, lets you restrict access with a single password + +πŸ‘‰ Once these are set, head to Deploy on Streamlit + and you’re live! +## 🌟 Features + +- Add **custom instructions** to guide student interactions. +- **Download chatlogs** for later analysis. +- Generate **learning/teaching analytics** from chatlogs. +- Optional **password protection** (see [authentication guide](https://docs.streamlit.io/knowledge-base/deploy/authentication-without-sso)). + +--- + +## 🎯 Use Cases + +Chergpt-Basic can be used for: + +- Creating **student personas** (e.g. historical figures, patients, role-play scenarios). +- Building **guided escape rooms** for language learning (e.g. Chinese with tasks as checkpoints). +- Running **interactive lessons** with analytics feedback. + +--- + +## πŸš€ Live Examples + +- [Physics (Lookang fork)](https://chergpt-physics-lookang.streamlit.app/) +- [Physics (CPDD deployment)](https://chergpt-physics-cpdd.streamlit.app/) + +--- + +## πŸ› οΈ Getting Started + +There are **3 simple steps** to deploy your own Chergpt-Basic app: + +1. **Set up your database** (for storing chatlogs). +2. **Get your OpenAI API key**. +3. **Deploy to Streamlit**. + +--- + +### 1. Set up your backend (Database) + +We recommend [**NeonDB**](https://console.neon.tech/) (free tier works well). + +1. Create an account at [Neon](https://console.neon.tech/). +2. Start a free project (choose **Singapore** region if relevant). +3. Copy your **DB connection string** β€” you’ll need this later. + +πŸ“Œ This string is what allows Chergpt-Basic to save chat data. Keep it safe. + +--- + +### 2. Get your OpenAI API key + +1. Go to [OpenAI API keys](https://platform.openai.com/account/api-keys). +2. Click **Create new secret key**. +3. Copy it somewhere safe β€” you’ll need it for deployment. + +πŸ’‘ Not sure how? Follow [this beginner-friendly guide](https://teachertech.beehiiv.com/p/api-openai). + +--- + +### 3. Deploy on Streamlit + +Click below to auto-deploy: +πŸ‘‰ [**Deploy Chergpt-Basic**](https://share.streamlit.io/deploy) + +Then: + +1. Create a **Streamlit account** (free). +2. Connect your **GitHub account**. +3. Fork the repo β†’ `String-sg/Chergpt-basic`. +4. In **Advanced Settings β†’ Secrets.toml**, paste: + + ```toml + OPENAI_API_KEY = "your_api_key_here" + DB_CONNECTION_STRING = "your_neondb_string_here" + ADMIN_PASSWORD = "set this to what you want" + GLOBAL_PASSWORD = "optional_password_here" + ``` + +# Don't have a Github account and just want to deploy without cloning? +Sure, you can!
+Go to streamlit.io + create an account, login + +In the top right corner, click create app +image + +Select **Deploy a public app from Github** +image + +Setup your app with the following fields +- Repository = https://github.com/String-sg/chergpt-basic/ (You can click "Paste Github URL" and enter this) +- Branch = main +- Main file path = main.py +- APP URL = choose your own or use the default +image + +Click on advanced settings, paste in the details you previously obtained +image