Skip to content

ASK

The ASK command allows users to query data using natural language questions instead of writing complex SQL statements.

Syntax

SELECT ASK("natural_language_question")
  • ASK "natural_language_question": The question you want to ask about your data, enclosed in double quotes.

How It Works

  1. The ASK command is received by ScramDB.
  2. ScramDB routes the request to the NTU (Natural Translation Unit) service.
  3. NTU analyzes the question and generates embeddings for it.
  4. It performs a similarity search against vector embeddings stored in PulsejetDB to find the most relevant data chunks.
  5. NTU constructs a prompt containing the user’s question and the retrieved context.
  6. This prompt is sent to an integrated Large Language Model.
  7. The LLM generates an answer based on the provided question and context.
  8. NTU receives the answer, formats it, and returns it to ScramDB.
  9. ScramDB presents the natural language answer to the user.

Example Use Cases

-- Ask about specific product reviews
SELECT ASK("Summarize the main complaints about the X1 Pro laptop")
-- Ask about sales trends
SELECT ASK("What were the top 3 selling products in the West region last quarter?")
-- Ask a general question potentially using multiple tables (inference needed)
SELECT ASK("Which customers in California bought hiking boots in the last month?")

The ASK command significantly lowers the barrier to data exploration by allowing users to interact with their data more intuitively using natural language.