NeilDriscoll's picture
Update README.md
8545a9b verified
---
title: InstaAutoApp TeamDataMavericks
emoji: πŸš—
colorFrom: red
colorTo: yellow
sdk: gradio
sdk_version: "4.44.1"
python_version: "3.11"
app_file: app.py
pinned: false
license: mit
short_description: AI-Powered Symptom Triage for 2023 Ford Bronco
---
# πŸš— Insta-AutoApp
**AI-Powered Symptom Triage for 2023 Ford Bronco**
Insta-AutoApp is a RAG-based (Retrieval-Augmented Generation) application that helps 2023 Ford Bronco owners understand warning lights and vehicle symptoms. Describe your issue in plain English and receive structured, OEM-grounded triage guidance in under 60 seconds.
---
## 🌟 Features
- **OEM-Grounded Responses**: All answers are based on the official 2023 Ford Bronco Owner's Manual
- **Structured Triage Output**: Every response includes Urgency Level, Likely Meaning, Next Step, and OEM Citation
- **Vehicle-Specific Follow-ups**: AI asks Bronco-specific clarifying questions (GOAT modes, Sasquatch package, etc.)
- **Safety-First Design**: Conservative defaults for brake, steering, and drivetrain issues
- **No Fabrication**: If the manual doesn't cover it, the app says so
---
## πŸš€ Quick Start
### Prerequisites
- Python 3.10+
- HuggingFace API token ([get one here](https://huggingface.co/settings/tokens))
- 2023 Ford Bronco Owner's Manual PDF
### Installation
1. **Clone or download this repository**
```bash
git clone https://github.com/your-repo/insta-autoapp.git
cd insta-autoapp
```
2. **Create a virtual environment (recommended)**
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. **Install dependencies**
```bash
pip install -r requirements.txt
```
4. **Configure environment**
```bash
cp .env.example .env
# Edit .env and add your HuggingFace API token
```
5. **Ingest the OEM Manual** (one-time setup)
```bash
# Place your Bronco manual PDF in a convenient location
python ingest.py path/to/bronco_2023_manual.pdf
```
6. **Launch the app**
```bash
python app.py
```
7. **Open in browser**: http://localhost:7860
---
## πŸ“ Project Structure
```
insta-autoapp/
β”œβ”€β”€ app.py # Main Gradio application
β”œβ”€β”€ config.py # Configuration constants
β”œβ”€β”€ prompts.py # LLM system prompts
β”œβ”€β”€ llm_client.py # HuggingFace Inference API client
β”œβ”€β”€ rag_pipeline.py # FAISS retrieval logic
β”œβ”€β”€ ingest.py # PDF preprocessing script
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ .env.example # Environment template
β”œβ”€β”€ README.md # This file
└── data/ # FAISS index (created by ingest.py)
β”œβ”€β”€ index.faiss
└── index.pkl
```
---
## πŸ”§ Configuration
### Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `HF_API_TOKEN` | Yes | - | HuggingFace API token for LLM inference |
| `HF_MODEL_ID` | No | `Qwen/Qwen2.5-72B-Instruct` | Model ID for inference |
| `TOP_K` | No | `5` | Number of chunks to retrieve |
### Vehicle Profile Options
The app only accepts valid 2023 Ford Bronco configurations:
- **Trim**: Base, Big Bend, Black Diamond, Badlands, Outer Banks, Wildtrak, Raptor
- **Engine**: 2.3L EcoBoost, 2.7L EcoBoost
- **Package**: None, Sasquatch, Lux, Sasquatch + Lux
- **Top Type**: Soft Top, Hard Top, Modular Top
- **Mileage**: 0 - 300,000
---
## πŸ€– How It Works
### Architecture
```
User Input (Symptom)
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Follow-up Gen β”‚ ◄── LLM (Qwen2.5-72B)
β”‚ (1-2 questions) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Combined Query β”‚ = Symptom + Vehicle Profile + Follow-up Answers
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ FAISS Retrieval β”‚ ◄── Top-5 OEM manual chunks
β”‚ (all-MiniLM-L6) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Triage Gen β”‚ ◄── LLM with retrieved context
β”‚ (4-field output) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
Structured Response
+ Disclaimer
```
### Urgency Levels
| Level | Meaning | Action |
|-------|---------|--------|
| **Safe** | Cosmetic or informational | No action required |
| **Monitor** | Non-critical issue | Check within 7 days if persists |
| **Urgent** | Needs attention | Schedule service, limit driving |
| **Do Not Drive** | Safety-critical | Stop immediately, seek assistance |
---
## πŸš€ Deployment to HuggingFace Spaces
1. **Create a new Space** at https://huggingface.co/new-space
- Select "Gradio" as the SDK
- Choose a name (e.g., `insta-autoapp`)
2. **Clone the Space repository**
```bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/insta-autoapp
cd insta-autoapp
```
3. **Copy all files** from this project into the Space folder
4. **Add your FAISS index** (from running `ingest.py` locally)
- Copy `data/index.faiss` and `data/index.pkl` to the Space
5. **Set Space Secrets**
- Go to Settings β†’ Variables and secrets
- Add `HF_API_TOKEN` as a secret
6. **Push to deploy**
```bash
git add .
git commit -m "Initial deployment"
git push
```
---
## ⚠️ Limitations
- **Single Vehicle**: V1 supports only 2023 Ford Bronco. Multi-vehicle support planned for V2.
- **Text Only**: No image/photo upload. No voice input.
- **Ephemeral Sessions**: Vehicle profile and history are not saved across sessions.
- **Table Extraction**: Table-heavy manual sections (fluid specs, fuse layouts) may have degraded extraction quality.
- **Not a Diagnosis**: This is triage guidance, not professional mechanical advice.
---
## πŸ”’ Privacy
- **No PII Collected**: No names, emails, or personal data stored
- **Ephemeral Sessions**: All session data is lost when browser closes
- **Local Data**: FAISS index stored locally, not transmitted
- **API Calls**: Only symptom text is sent to HuggingFace API for inference
---
## πŸ“ License
MIT License - See LICENSE file for details.
---
## πŸ‘₯ Team
**Data Mavericks** - ANLY 601 Advanced Coding for Business
Texas A&M University, Mays Business School
- Nasser Chaudhry
- Miriam Camacho
- Neil Driscoll
---
## πŸ™ Acknowledgments
- OEM Manual Source: [CarManualsOnline.info](https://carmanualsonline.info)
- Embedding Model: [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
- LLM: [Qwen/Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct)