Engineering principles behind DataMantri, CustomEvo and Daivota Auction: where a model may propose, where deterministic code decides, and the trade-offs each choice carries. None of the products is deployed for customers yet.

Daivota builds three products of its own: DataMantri for analytics, CustomEvo for customer feedback and Daivota Auction for online auctions. None of them is deployed for customers, so this article reports no results from the field. It sets out the engineering principles we design these products around, why we chose them and what each one costs. They are design intentions, not a claim that any implementation is complete or free of defects.
Only one of the three is built around a language model. DataMantri uses a model to help turn questions and written briefs into SQL and dashboards. CustomEvo's case workflow and the auction's bidding rules are ordinary business logic. The lessons still overlap. Most of the engineering in an AI-native product is deterministic code placed carefully around the model, and the same habits make non-AI workflows easier to trust.
DataMantri can generate a dashboard from a written brief, with every chart backed by a real query, and it answers plain-language questions with read-only SQL on PostgreSQL. In both cases the question for the designer is which parts of the output the model should own.
Our answer is as little as is useful. A model is good at interpreting what a person is asking for: which measures matter, which comparison they have in mind, which tables look relevant. It is a poor place for things that have one right answer, such as the arithmetic of a period-over-period change, a safe division or the ordering of a top-ten list. Those belong in code, where a wrong rule is wrong every time and can be fixed once, with a test.
Two practical consequences follow. First, write the boundary into the data contract between the model and the rest of the system: which fields the model may fill in, and what type each one has. Second, make the contract strict. A response with an unexpected field should fail validation, not be quietly ignored, because an ignored field is often the first sign that the model has misunderstood the task.
The cost is flexibility. Code can only produce the query shapes it was written for, so an unusual request may get a clear "not available" instead of a creative attempt. We think that is the right trade for analytics, where a confident wrong number does more harm than a refusal.
When a model writes SQL, treat the statement as untrusted input from an unknown author. A layered approach puts several independent checks in front of the database and then relies on the database itself as the last barrier. The outline below is a general pattern, written as illustration; it is not a copy of any product's code.
# Illustrative pattern for checking model-generated SQL
reject if empty or longer than a size limit
parse with a PostgreSQL-aware parser; reject if it does not parse
reject unless there is exactly one statement and it is a SELECT
walk the syntax tree; reject statement types and functions not on an allowlist
reject any table that is not in the schema the application has discovered
run in a read-only transaction with a statement timeout and a row limit
The parser checks give the user a clear message. The database settings are the backstop if a check misses something. PostgreSQL documents that a read-only transaction "cannot alter non-temporary tables" and that statement_timeout will "abort any statement that takes more than the specified amount of time" [1]. A database role with only the permissions it needs belongs in the same picture.
An allowlist rejects some legitimate SQL, such as recursive queries or functions nobody thought to include. We prefer a false rejection to a false acceptance: the first costs a user a rephrased question, the second can cost a lot more. Our article on making natural-language SQL safer covers the database-side controls in detail.
A model can name a table that does not exist, or a column that exists in a different table. Because DataMantri discovers the schema of the databases it connects to, the system has its own list of what is real, and anything the model names can be checked against that list rather than taken on trust. If nothing the model proposes survives the check, the right response is an explicit message, not a best guess built on invented names.
Prompt wording helps, but it is not a control. OWASP recommends that applications "separate and clearly denote untrusted content", and it also says that "it is unclear if there are fool-proof methods of prevention for prompt injection" [2]. So it is reasonable to tell the model that the user's question, the schema description and any query results are data, not instructions. The protection that matters is the validator and the read-only session, which do not depend on the model behaving.
Two small rules follow the same idea. If a query returns no rows, say that no conclusion can be drawn instead of asking the model to interpret an empty result. And if the model reports that the data cannot answer the question, pass that explanation back plainly rather than forcing it to produce SQL anyway.
CustomEvo turns complaints into cases with an assigned owner, team and SLA deadlines. When people are accountable for a case, its status should not be a free-text field or a value any screen can set. List the allowed transitions and reject every other change. The table below is an illustrative example for a support case, not a specification of any product.
| From | Allowed to |
|---|---|
| NEW | TRIAGED, ASSIGNED, IN_PROGRESS |
| TRIAGED | ASSIGNED, IN_PROGRESS, RESOLVED |
| ASSIGNED | IN_PROGRESS, RESOLVED |
| IN_PROGRESS | RESOLVED, ASSIGNED |
| RESOLVED | CLOSED, REOPENED |
| CLOSED | REOPENED |
| REOPENED | IN_PROGRESS, ASSIGNED, RESOLVED |
A table this short has a useful property: a support manager can read it and say whether it matches how the team works. That review can catch mistakes that a code review of the same rules would miss. Pair it with an activity record for each status change, assignment and deadline event, holding who acted and what changed, so that a disputed case can be reconstructed later.
SLA targets are business policy. They change when a contract changes, they differ by priority and often by customer or project, and the people who own them are not engineers. CustomEvo gives each case an owner and SLA deadlines. As a general approach we recommend keeping the targets in a rule table, storing the resulting deadlines on the case, and recording changes to them in the activity history.
Storing deadlines as data also makes the policy questions visible, and each of them has more than one reasonable answer:
These are decisions for whoever runs the support team. Keeping them in data lets that person change them without a release. The article from customer feedback to cases and SLAs discusses the choices in more depth.
Daivota Auction validates each bid against the auction's status, the bidder's participation and the minimum increment. A late bid extends the closing time to discourage sniping, and every accepted bid is recorded with its bidder and time.
The hard case is two bids arriving at the same moment. If both read the same "highest bid so far", both can pass the minimum-increment check, and the auction ends up with two bids that each believed they were the leader. The rule "highest bid plus increment" only means something if bids on one auction are checked one at a time.
The general fix is to make the database serialise them. In PostgreSQL, one way is to lock the auction's row before reading the current highest bid; SELECT ... FOR UPDATE "locks the selected rows against concurrent updates" [3], so a second transaction waits for the first to finish. Per-row locking means separate auctions do not block each other. The cost is that bids on one busy auction queue behind each other, and that throughput is something to measure under realistic load rather than assume.
Anti-sniping has a design choice of its own. An extension can add a fixed amount to the old closing time, or it can guarantee a minimum remaining time from the moment of the late bid. The second avoids a run of late bids stacking up long extensions, and it is easier to explain to bidders.
Each rule above has an edge case that someone will break by accident: a bid in the last seconds, a reopened case, an empty query result, a model response with an extra field. Give each one a name and an automated test next to the code. AI features make this more important, because the guarantees live in the code around the model, and that code is what a test can hold steady while prompts and models change.
More about each product is on the DataMantri and Daivota Auction pages.
Prepared with AI-assisted research and drafting.