OriginChainDB

Prepare data for Ask AI

Use clear table and column names, then review the generated query.

Ask AI uses table definitions to turn a question into a query you can review.

Make a table easier to ask aboutAsk uses the selected schema to form and execute a query; inspect both its plan and rows.
  1. Use clear field namesMake units such as cents or milliseconds explicit.
  2. Select the relevant tablesKeep the question within the intended data scope.
  3. Ask for a specific resultName the filters, totals or ordering you need.
  4. Check the executed interpretationVerify field choices and returned values.

Prepare your table

  1. Register the table and its columns.
  2. Use names that explain the value: amount_cents is clearer than amt.
  3. Choose the tables the question should use.
  4. Check that Ask AI is enabled for your instance and configured provider.
Instead ofPreferWhy
amtamount_centsIncludes the unit.
tsplaced_msSays what happened and how the time is stored.
stateorder_statusMakes the meaning less ambiguous.

No special natural-language block is needed in the schema. Do not assume the service can infer undeclared fields or your business rules.

Example table definition
# NL has no schema knobs of its own. What it needs is that the tables you
# want it to reason about are REGISTERED - the compiler is given the column
# names and types of your schemas as its entire context, so a column that
# is not declared is a column it cannot use.

namespace   = "shop"
table       = "orders"
primary_key = ["id"]

[[columns]]
name = "id"
ty   = "str"
required = true

[[columns]]
name = "customer"
ty   = "str"

[[columns]]
name = "amount_cents"
ty   = "i64"

[[columns]]
name = "status"
ty   = "str"

[[columns]]
name = "notes"
ty   = "str"

[[columns]]
name = "placed_ms"
ty   = "u64"

# Not required by NL, but the compiled plan will use it like any other
# query would - so an indexed filter column makes the answer faster.

[[indexes]]
name    = "by_status"
columns = ["status"]

Check the answer before using it

  • Read the generated plan: does it use the intended table, fields and filters?
  • Compare the returned rows with a small result you can verify yourself.
  • Make the question more specific if the result is unclear.
  • Use reviewed, parameterized SQL for a query your application will run repeatedly.

Ask AI availability and limits depend on the instance configuration. A generated query is a proposal to inspect, not proof that the business question was understood.

Continue

Ask AI guide · Question examples · Schema reference

© 2026 Silicoyn Technologies Pvt Ltd

On this page