AI-powered SQL troubleshooting assistant for the HungerRush installer team. Describe a problem in plain English and get the SQL query you need.
# 1. Setup environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# 2. Configure API key
cp .env.template .env
# Edit .env and add your OpenAI API key
# 3. Build knowledge base
python ingest.py
# 4. Run the app
streamlit run app.pyOpen http://localhost:8501 in your browser.
- Ask a question - "Cashier can't void an order" or "Customer was charged twice"
- Get SQL queries - Relevant queries from the knowledge base with explanations
- Follow-up questions - If results are uncertain, the system asks clarifying questions
Add or update markdown files in data/, then rebuild:
python ingest.pyEdit config.py to adjust:
- Search thresholds and result counts
- OpenAI models (embedding and LLM)
- Chunk sizes for document processing
- Streamlit - Web interface
- ChromaDB - Vector database for semantic search
- OpenAI - Embeddings (ada-002) and LLM (gpt-4o-mini)
- sentence-transformers - Cross-encoder reranking for improved accuracy