Ovladavanje vlasništvom nad sustavom: Izgradnja umjetne inteligencije koja doista poznaje vaše poslovanje
Most AI failures in business software are not model failures. They are ownership failures.
A model can summarize, classify, draft, and reason over text. But it does not automatically know which customer record is authoritative, whether an invoice is final, who may approve a refund, or what “active” means in a particular workflow. Those answers live in the systems your team already operates: databases, APIs, queues, policies, and the code that connects them.
Building AI that truly knows your business means treating business knowledge as a system ownership problem. The AI should not become a second, unreliable version of your application. It should be a carefully governed consumer of the systems that already own the truth.
Start with the question: who owns this fact?
Every useful AI feature relies on facts. Before exposing any fact to a prompt, identify its owner.
- A customer’s contractual plan may be owned by the billing service.
- Current inventory may be owned by an inventory database or warehouse API.
- Account permissions may be owned by an identity provider.
- A support agent’s internal notes may be owned by a case-management system.
- A calculation such as tax, eligibility, or pricing may be owned by application code.
This sounds obvious, but it changes design decisions immediately. If the billing service owns a subscription state, do not copy a stale version into an AI embedding index and ask the model to infer whether a customer can upgrade. Call a constrained application tool that reads the current state from the billing service and returns only the fields needed for the decision.
Retrieval is valuable for relatively stable, narrative knowledge: product documentation, operating procedures, policy explanations, and historical incident notes. It is a poor substitute for live operational truth.
Separate knowledge from authority
An AI assistant may know how a refund policy works without having authority to issue a refund. It may explain a deployment procedure without being allowed to deploy. These are distinct concerns, and combining them is where attractive demos become risky production systems.
A practical architecture usually has three layers:
- Knowledge layer: searchable documents, curated explanations, and domain terminology.
- Truth layer: APIs and databases that provide current, authoritative business state.
- Action layer: narrow operations that enforce validation, authorization, and audit logging.
The model sits above these layers as an interface and reasoning component. It can decide that it needs information, request a tool call, interpret the result, and present a useful response. It should not bypass the rules embedded in the action layer.
For example, “Can this customer receive a refund?” may require an order lookup, a payment-status check, a policy evaluation, and a permission check. The model can coordinate the conversation, but a backend endpoint should make the final eligibility decision.
Keep business rules executable
Business rules should remain in tested backend code, not drift into prompt wording. A prompt can describe policy, but it cannot provide the same guarantees as a deterministic service method.
In a PHP application, that may mean exposing a small service boundary such as RefundEligibilityService. The AI-facing endpoint supplies an order identifier and the authenticated actor; the service loads the current order, applies the rules, and returns a structured result. The model receives an explanation, not a blank cheque.
final class RefundEligibilityService
{
public function evaluate(Order $order, User $actor): EligibilityResult
{
if (!$actor->can('refund', $order)) {
return EligibilityResult::denied('Not authorized.');
}
if (!$order->isPaid() || $order->isRefunded()) {
return EligibilityResult::denied('Order is not refundable.');
}
return EligibilityResult::approved();
}
}
The exact rules will differ, but the boundary matters. It makes behavior testable, traceable, and consistent whether the request arrives from an AI assistant, an admin screen, or a public API.
Give the model smaller, safer tools
A common early mistake is offering one powerful tool with broad database access or a free-form query field. It feels flexible until the model requests too much data, misunderstands a field, or receives an error it cannot recover from safely.
Prefer task-oriented tools with explicit input and output shapes. Instead of “query the customer database,” provide operations such as:
get_customer_summary(customer_id)list_open_invoices(customer_id)check_refund_eligibility(order_id)create_draft_support_reply(case_id, tone)
These tools are easier to authorize, version, monitor, and test. They also reduce ambiguity for the model. A well-designed tool contract is often more valuable than a longer prompt.
Tool responses should be structured, compact, and explicit about uncertainty. Return stable identifiers, timestamps, status values, and machine-readable reasons. Avoid feeding an entire ORM object, raw exception, or unbounded result set into a model context.
Design for stale data, retries, and partial failure
AI features operate across boundaries: model calls, internal APIs, third-party services, background jobs, and browsers. Each boundary can fail. Production-quality ownership means deciding what happens when it does.
For read operations, show what is known and clearly state when fresh data could not be retrieved. For actions, use idempotency keys and require a confirmation step for meaningful changes. A model retry must not create two refunds, two tickets, or two shipment requests.
Asynchronous work deserves the same discipline as any backend workflow. Put slow or failure-prone actions on a queue, persist job state, and make retries safe. Record the user request, the validated action payload, the outcome, and the relevant correlation identifier. Logging every token is rarely useful; logging the business event is.
Docker does not change these principles. Whether services run on one host or across a cluster, configuration should make dependencies visible: database connection settings, queue credentials, timeout values, and model-provider credentials should be injected through environment-specific configuration rather than embedded in prompts or images.
Make retrieval a product, not a dumping ground
Retrieval-augmented generation works best when its content has an owner, a refresh path, and a purpose. A folder of exported documents is not a knowledge system.
For each retrieved source, define who maintains it, when it expires, what audience may access it, and whether it is descriptive guidance or authoritative policy. Chunk documents along meaningful boundaries such as sections, procedures, and product versions. Preserve metadata that lets the application filter by tenant, role, product area, or publication status before any content reaches the model.
Most importantly, do not use retrieval to conceal disagreement. If two policy documents conflict, fix the source of truth. Asking a model to reconcile inconsistent operational guidance may produce a polished answer, but not a dependable one.
Measure the workflow, not just the answer
Evaluation should reflect the business task. For a support assistant, assess whether it selected the right customer, respected permissions, used current policy, and escalated appropriately. For a developer assistant, assess whether its suggested change preserves API contracts, handles failure paths, and passes the relevant tests.
Create a small set of representative cases before broad rollout. Include normal requests, ambiguous requests, unauthorized users, missing records, stale documents, and tool failures. Run them whenever prompts, tools, policies, or backend contracts change.
This is ordinary engineering discipline applied to a probabilistic interface. The model may phrase answers differently each time; your system should still preserve the same guardrails and outcomes.
The durable advantage is clear ownership
The best business AI does not pretend to know everything. It knows where to ask, what it may reveal, what it may do, and when to stop.
That restraint is not a limitation. It is what turns an impressive conversation into a dependable capability. When authoritative systems remain authoritative, business rules remain executable, and AI tools remain narrow and observable, the assistant becomes easier to trust, improve, and maintain. In the end, the most intelligent system is not the one that guesses best. It is the one that knows where the truth belongs.