Focused context
Choose the relevant tables so the compiler has less ambiguity to resolve in larger databases.
Choose relevant tablesNatural language
Turn a plain-English question into a query against your registered tables, with a plan you can inspect.
OriginChainDB turns your question into a query plan, runs it and returns database rows.
“Show the first 10 pending orders.”
Table scopeshop.orders A matching cached plan can go straight to execution.
Cache hit Reuse planRecognized questions become a query plan.
The model helps compile a plan when available.
shop.ordersstatus = pending10 rowsDatabase rows, plus the plan when requested.
Name the tables your question is about. Specific column names help OriginChainDB identify the data you need.
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 exampleFrom your application
One request carries the question, the tables to consider and whether to return the plan.
nlThe questionschemasThe contextshow_planThe explanation/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.
Question → plan → review
“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.
Choose the relevant tables so the compiler has less ambiguity to resolve in larger databases.
Choose relevant tablesRequest the query plan and execution details alongside your results to understand how the question was answered.
Inspect a planMatching questions can reuse compiled work. Cache status tells you whether a plan was reused.
Understand the cacheTry a focused question, inspect its plan, then build it into your application.
Follow the ASK guideConnect a provider key for questions that need a language model.
Explore provider keys