MotherDuck

YouTube

Jev for Analytics: 5 Use Cases on Real Data

2026-10-02 19:19 UTC
Length: 43:57

The talk demonstrates how Jeff, a decision‑oriented model, can be integrated into SQL workflows to quickly classify text data and provide confidence scores. By using Prompt Jeff as a SQL function in Mododoc or DuckDB, analysts can transform raw narrative columns into structured categories and perform aggregations in milliseconds. The approach is especially useful for data engineers and analysts working with large text datasets who need fast, deterministic labeling without the cost or latency of large language models. It showcases practical use cases such as refund classification, batch scoring, and real‑time decision support.

Insights

1. Prompt Jeff as a SQL function for text classification
1.1 Prompt Jeff is a lightweight decision model that outputs a categorical choice and a confidence score.
1.2 It can be invoked directly in SQL via a function like `prompt_jeff(...)`, allowing bulk scoring of rows.
1.3 Example: `SELECT complaint_id, narrative, prompt_jeff(narrative, 'refund, explanation, other') AS result FROM complaints;`
1.4 Compared to calling a large LLM, it is orders of magnitude faster and cheaper, but limited to predefined categories.

2. Using confidence scores to enforce quality control
2.1 Each classification comes with a numeric confidence score between 0 and 1.
2.2 Analysts can filter results with a threshold (e.g., `WHERE confidence > 0.8`) to keep only high‑confidence labels.
2.3 This enables automated batch processing while still allowing manual review of low‑confidence cases.
2.4 A common mistake is setting the threshold too high, which can leave many records unlabeled.

3. Batch scoring versus real‑time classification
3.1 Batch scoring processes all rows in one SQL query, taking a few seconds for 100,000 rows.
3.2 Real‑time classification can be achieved by calling Prompt Jeff per row or via a materialized view for streaming data.
3.3 Batch mode is ideal for nightly jobs; real‑time mode suits live dashboards or alerting systems.
3.4 Trade‑off: real‑time incurs higher per‑row latency and resource usage.

4. Leveraging DuckDB and Mododoc for local analytics
4.1 DuckDB is an in‑process analytical database that supports SQL and can host Prompt Jeff extensions.
4.2 Mododoc provides a UI to attach to DuckDB and run queries without managing infrastructure.
4.3 Using these tools lets data engineers prototype quickly and run queries locally before scaling.
4.4 They are free and open‑source, making them accessible for small teams.

5. Creating custom categories with an LLM before using Prompt Jeff
5.1 If the desired categories are not predefined, first sample a subset of data and label it with a large LLM.
5.2 The labeled samples become the set of choices for Prompt Jeff, which then scales the labeling to the full dataset.
5.3 This one‑time LLM effort is cheap because it only processes a small sample.
5.4 Avoid overfitting by ensuring the sample is representative of the full data distribution.

Watch on YouTube