Skip to content

Repository files navigation

QueryMind Research

QueryMind converts natural-language questions into constrained Pandas operations over an uploaded dataset. The research emphasis is not only usability, but also execution safety, answer correctness and transparent failure handling.

Research question

How can an LLM-powered data-analysis assistant remain useful while reducing the risk of unsafe code execution, silent analytical errors and misleading outputs?

Pipeline

  1. Inspect dataframe schema and representative values
  2. Classify the analytical intent
  3. Generate Pandas code under a strict prompt contract
  4. Parse and validate the abstract syntax tree
  5. Execute against a copied dataframe in a reduced environment
  6. Show the generated code and result to the user
  7. Evaluate answers against a curated benchmark of tabular questions

Safety model

The sandbox blocks imports, file operations, process execution, network-related modules and dangerous built-ins. This is a defence-in-depth research prototype, not a hardened multi-tenant security boundary.

Run

pip install -r requirements.txt
export GROQ_API_KEY=...
streamlit run app.py

Evaluation plan

A strong academic evaluation should separately measure:

  • intent-classification accuracy
  • executable-code rate
  • exact or tolerance-based answer accuracy
  • unsafe-code rejection rate
  • robustness to ambiguous column names
  • user trust and correction behaviour
  • latency and token cost

Limitations

AST filtering does not guarantee complete isolation. Production deployment should use an operating-system-level sandbox or isolated worker, strict resource limits, audit logging and a deterministic verification layer for high-impact analyses.

About

Research-oriented natural-language data analysis system with intent detection, guarded execution and reproducible evaluation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages