Embedding Intelligence in Business Systems: Two Integration Paths
When adding large language models to complex business systems, teams often choose between a loosely coupled low-code orchestration platform and native in-app integration with existing identity, transactions, and domain rules. This article compares when each path works, why native integration better handles state-changing flows, and how to implement a constrained order-spec-change example.
When connecting large language models to complex business systems, teams often hesitate between two paths. One is a standalone low-code intelligence platform that uses visual orchestration and external APIs for Q&A and customer-service scenarios. The other is to put model calls, tool execution, and domain rules inside the existing application process, sharing the same transactions and identity model as orders, inventory, and permissions. The first is faster to start and loosely coupled to core systems. The second is less likely to go out of control in flows that change state across systems, need strong consistency, and change frequently. This article discusses general engineering trade-offs, not a specific product.
When standalone orchestration fits—and when it does not
Independent knowledge-base Q&A, scripted customer service, and campaign FAQs have clear business boundaries. Reads and writes are mostly retrieval and display; failures can be retried or handed to a human. The platform talks to core systems over network APIs, and release cycles are separate, which suits small and mid-size teams that need a fast launch.
Once a conversation must drive real business changes, the problem shifts from “is the answer accurate?” to “is the mutation correct?” A typical request: a user asks whether last week’s purchase of a given SKU has shipped, and if not, wants to change the specification. That involves identity, order lookup, logistics status, inventory and change eligibility, write-back, and audit. Every step depends on current user context, idempotency, and concurrency—not on assembling a few remote tools in one shot.
Loose coupling has a cost: auth must be re-checked at gateway, session, and backend; each tool call adds latency and timeout surface; state is passed as API snapshots, so you can see “not shipped” then submit after it has shipped; when rules change you must update both backend and orchestration config, and versions drift. Standalone platforms can run complex flows, but once domain constraints are pushed outside the domain layer, engineering cost rises quickly.
Why native in-app integration helps
Put intelligence inside the business application. The model is a dependency of a domain service; tools are local methods or application services, not a second remote contract.
Identity and permissions stay consistent. Dialogue requests use existing login and session. The server looks up orders with the current user id and never lets the client pass an arbitrary user id. Fine-grained permissions, data isolation, and operation audit share existing middleware, reducing the risk of a separate tool-layer token scheme.
Transactions and consistency can follow the business. Queries can be read-only. Changing a spec can validate logistics, lock inventory, write the order, and record a ledger in the same transaction or the same application service. Even with eventual consistency, compensation and idempotency keys live in the domain service, not in multiple orchestration callbacks.
Latency and failure surfaces are more controllable. In-process calls avoid extra round trips. Timeouts, circuit breakers, and degradation align with existing API policy. A model timeout must not hold an order lock; a useful pattern is confirm intent, execute asynchronously, then report the result.
Changes land in one place. When eligibility rules, color enums, or after-sales windows change, the domain service is the single source of truth. Prompts and tool descriptions ship with code review, avoiding dual-track drift between an orchestration canvas and API docs.
Observability and compliance. Logs, traces, and metrics sit on the same path as business requests. Sensitive fields are redacted; prompts and tool inputs/outputs are retained for audit—easy to miss when wiring a standalone platform.
Landing an e-commerce spec-change flow (illustrative)
The goal is not to map natural language to arbitrary write APIs. It is: understand intent → bind to the current user’s order → validate whether change is allowed → execute or refuse with an explanation.
Suggested layers: a dialogue entry (gateway or application API) for session and streaming; an in-app orchestrator (state machine or limited-step planner) for multi-turn clarification; domain services for query and mutation; the model only for slot extraction and wording—not a database connection.
Tools should be narrow: recent order summaries for the current user; logistics by order id (server checks ownership); spec update only when allowed. Avoid wide interfaces such as “generic order update.” Pseudocode shows structure only:
// Domain service: check ownership and eligibility, then writeOrderChangeResult changeSpec(UserId uid, OrderId oid, Spec spec) {Order o = repo.lockByUser(uid, oid);if (o == null) return deny("Order not found or not accessible");if (o.shipped()) return deny("Cannot change spec after shipment");if (!catalog.allows(o.sku(), spec)) return deny("Spec not available");inventory.reserve(spec);o.updateSpec(spec);audit.record(uid, oid, spec);return ok(o);}
The model only emits structured intent (order reference, target spec, confirmation). Code executes it. In multi-turn, first confirm which order “last week’s red mug” maps to, then execute, to avoid wrong updates.
Engineering practice
Tool granularity: split by use case. Let the server fill user and tenant; do not let the model supply forgeable fields.
Keep prompts with code: tool descriptions, refusal copy, and enums ship with versions. Integration tests should cover cases such as “refuse spec change after shipment.”
Idempotency: dialogue message ids or business idempotency keys so double-clicks do not change spec twice.
Degradation: fall back to forms or humans if the model is down; writes require a second confirmation.
Security: under prompt injection, tools still go through permission checks; outbound calls are allow-listed; logs are redacted.
Observability: record intent, tools chosen, domain denial codes, and latency so you can separate model error from business-rule refusal.
How to choose
If the scenario is mainly retrieval Q&A and scripted support, standalone orchestration and a knowledge base can validate quickly. If dialogue must change core data, cross multiple aggregates, and require strong permissions and audit, prefer native in-app integration: the model understands language; domain services keep correctness. A hybrid also works: standalone Q&A outward; order capabilities wrapped as application APIs inward; orchestration calls already-authorized application capabilities, not raw data APIs.
Treat intelligence as part of the business function, not a bolted-on chat window, so complex flows keep both experience and correctness. Choose by consistency, permissions, and change frequency—not by whether a feature list “can connect a model.”
