The AI Business chatbot project: try it.
Ask a question about a made-up shop: TF-IDF finds the closest known question, and the page shows the SQL, the result and a plain answer.
Try it
Move the controls; the chart and the sentence under it update.
Closest known question: "What product do we need to buy more of?" (cosine similarity 1.00). Darker bars: words it shares with your question.
SELECT name, stock, reorder_at FROM products WHERE stock < reorder_at ORDER BY stock - reorder_at;
| name | stock | reorder_at |
|---|---|---|
| Wood screws (100) | 9 | 25 |
| White paint 1L | 6 | 15 |
| Screwdriver set | 4 | 8 |
Answer: 3 products are below their reorder level: Wood screws (100) (9 in stock, reorder at 25), White paint 1L (6 in stock, reorder at 15) and Screwdriver set (4 in stock, reorder at 8).
A made-up shop with eight products. Matching your question to eight known questions by word weights stands in for the language model the write-up describes; the SQL and the answer are computed in your browser. Not the original chatbot or its data.
The write-up this goes with: The AI Business chatbot project.