https://github.com/simranshaikh20/sanskriti-scope
SanskritiScope: Your Guide to Indiaโs Cultural Heritage ๐ฎ๐ณโจ Explore hidden cultural gems ๐๏ธ, learn about traditional arts ๐จ, and plan personalized travel experiences ๐บ๏ธ that support local communities ๐ค.
https://github.com/simranshaikh20/sanskriti-scope
groq-integration python streamlit-webapp
Last synced: about 2 months ago
JSON representation
SanskritiScope: Your Guide to Indiaโs Cultural Heritage ๐ฎ๐ณโจ Explore hidden cultural gems ๐๏ธ, learn about traditional arts ๐จ, and plan personalized travel experiences ๐บ๏ธ that support local communities ๐ค.
- Host: GitHub
- URL: https://github.com/simranshaikh20/sanskriti-scope
- Owner: SimranShaikh20
- License: mit
- Created: 2025-05-14T12:33:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-05-22T10:00:59.000Z (5 months ago)
- Last Synced: 2025-05-22T10:41:31.107Z (5 months ago)
- Topics: groq-integration, python, streamlit-webapp
- Language: Python
- Homepage: https://sanskriti-scope-r2tot5cupch7vhy6wkqpr4.streamlit.app/
- Size: 6.73 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SanskritiScope ๐โจ
**Preserving India's Heritage Through Data & Responsible Tourism**---
## ๐ Project Overview
**SanskritiScope** is an AI-powered platform designed to promote **sustainable tourism** and preserve **endangered Indian art forms**. By leveraging data-driven insights, interactive maps, and an AI chatbot, it connects travelers with lesser-known cultural sites, festivals, and heritage experiences across India.### ๐ฏ Key Objectives
- **Discover**: Explore endangered art forms using interactive maps and filters.
- **Recommend**: Generate personalized cultural travel itineraries.
- **Educate**: Provide insights about India's heritage via an AI-powered chatbot.
- **Promote**: Highlight local festivals and events to boost responsible tourism.---
[Live App](https://sanskriti-scope-r2tot5cupch7vhy6wkqpr4.streamlit.app/)
---
## ๐ Tech Stack### ๐ Backend
| Technology | Use Case |
|------------------|---------------------------------------|
| [Snowflake](https://www.snowflake.com/) | Cloud data warehouse for storing heritage datasets |
| [Snowpark (Python)](https://docs.snowflake.com/en/developer-guide/snowpark/python/index) | Query and process data directly within Snowflake |
| [Haversine Formula](https://en.wikipedia.org/wiki/Haversine_formula) | Calculate distances for travel recommendations |### ๐ก AI & APIs
| Technology | Use Case |
|------------------|---------------------------------------|
| [Groq API (LLaMA-4)](https://x.ai/api) | Powers the AI Cultural Guide chatbot |
| [Pandas](https://pandas.pydata.org/) / [NumPy](https://numpy.org/) | Data processing and scoring for recommendations |### ๐ Frontend
| Technology | Use Case |
|------------------|---------------------------------------|
| [Streamlit](https://streamlit.io/) | Python-based interactive web app |
| [Folium](https://python-visualization.github.io/folium/) | Interactive maps with custom markers |
| [Streamlit-Folium](https://github.com/randyzwitch/streamlit-folium) | Embed Folium maps in Streamlit |---
## ๐ API Usage
### โก Groq API (LLaMA-4) ๐ค
**API Name**: Groq API
**Model Used**: LLaMA-4
**Purpose**: Powers the AI Cultural Guide chatbot for real-time heritage insights.**Implementation**:
1. User inputs queries via the Streamlit interface.
2. Queries are sent to Groq's LLaMA-4 model through a secure API call.
3. Responses are displayed in the chatbot UI.
4. ๐ API key is securely stored in environment variables (`.env`).---
## ๐งฉ Snowflake + Streamlit Integration
### ๐ Connection Architecture
1. **Snowflake Setup**:
- Stores heritage datasets (art forms, coordinates, UNESCO status, festival details) in structured tables.
2. **Snowpark Python**:
- Enables direct querying and data manipulation within Snowflake.
- Eliminates the need for a separate ETL pipeline.
3. **Streamlit App**:
- Connects to Snowflake using credentials stored in `secrets.toml`.
- Visualizes real-time data through interactive UI components.### โ Advantages
- **Zero Data Duplication**: Data resides solely in Snowflake.
- **Live Querying**: Ensures up-to-date recommendations and insights.
- **Efficient Processing**: Snowpark handles complex computations seamlessly.---
## ๐ System Architecture & Data Flow
```mermaid
graph TD
A[User Interface] -->|Query| B(Streamlit)
B -->|Snowpark| C[Snowflake Data]
C --> D{Data Processing}
D -->|Results| B
B -->|Questions| E[Groq API]
E -->|Answers| B
B -->|Visualize| A
```## โ๏ธ How It Works
## ๐ Data Pipeline
- **Snowflake**: Acts as the central repository for heritage data.
- **Snowpark**: Processes queries and applies filters using Python.
- **Streamlit**: Renders interactive UI with maps, filters, and chatbot.
- **Groq API**: Handles user queries for cultural insights and Q&A.---
## ๐ Recommendation Algorithm
The platform uses a scoring system to prioritize travel recommendations:
```python
def calculate_score(row):
score = 0
if row['ENDANGERED'] == "Yes": score += 2
if row['UNESCO'] == "Yes": score += 1
score -= (0.01 * row['DISTANCE_KM']) # Penalize longer distances
return score
```**Inputs**: Art form metadata, UNESCO status, and distance (calculated via Haversine formula).
**Output**: Ranked list of cultural sites for personalized itineraries.---
## ๐ Key Features
### ๐บ๏ธ Art Explorer
- Filter art forms by state, region, or endangerment status.
- Visualize sites on an interactive Folium-powered map.
- View detailed metadata (history, significance, preservation status).### ๐ค๏ธ Smart Routes
- AI-curated travel itineraries prioritizing endangered sites.
- Distance-optimized paths using the Haversine formula.
- Exportable routes for trip planning.### ๐ค Chatbot Guide
- Powered by Groq's LLaMA-4 model.
- Provides instant insights into art forms, festivals, and cultural history.
- Contextual responses tailored to user queries.### ๐๏ธ Festival Calendar
- Browse cultural festivals by month or state.
- Filter events based on proximity or cultural significance.
- Learn about festival history and local impact.---
## ๐ Why This is Innovative?
- **Data-Driven Preservation**: Directs tourism to at-risk art forms, supporting local communities.
- **Hybrid Intelligence**: Combines Snowflake's analytics with LLaMA-4's conversational AI.
- **Serverless Architecture**: Scalable, low-maintenance infrastructure.
- **Impact Tourism**: Measurable contributions to cultural preservation and local economies.---
## ๐ Getting Started
### ๐ Prerequisites
- Python 3.8+
- Snowflake account with Snowpark enabled
- Groq API key (sign up at [x.ai/api](https://x.ai/api))
- Git installed for cloning the repository---
### ๐ Installation
**Clone the Repository:**
```bash
git clone https://github.com/SimranShaikh20/SanskritiScope.git
cd cultural-lens
```**Install Dependencies:**
```bash
pip install -r requirements.txt
```**Set Up Environment Variables:**
Create a `.env` file in the project root and add:
```
SNOWFLAKE_ACCOUNT=
SNOWFLAKE_USER=
SNOWFLAKE_PASSWORD=
SNOWFLAKE_DATABASE=
SNOWFLAKE_SCHEMA=
GROQ_API_KEY=
```**Configure Streamlit Secrets:**
Create a `secrets.toml` file in the `.streamlit/` directory:
```toml
[snowflake]
account = ""
user = ""
password = ""
database = ""
schema = ""
```**Run the Application:**
```bash
streamlit run app.py
```**Access the App:**
Open your browser and navigate to `http://localhost:8501`.---
## ๐ Project Structure
```
cultural-lens/
โโโ ๐ app.py # Main Streamlit application
โโโ ๐ recommender.py # Core recommendation logic
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ README.md # Project documentation
โโโ ๐ .streamlit/ # Streamlit configuration
โ โโโ ๐ secrets.toml # API/Snowflake credentials
โโโ ๐ data/ # Sample datasets
โโโ ๐ผ๏ธ images/ # Images used in the app
โโโ ๐ pages/ # Streamlit multipage app components
โ โโโ 1_๐จ_Endangered_art_forms.py # Form for endangered art
โ โโโ 2_๐_Cultural_Spot_Recommender.py # Cultural spot recommendations
โ โโโ 3_๐ค_Chatbot.py # Chatbot integration
โ โโโ 4_๐_Seasonality_&_Cultural_Calendar.py # Calendar of cultural events
โโโ ๐ venv/ # Virtual environment
โโโ ๐ Presentation/
โ โโโ SanskritiScope-AI-Powered-Platform-for-Sustainable-Cultural-Tourism-in-India.pptx
```---
## ๐ Contributing
We welcome contributions to enhance Cultural Lens! To contribute:
1. Fork the repository.
2. Create a new branch:
```bash
https://github.com/SimranShaikh20/SanskritiScope.git
```
3. Commit your changes:
```bash
git commit -m "Add SanskritiScope"
```
4. Push to the branch:
```bash
git push origin feature/SanskritiScope
```
5. Open a Pull Request.Please follow the Code of Conduct and ensure your code adheres to the project's style guidelines.
---
## ๐ License
This project is licensed under the **MIT License**.
---
## ๐ Acknowledgments
- **Snowflake** for scalable data warehousing.
- **Groq** for powering the AI chatbot.
- **Streamlit** and **Folium** for seamless UI and mapping.
- The **open-source community** for inspiration and tools.---
## ๐ฌ Contact
For questions, suggestions, or collaboration, reach out to:
**GitHub**: [Simran Shaikh](https://github.com/SimranShaikh20)
---
**Let's preserve India's cultural heritage together! ๐**