Dizajnirajte sustave za umjetnu inteligenciju koja uči poslovnu logiku, a ne samo zadatke
Most AI initiatives begin with a deceptively small question: “Which task should we automate?” That question can produce useful wins, but it can also trap a team in a shallow view of the opportunity. A model can summarize a ticket, draft a response, or classify a document without ever understanding why the work exists. The durable value appears when an AI system can operate within business logic: the rules, constraints, exceptions, ownership boundaries, and consequences that make a task meaningful.
That does not mean handing a model control of core systems and hoping it learns by observation. It means designing software so the model can reason with the right context, propose bounded actions, and receive clear feedback. In practice, the architecture matters more than a clever prompt.
Tasks are visible; business logic is the operating system
A task is usually easy to describe: create an invoice, route a support request, approve a refund, provision an account. Business logic is what determines whether that task should happen, who may authorize it, which exceptions apply, and what must be recorded afterward.
Consider an AI assistant for customer support. A task-oriented version might identify a billing question and draft a polite reply. A business-aware version knows whether the customer has an active contract, whether an invoice is disputed, whether a credit limit affects the answer, which team owns the account, and when it must escalate rather than respond.
The difference is not simply more data in the prompt. It is a system that turns organizational knowledge into accessible, testable capabilities.
Put rules where software can enforce them
Models are useful for interpreting ambiguous language and choosing among well-defined options. They are poor substitutes for deterministic policy enforcement. If a refund requires an order state, a time window, and a manager approval above a threshold, those conditions should live in application logic or a policy service—not only in instructions supplied to a model.
A healthy pattern separates interpretation from authorization:
- The model extracts intent and relevant facts from unstructured input.
- Domain services retrieve authoritative records and evaluate rules.
- The system exposes a small set of permitted actions.
- Policy checks decide whether an action can execute.
- Humans handle exceptions that exceed the system’s authority.
This arrangement improves safety and makes failures understandable. If an action is rejected, the system can identify the policy or missing condition that blocked it. If the model misunderstood a request, the team can improve extraction or retrieval without weakening the underlying controls.
Use structured action contracts
Do not ask a model to produce free-form instructions that another system attempts to interpret. Define explicit action contracts with constrained fields, validation, and idempotency where appropriate. The model may suggest an action, but the application should validate it against current state before execution.
{
"action": "request_refund",
"order_id": "ord_123",
"reason": "duplicate_charge",
"amount": 49.00
}
The payload is not permission. It is a request for the domain layer to evaluate. The refund service can verify that the order exists, the amount is valid, the charge is eligible, and the caller has the required authority. A stale or fabricated identifier becomes a validation error, not a production incident.
Build a context layer, not a larger prompt
Business logic is often scattered across databases, workflow engines, internal documentation, APIs, and the accumulated habits of experienced employees. Sending all of that material to a model is expensive, unreliable, and difficult to govern. Instead, create a context layer that retrieves the minimum authoritative information needed for a decision.
For each important workflow, identify three classes of context:
- Facts: current account status, order details, contracts, inventory, permissions, and workflow state.
- Policies: eligibility rules, regulatory constraints, approval requirements, and escalation paths.
- History: previous actions, customer interactions, audit events, and relevant exceptions.
Facts should generally come from systems of record at the time of execution. Policies should be versioned and traceable. History should be filtered aggressively: useful history explains context; excessive history distracts the model and increases exposure of sensitive information.
Retrieval also needs ownership. A document that was helpful six months ago may now describe a retired process. Give important knowledge sources a maintainer, review date, access policy, and clear relationship to the domain service that enforces the rule.
Design agents as workflows with checkpoints
An agent should not be treated as a mysterious employee inside an API call. Treat it as a workflow participant with a limited role, observable state, and explicit checkpoints.
For example, an onboarding agent can gather information, detect missing fields, explain requirements, and prepare provisioning requests. It should not silently create privileged access based only on a conversation. The final provisioning step should pass through identity controls, role mapping, and approval rules already used by the rest of the organization.
- Accept the user request and establish identity and scope.
- Retrieve authoritative context for the relevant business entity.
- Ask the model to classify, extract, plan, or explain within defined limits.
- Validate every proposed action against domain rules.
- Execute permitted actions and record an audit event.
- Escalate uncertainty, policy conflicts, or high-impact decisions.
This may sound less autonomous than the popular image of an agent. It is more useful. Reliable autonomy comes from reducing the number of decisions that depend on unconstrained inference.
Make uncertainty actionable
“The model is not sure” is not a complete product behavior. Systems need a practical response to uncertainty. That may mean asking a targeted follow-up question, presenting evidence for human review, choosing a safe default, or declining to act.
Confidence scores alone are rarely sufficient because they do not capture business impact. A low-confidence suggestion to rephrase a knowledge-base article is different from a high-confidence suggestion to change a customer’s payment terms. Design escalation around both uncertainty and consequence.
A useful decision policy asks: What is the worst credible outcome if this action is wrong? If the answer includes financial loss, access exposure, legal commitment, or irreversible data changes, require stronger verification or human approval.
Evaluate the system at the workflow level
Teams often evaluate models with isolated prompts and a handful of examples. That is necessary, but it is not enough. The system must be tested across the workflow: retrieval, tool selection, validation, retries, authorization, logging, and escalation.
Create representative scenarios that include ordinary cases, incomplete information, contradictory records, stale documents, unavailable dependencies, and adversarial inputs. Verify not only whether the final answer sounds plausible, but whether the system took the correct action—or correctly refused to take one.
Production telemetry should answer operational questions: Which actions are proposed most often? Which validations fail? Where do humans override the system? Which sources are repeatedly retrieved but rarely useful? These signals expose gaps in both the model behavior and the surrounding business design.
The goal is a better decision boundary
AI will continue to make individual tasks faster. That is valuable, but it is the entry point, not the destination. The larger opportunity is to turn implicit business knowledge into systems that can be consulted, validated, and improved without removing human accountability.
Build for that boundary. Let models interpret language and surface possibilities. Let domain software protect truth, policy, and state. Let people own the decisions that carry real consequence. When those roles are designed deliberately, AI stops being a clever task runner and becomes a dependable participant in how the business works.