An open API service indexing awesome lists of open source software.

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 ๐Ÿค.

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! ๐ŸŒŸ**