AI Agent Use Cases

Added today

44All 189

Prompt to Prepare a Shopping Cart from a Recipe Photo

The author reports that Grok Bot receives a recipe photo, organizes the ingredients and quantities, and creates a shopping list by excluding ingredients already available at home.

Grok Bot
Life & Hobbies

1–20 of 189

Work & ResearchWalkthrough

Checking Totals and Rankings by Asking Questions in Natural Language to a Database

This is an example where the author opens a SQLite file in read-only mode and converts questions written in natural language into SQL queries to retrieve results.

How it works

  1. After preparing dependencies and an API key, the author specifies the SQLite file using --db. By default, the tool creates a sample database containing customers, products, and orders.
  2. When the author enters a query such as sales by country or best-selling products, the connected tool reads the database structure, generates a query, and executes it.
  3. Existing files are opened in read-only mode by default. The author can ask a single question using --question or continue asking questions in the terminal.

Results

This is an implementation example where questions are converted into queries and the results from SQLite are explained. The code also shows the default connection method that does not modify the database.

Notes

Even for the same sales question, the value can change depending on how the date and order status are defined. The author read the public code but did not measure accuracy with actual data from any specific company.

Source

GitHub Original post ↗

Example prompt · LangChain

Set up so that you can ask natural language questions to a [working copy of a SQLite database]. Refer to the README of agents/04-sql-query-agent and the read-only connection code. After checking the Python environment and necessary API settings, first run with the sample data.

Keep the connection read-only and do not use --allow-write. Organize [sales definition], [query period], and [statuses to exclude] as input conditions, then convert the question into SQL. Supplement so that the used query, reference period, result rows, and final explanation are all saved together. If information is lacking, do not guess tables or periods—leave them as items to confirm.

Check with sums that have known answers, data with duplicate orders, empty results, and incorrect column names. Verify that the original file's contents have not changed and compare numbers with those from a directly executed read-only query. The deliverable is the execution procedure, records of questions/SQL/answers, and the confirmed correct answers. Saving and comparison verification are additional requirements for this request.