For demonstration purposes, embeddings are locally generated. In production, OpenAI embeddings can be used
This project implements a Natural Language Search system using:
- PostgreSQL
- pgvector
- OpenAI LLM
- Streamlit
- Convert English queries to SQL
- Secure SQL validation
- Hybrid semantic + SQL search
- Simple Streamlit UI
- Show employees in Engineering department
- Top 5 expensive products
- Orders handled by Sales employees
- Products similar to laptop
- Create PostgreSQL database
- Run schema.sql and sample_data.sql
- Install dependencies
- Run embeddings.py
- psql -U postgres nl_search_db -f db\schema.sql
- psql -U postgres nl_search_db -f db\sample_data.sql
- psql -U postgres nl_search_db (verify tables exist \dt \q)
- Start Streamlit app
python -m streamlit run app.py