Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏔️ AlpinistAI

An AI-powered chatbot for alpine safety information

AlpinistAI is a conversational AI assistant built with Rasa that provides real-time weather forecasts, avalanche risk assessments, and recent incident reports for major Alpine regions across France, Switzerland, and Italy.

⚠️ Research Prototype: This is an academic project for demonstration purposes. Always consult official sources for real-world mountain safety decisions.

Python Rasa License Maintenance


Features

  • Weather Forecasts: 16-day weather predictions for 33 Alpine locations
  • Avalanche Risk Assessment: Official bulletins from Météo-France (BRA) and Swiss SLF
  • Recent Incident Reports: Community-sourced avalanche incidents from Data-Avalanche
  • Multi-language Support: Automatic translation of French bulletins to English
  • Natural Conversation: Context-aware dialogue with follow-up question handling
  • Web Interface: User-friendly Streamlit GUI

Coverage

🇫🇷 France (15 locations)

Mont-Blanc: Chamonix, Les Houches, Argentière, Les Contamines-Montjoie
Vanoise: Val d'Isère, Tignes, Courchevel, Méribel, Vanoise
Haute Maurienne: Haute Maurienne, Val Cenis
Oisans: Alpe d'Huez, Les Deux Alpes, La Grave
Queyras: Queyras

🇨🇭 Switzerland (12 locations)

Valais: Zermatt, Verbier, Saas-Fee, Crans-Montana
Berner Oberland: Interlaken, Grindelwald, Wengen
Graubünden: St. Moritz, Davos, Arosa
Central Switzerland: Andermatt, Engelberg

🇮🇹 Italy (6 locations)

Valle d'Aosta: Courmayeur, Cervinia, La Thuile
Piedmont: Sestriere, Bardonecchia
Dolomites: Cortina d'Ampezzo


Architecture

┌─────────────────┐
│  Streamlit GUI  │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│   Rasa Server   │
└────────┬────────┘
         │
         ├──────────────┬──────────────┬──────────────┐
         ▼              ▼              ▼              ▼
    ┌────────┐   ┌────────────┐  ┌──────────┐  ┌──────────┐
    │ DIET   │   │  Duckling  │  │  Custom  │  │ External │
    │Classify│   │   (Time)   │  │ Actions  │  │   APIs   │
    └────────┘   └────────────┘  └──────────┘  └──────────┘
                                                      │
                      ┌───────────────────────────────┤
                      │                               │
              ┌───────▼────────┐           ┌─────────▼─────────┐
              │ Météo-France   │           │    Open-Meteo     │
              │  BRA (France)  │           │    (Global)       │
              └────────────────┘           └───────────────────┘
                      │                               │
              ┌───────▼────────┐           ┌─────────▼─────────┐
              │  SLF (Swiss)   │           │  Data-Avalanche   │
              │                │           │    (Incidents)    │
              └────────────────┘           └───────────────────┘

Key Components

  • NLU Pipeline: WhitespaceTokenizer → RegexFeaturizer → DIETClassifier → EntitySynonymMapper
  • Dialogue Management: RulePolicy + MemoizationPolicy + TEDPolicy
  • Entity Extraction: Duckling for temporal expressions, DIET for locations
  • Custom Actions: Weather retrieval, avalanche assessment, incident reports

Installation

Prerequisites

  • Python 3.9+
  • Docker (for Duckling service)
  • Météo-France API key (optional, for French avalanche data)

1. Clone the Repository

git clone https://github.com/yourusername/alpinist-ai.git
cd alpinist-ai

Now, you can either run:

./scripts/setup_script.sh

to set up your environment automatically or continue to step 2 (if you prefer to do it manually)

2. Create Virtual Environment

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure API Keys

Create actions/config.json:

{
  "METEO_FRANCE_API_KEY": "your_api_key_here"
}

Note: Without the Météo-France API key, French avalanche bulletins will be unavailable, but weather forecasts will still work.

5. Start Duckling Service

docker run -p 8000:8000 rasa/duckling

6. Train the Model

rasa train

Usage

Start All Services

Do it manually (instructions below) or simply run ./scripts/start_script.sh

Terminal 1 - Duckling:

docker run -p 8000:8000 rasa/duckling

Terminal 2 - Rasa Actions Server:

rasa run actions

Terminal 3 - Rasa Server:

rasa run --enable-api --cors "*"

Terminal 4 - Streamlit GUI:

streamlit run gui.py

Access the Application

Open your browser to http://localhost:8501

Example Queries

🗣️ User: Hello
🤖 Bot: Hello! I am AlpinistAI. I can provide weather forecasts and avalanche safety information.

🗣️ User: Weather in Chamonix tomorrow
🤖 Bot: Forecast for Chamonix on 2025-12-13:
        - High: 5°C; Low: -2°C
        - Precipitation: 0 mm
        - Max wind: 15 km/h

🗣️ User: Avalanche risk in Zermatt
🤖 Bot: Official SLF Avalanche Forecast for Zermatt:
        - Danger Level: Moderate
        - Main Problem: Wind Slab
        - Synopsis: Fresh wind slabs require caution.

        Source: SLF (WSL Institute for Snow and Avalanche Research)

🗣️ User: Recent incidents in Chamonix
🤖 Bot: I checked the database but found no recent incidents reported for the Mont Blanc area.

Stop all the processes by running ./scripts/stop_script.sh once you are done testing.


Project Structure

alpinist-ai/
├── actions/
│   ├── __init__.py
│   ├── actions.py          # Custom action implementations
│   ├── locations.py        # Location database and mappings
│   └── config.json         # API keys (not in repo)
├── data/
│   ├── nlu.yml            # Training examples for intent classification
│   ├── rules.yml          # Dialogue rules
│   └── stories.yml        # Dialogue training stories
├── models/                # Trained Rasa models (generated)
├── scripts/
│   ├── setup_script.sh    # Automatically configures environment
│   ├── start_script.sh    # Automatically runs all servers
│   └── stop_script.sh     # Automatically stops all servers
├── config.yml             # Pipeline and policy configuration
├── credentials.yml        # Channel credentials
├── domain.yml             # Intents, entities, slots, responses
├── endpoints.yml          # Action server and Duckling endpoints
├── gui.py                 # Streamlit web interface
├── requirements.txt       # Python dependencies
└── README.md

Configuration

Adding New Locations

Edit actions/locations.py:

LOCATION_CONTEXT = {
    "your_location": {
        "name": "Your Location",
        "lat": 46.00,
        "lon": 7.00,
        "country": "Switzerland",
        "region": "Your Region"
    },
}

Then add to data/nlu.yml lookup table and retrain:

rasa train

Adjusting Fallback Thresholds

Edit config.yml:

- name: FallbackClassifier
  threshold: 0.55 # Lower = more lenient, Higher = stricter
  ambiguity_threshold: 0.12

Testing

Interactive Testing

rasa shell

Test Stories

rasa test

Validate Configuration

rasa data validate

Data Sources

Service Provider Coverage Data Type
Open-Meteo Open-Meteo.com Global Weather forecasts
Météo-France BRA Météo-France France Avalanche bulletins
SLF Swiss WSL Institute Switzerland Avalanche bulletins
Data-Avalanche Community France Incident reports

Academic Context

This project was developed as part of an MSc dissertation in Computer Science, focusing on conversational AI for domain-specific safety applications. It demonstrates:

  • Integration of multiple external APIs
  • Multi-turn dialogue management
  • Entity extraction and slot filling
  • Context-aware conversation handling
  • Out-of-scope intent detection
  • Real-time data retrieval and processing

Known Limitations

  • Avalanche data: Only available for France and Switzerland (not Italy)
  • Incident reports: API currently not accessible
  • Weather forecast: Limited to 16 days ahead
  • Language: Interface in English only (bulletins auto-translated)
  • Context switching: May occasionally misinterpret ambiguous follow-up questions

Technology Stack

  • Framework: Rasa 3.6
  • NLU: DIET Classifier, Duckling
  • Frontend: Streamlit
  • APIs: Open-Meteo, Météo-France, SLF, Data-Avalanche
  • Translation: deep-translator (Google Translate)
  • Date Parsing: python-dateutil

Screenshots

Main Interface

Main Interface


License

This project is for educational and research purposes. No warranty is provided. Always consult official sources for mountain safety information.


Acknowledgments

  • Météo-France for avalanche bulletin API access
  • SLF (WSL Institute for Snow and Avalanche Research) for Swiss avalanche data
  • Open-Meteo for weather forecast API
  • Data-Avalanche for community incident reports
  • Rasa for the conversational AI framework

Contact

For questions or collaboration opportunities, please open an issue on GitHub.


Future Work

  • Add Austrian avalanche service (LAWIS) integration
  • Support for Italian AINEVA avalanche bulletins
  • Multi-language interface (French, German, Italian)
  • Historical weather and avalanche data analysis
  • Mobile app development
  • Integration with GPS/route planning
  • Voice interface support

Stay safe in the mountains! 🏔️⛷️

About

AlpinistAI is a conversational AI assistant built with Rasa that provides real-time weather forecasts, avalanche risk assessments, and recent incident reports for major Alpine regions across France, Switzerland, and Italy.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages