How Can an AI Assistant Combine ERP Data and Company Documents?
An AI assistant can combine ERP data and company documents by retrieving each part of an answer from its designated source. Use approved documents to explain policies and controlled ERP queries to retrieve current business values. Keep those sources separate in the answer, validate each query before execution, and show when the business data was retrieved.
Which questions need both sources?
Consider a question such as: “Can we release this customer's next order?”
A useful answer may need the credit policy, the customer's current outstanding balance, their credit limit and the value of the proposed order. These inputs serve different purposes.
The policy explains how to decide. The ERP supplies the business values used in that decision. A document containing an account balance from an earlier review should be treated as historical evidence, even if its wording closely matches the question.
Define that division before building the assistant:
| Information needed | Designated source | What the answer should show |
|---|---|---|
| Credit approval rule | Approved policy document | Document title, section and version |
| Outstanding balance | Authorised ERP query | Customer, balance definition and retrieval time |
| Credit limit | Designated customer account record | Account scope and currency |
| Proposed order value | Relevant order record | Order reference and included charges |
| Release recommendation | Documented rule applied to verified inputs | Calculation, assumptions and required approval |
If ownership is unclear, resolve it first. For example, decide whether an account-specific exception overrides the general policy and where an approved exception must be recorded.
How should the assistant retrieve company documents?
Limit document retrieval to material the user is allowed to access. Within that set, prefer approved, applicable documents over drafts or superseded versions.
Each retrieved passage should carry enough context to establish its meaning: document title, section, approval status, version and scope. A paragraph about one business unit should not silently become a company-wide rule.
Preserve qualifications around a passage. “Orders require approval” means something different from “Orders require approval only when the account exceeds its limit.” The assistant should cite the passage that supports its explanation, including the relevant condition.
When two applicable documents disagree, the answer should identify the conflict and request a decision from the policy owner. Do not let the assistant choose whichever passage produces the more convenient outcome.
For access boundaries, start with what data an AI agent should be able to see.
How should controlled ERP queries work?
Give the assistant a small set of approved business queries, such as “get customer credit position” or “get available stock for an item and location.”
Each query should define:
- The permitted inputs and required identifiers.
- The records and fields it may return.
- The user's access scope.
- The business meaning of each returned value.
- The conditions under which it must refuse the request.
Validate the request outside the assistant before execution. Confirm that the user may access the selected company, customer or location. Check parameter types, required filters and result limits. Reject requests that exceed the approved query's purpose.
Resolve ambiguous names before querying. If “Central Supplies” identifies several customers, ask the user to select the account. A plausible match is insufficient for a balance used in an operational decision.
Keep queries used to answer questions read-only. Treat changing a credit limit or releasing an order as a separate action with its own validation and approval requirements.
What does query validation need to check?
A successful query response still needs business checks before its values support an answer.
Define whether “outstanding balance” includes disputed invoices, unapplied payments or open orders. Define whether “available stock” excludes reservations. These definitions belong in the approved query contract so the assistant does not improvise them.
Check that returned values share a compatible scope. Do not subtract a balance in one currency from a limit in another. Do not combine a company-wide limit with a balance covering only one branch unless the policy explicitly permits that comparison.
Treat missing values as missing. An empty credit-limit field must not become zero, and a failed balance query must not become “nothing outstanding.”
Where several queries contribute to one decision, define an acceptable consistency window. If the system cannot provide sufficiently consistent inputs, disclose that limitation and stop short of a firm recommendation.
How should source attribution appear in the answer?
Attach attribution to the claim it supports.
For a policy explanation, show the document title, section and version. For a business value, show the ERP record or query reference, scope and retrieval time. Provide a link to the underlying source where the reader has permission to open it.
A single source list at the bottom is insufficient if readers cannot tell which source supports which sentence.
Separate three kinds of statement:
- Retrieved rule: what the approved policy says.
- Retrieved value: what the ERP returned.
- Derived result: what the assistant calculated or concluded from those inputs.
This makes the reasoning reviewable. It also gives a person a clear way to challenge an incorrect input without having to reject the entire answer.
How fresh is a live answer?
Define freshness according to the decision. A background account summary and an order-release decision may need different freshness requirements.
Distinguish the time the assistant retrieved a value from the time the source last updated it. A query executed just now against an older snapshot should be described as a snapshot, with its recorded update time.
If the source's update time is unknown, say so. Avoid labels such as “live balance” when the connection cannot establish that freshness.
Recheck decision-critical values before an action when the agreed freshness window has expired. A balance retrieved earlier in the conversation should not automatically authorise a later order release.
If the ERP is unavailable, the assistant can still explain an accessible policy. It should state that it could not verify the current balance and leave the operational decision unresolved.
What would a combined answer look like?
The following example is illustrative. All amounts, document labels and policy conditions are invented for explanation.
Suppose the approved credit policy requires review when an order would take an account above its limit. The ERP returns a limit of 50,000, an outstanding balance of 42,000 and a proposed order of 12,000, all in the same currency and account scope.
A reviewable answer could say:
> This order would exceed the account's credit limit by 4,000, so it requires review under the Credit Policy, section “Order release”, approved version.
>
> The ERP query returned a credit limit of 50,000, an outstanding balance of 42,000 and a proposed order value of 12,000 for the selected account. These values were retrieved for this answer; their retrieval time and source update time are shown alongside the account reference.
>
> Calculation: 42,000 + 12,000 = 54,000 against a limit of 50,000.
>
> The order remains pending approval.
If an older account-review document states a balance of 30,000, label it as historical. Do not use it to replace the ERP result or average the two values.
Place the approval step explicitly; human review in AI agents explains how to define that boundary.
What common mistakes should you avoid?
Treating retrieved text as permission. A document may describe an approval process. It should not grant the assistant access to additional records or permission to execute an action.
Hiding incomplete results. If a query returns only part of the requested scope, disclose that gap and avoid presenting a complete total.
Using vague business terms. Agree what “balance”, “available” and “overdue” mean before using them in decisions.
Testing only clean examples. Include ambiguous accounts, conflicting policies, stale snapshots, denied access and failed queries in the acceptance cases.
What should a first pilot prove?
Choose one question, one policy family and a small set of read-only queries. Define the expected answer and the conditions that require the assistant to stop.
Verify that it selects the correct account, attributes each claim, rejects unauthorised requests and labels stale or missing data honestly. Include an old document containing a convincing but outdated balance.
Agree these acceptance conditions before the pilot, following how to run an AI pilot that ends in a decision.
Frequently asked questions
Can documents alone provide a current balance?
For this design, use documents for historical context and policy. Retrieve the current balance through the designated ERP query. If that query is unavailable, leave the balance unverified.
Does the assistant need access to the entire ERP?
Start with narrowly scoped queries that answer the chosen business question. Expand access only when a defined use case requires additional records or fields.
Can the assistant act on its answer?
Only through a separately authorised action. Revalidate permissions, policy conditions and decision-critical values at that point, and obtain human approval wherever the agreed process requires it.