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.
How can an LLM-powered data-analysis assistant remain useful while reducing the risk of unsafe code execution, silent analytical errors and misleading outputs?
- Inspect dataframe schema and representative values
- Classify the analytical intent
- Generate Pandas code under a strict prompt contract
- Parse and validate the abstract syntax tree
- Execute against a copied dataframe in a reduced environment
- Show the generated code and result to the user
- Evaluate answers against a curated benchmark of tabular questions
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.
pip install -r requirements.txt
export GROQ_API_KEY=...
streamlit run app.pyA 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
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.