Skip to content

deepaknigam2004/nlp_query_engine_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP Query Engine - Demo (Minimal Working Implementation)

This repository is a minimal, runnable demo that implements core parts of the assignment:

  • dynamic schema discovery (SQLAlchemy reflection)
  • document ingestion (txt/csv) + TF-IDF index (scikit-learn)
  • a QueryEngine that heuristically maps simple NL queries to SQL or document search
  • a lightweight single-page frontend (HTML + JS) to interact with the API

Screen UI

Screenshot 2025-09-28 163354

Quick start (run on your machine)

  1. cd into the project folder.
  2. Create and activate a Python virtualenv:
    python -m venv .venv
    source .venv/bin/activate   # Windows: .\.venv\Scripts\Activate.ps1
  3. Install dependencies:
    pip install -r backend/requirements.txt
  4. (Optional) Preload sample resumes into the document index:
    python -m backend.preload_resumes
  5. Start the server:
    uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
  6. Open http://localhost:8000/ in your browser.

Example queries

  • How many employees do we have?
  • Average salary by department
  • Show me employees
  • Find resumes with Python

About

NLP Query Engine: A FastAPI-based platform that dynamically discovers database schemas, ingests documents, and lets users run natural-language queries. Combines SQL query generation and TF-IDF document search with a simple frontend and clear setup for easy deployment and demo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors