RAG / query_processor.py

Understand the question before you retrieve.

Turn informal student language into a careful, retrieval-ready query—without trading away the semantic meaning of the original question.

1Ask naturally2Inspect signals3Retrieve evidence
Live processor preview
NLP intake

Ask it how a student would

The processor recognizes intent, department, time references, spelling variants, and concise follow-ups before retrieval begins.

Context aware

Press Analyze to prepare the retrieval query.

Try a student phrasing

Structured understanding

Retrieval-ready interpretation

A compact signal layer guides retrieval without overriding the student’s original meaning.

High-confidence signals

Canonical query

Head of Department Computer Science and Engineering

Intent
hod
Question type
person lookup
Department
Computer Science and Engineering
Time reference
Not detected

Extracted entities & keywords

Computer Science and EngineeringHead of Departmenthodcse

NLP confidence

74%

Intent and entities are used to enrich the embedding and hybrid re-ranking query.

Hybrid retrieval handoff

NLP narrows the search, evidence stays in control.

The processor improves query recall and precision—it never invents an answer or replaces semantic retrieval.

  1. 01

    Understand

    Normalize language, detect intent, department, entities, and time.

  2. 02

    Retrieve

    Embed the canonical query alongside the original student phrasing.

  3. 03

    Re-rank

    Blend FAQ, Pinecone, and keyword evidence into relevant NEC chunks.

  4. 04

    Ground

    Let Ollama answer only from the selected NEC evidence.

NEC Assist prepares a meaningful retrieval query; it does not replace evidence retrieval.

NLP → hybrid retrieval → grounded answer

⚡Built with GenMB