Let the model pick intent, not the trade
The most reliable part of Sentix's AI trading agent is the part where the model is not allowed to choose the trade.
- AI
- LLM
- product
The first version of Sentix's AI assistant tried to do too much. A user would say something like “I'm bullish on ETH for the next week,” and the model would return a full trade: strike, expiry, size, and a paragraph explaining why. It looked impressive in a demo and failed in the places that mattered.
The failure mode
Options have a lot of exact state: strike prices, expiry timestamps, contract sizes, collateral, and the current order book. An LLM can produce a plausible-looking combination that does not exist, or that exists but is far outside the user's budget. The more constraints you add, the more chances there are to ignore one.
The uncomfortable part is that the failure is fluent. A hallucinated trade reads exactly like a correct one until you try to execute it.
Split the job
The fix was to give the model a smaller job. It extracts intent: asset, direction, rough expiry, risk appetite, and any constraints the user stated. That intent is passed to deterministic code, which filters the live order book and picks a trade that actually satisfies the constraints.
user message -> model -> structured intent
structured intent -> code -> live order book -> executable tradeThe model is good at the fuzzy part: turning a sentence into fields. The code is good at the exact part: comparing numbers and rejecting anything that does not fit. Neither side is asked to do the other's job.
Function calling is a schema, not a suggestion
Using tool calling made the boundary explicit. The schema defines what the model can ask for; the function does the validation and returns a result the model cannot invent. If the model leaves out a field, the call fails loudly instead of filling the gap with something plausible.
This also makes the system easier to test. The deterministic path can be tested without a model. The model path can be tested against a fixed set of messages and expected intents. The two failures are no longer tangled together.
Keep the human in the loop
Even with a clean split, the model can misread what the user meant. The UI shows the resulting trade in human terms — potential profit, max loss, break-even — before the user confirms. The AI is advisory; the user still makes the call.
The general lesson is not specific to trading. Use the model at the boundary where language is ambiguous, and keep exact state, calculations, and side effects in code you can test. The model should propose; the system should decide.