Skip to content
All products

Natural language

Ask questions.
Get database results.

Turn a plain-English question into a query against your registered tables, with a plan you can inspect.

From a question to a query.

OriginChainDB turns your question into a query plan, runs it and returns database rows.

Question and table scope, compiled into a query plan.Illustrative example
Start with a question

“Show the first 10 pending orders.”

Table scope shop.orders

Check the plan cache

A matching cached plan can go straight to execution.

Cache hit Reuse plan
On a cache miss

Try built-in query rules

Recognized questions become a query plan.

Only for questions outside those rules

Ask the configured model

The model helps compile a plan when available.

Compiled plan
Readshop.orders
Filterstatus = pending
Limit10 rows
The database runs the plan
order_idstatus
order-042pending
order-057pending

Database rows, plus the plan when requested.

  1. Give the question context

    Name the tables your question is about. Specific column names help OriginChainDB identify the data you need.

  2. Turn the question into a query

    OriginChainDB tries built-in query rules first. Questions outside those rules can use the configured language model. The database then runs the resulting plan.

Questions that need a model are sent to the configured provider. Keep sensitive values out of prompts.

Try an ASK example

From your application

Make the question concrete.

One request carries the question, the tables to consider and whether to return the plan.

nlThe question
Name the data and the condition you want. Here, we ask for up to ten pending orders.
schemasThe context
Limit the compiler to relevant registered tables instead of your entire catalogue.
show_planThe explanation
Return the compiled plan with the rows so you can review the query before using it in your application.
POST/v1/tenants/:tenant/ask
{
  "nl": "top 10 shop.orders where status = pending",
  "schemas": ["shop.orders"],
  "show_plan": true
}

Example request · authenticated with your database credentials.

See a scoped request

Question → plan → review

Make the answer easier to verify.

Start with a specific question

“Show important customers.”

“Top 5 customers by total order amount.”

Say which quantity matters and whether it is a total, count or individual value. Split unrelated requests into separate questions.

  1. Check the selected tables.Confirm the plan reads the records you intended.
  2. Review filters and limits.A valid plan can still express the wrong business question.
  3. Test with familiar records.Compare returned rows with a small example you understand before adding the query to a workflow.
Inspect an example plan

Why ask with OriginChainDB?

Focused context

Choose the relevant tables so the compiler has less ambiguity to resolve in larger databases.

Choose relevant tables

Visible execution

Request the query plan and execution details alongside your results to understand how the question was answered.

Inspect a plan

Reusable plans

Matching questions can reuse compiled work. Cache status tells you whether a plan was reused.

Understand the cache

Put it to work.

Start with one table

Try a focused question, inspect its plan, then build it into your application.

Follow the ASK guide

Build with OriginChainDB.