When I ran IT at a retail chain between 2012 and 2021, most of our systems had been running for years, touched every corner of the business, and were the kind nobody dared change lightly. What I learned while building a data warehouse and business intelligence (in Turkish) on top of Nebim V3, a retail ERP widely used in Türkiye, still holds for AI projects today: you can connect a great deal to an old system without changing it, as long as you choose the direction and the owner of the connection correctly.
There is a sentence I often hear from CIOs: “Let’s renew the ERP first, then we’ll look at AI.” That decision postpones AI projects for years. In most scenarios, what AI wants from the ERP is not a new ERP; it is safe, regular access to its data.
Four integration patterns
| Pattern | How it works | When it fits | Risk |
|---|---|---|---|
| Reading through a data warehouse | AI reads ERP data from the data warehouse or a read replica | Forecasting, analysis, reporting, recommendations | Low; data freshness is limited |
| API layer | A service placed in front of the ERP exposes specific operations through a defined interface | Real-time queries, limited and controlled writes | Medium; the API needs an owner and maintenance |
| Event stream | Changes in the ERP (orders, stock movements) are published as events and AI reacts to them | Real-time alerts, automated workflows | Medium; the event schema has to be protected |
| Human-approved write | AI produces a suggestion, the user approves it, and the transaction passes through the ERP’s own rules | Scenarios that create or change records in the ERP | Low, as long as the approval step is kept |
Reading through a data warehouse
The safest start. Most scenarios, such as demand forecasting, stock optimisation, customer segmentation and anomaly detection, only need to read. A data warehouse or a read replica of the ERP gives the AI team a stable, documented data layer. Querying the ERP’s live database directly carries both performance problems and the risk that the schema changes after an ERP upgrade.
API layer
Where real-time information is needed (for example, a chat assistant answering “what is the status of this order?”), the right approach is to put a thin service layer in front of the ERP. This layer exposes only defined operations, enforces authorisation and logs every call. AI assistants and agents should reach the ERP through this layer, not through its internal tables. I discuss the permissions to give agents in detail in the article on AI agents and MCP.
Event stream
When changes such as “order created”, “stock fell below threshold” or “invoice issued” are published as events, AI can react to them immediately. If the ERP itself does not publish events, change data capture (CDC) or database triggers can be used in an intermediate layer. I describe how an event-driven architecture is built in the field, with an MQTT example, in the IoT and camera analytics article.
Human-approved write
AI writing records directly to the ERP is the riskiest pattern. A wrong order, a wrong price or a wrong stock adjustment has knock-on effects. In early projects the safer route is this: AI produces a suggestion, the user sees and approves it, and the approved transaction is recorded after passing through the ERP’s own business rules and permission checks. That way the validation logic the ERP has accumulated over the years is preserved.
The real problem is not the connection but data meaning
The technical connection usually takes a few weeks. What really takes time is data meaning. Over the years a field may have been used for different purposes; one store wrote the discount code in the description field, another in a separate field. Product codes changed and the old ones were never deleted. Some transactions ran outside the system, in Excel, and were entered in bulk later. The model can learn these inconsistencies as if they were real patterns.
So three pieces of work should come before integration:
- Data dictionary: for every field to be used, write down with the business unit what it means and how it was used in which period.
- Quality measurement: measure the share of missing, inconsistent and outlier records; do not train a model on data below the threshold.
- Business unit validation: review the model’s first outputs with the people who know the process. Only they can answer the question “is this pattern real, or just a data entry habit?”
Who owns the integration?
The most common problem I come across is an integration with no owner. The ERP team says “our system hasn’t changed”, the AI team says “our model hasn’t changed”, but after an ERP upgrade a field name changes, the connection breaks silently and the model runs on incomplete data for weeks. To prevent this:
- The integration should have an owner, with a name.
- The ERP change process should flag changes that affect the AI integration.
- The data flow should be monitored: an alert should fire when the expected number of records does not arrive.
Who should look at what?
CIO: The decision whether to tie the AI project to an ERP renewal is the CIO’s. Before the project starts, they should settle that the integration has a named owner and that AI will not be allowed to write directly to the ERP in the first version.
CTO: The CTO chooses which of the four patterns fits which scenario, and the architecture of the API layer and the event stream. Preventing direct queries against the live ERP database and making sure the event schema is protected are their responsibility.
IT manager: Makes sure the ERP change process flags changes that affect the AI integration and that the data flow is monitored. A connection that breaks silently because a field name changed after an upgrade is the risk most likely to land on their team.
A short checklist for the CIO
- Does the scenario only need to read? Then start with the data warehouse.
- If real-time access is needed, put an API layer with authorisation and logging in front of the ERP.
- If AI will create records in the ERP, make human approval mandatory in the first version.
- Have the data dictionary and quality measurement done before the connection.
- Write down the integration’s owner and monitoring method before the project starts.
Legacy systems hold most companies’ most valuable data. Tying an AI project to an ERP renewal means leaving that data unused for years. A project that starts with the right pattern can deliver its first result within a few months without touching the ERP; and the decision to renew the ERP is better made with that experience behind you.
Frequently asked questions
Should we replace the ERP or integrate it for AI?
For an AI project, integrate in most cases; replacing the ERP should only be on the table if it is being renewed for other reasons anyway. What AI needs is regular, safe access to the legacy system's data. That access can be provided through a data warehouse, an API layer or an event stream without touching the ERP itself. A decision to renew the ERP is also better made after the first experience gained through integration.
Can AI be connected to an old ERP system?
Yes, without touching the old system itself. For read-only scenarios, use a data warehouse or a read replica; if you need real-time access, an API layer with authorisation in front of the ERP; if you need real-time reactions, an event stream built with change data capture (CDC). The technical connection usually takes a few weeks; the work that really takes time is the data dictionary and data quality.
How do you integrate AI with Nebim V3?
The same patterns that apply to other legacy ERPs apply to Nebim V3, a retail ERP widely used in Türkiye; the safest start is reading ERP data through a data warehouse. When I built a data warehouse and business intelligence on Nebim V3 at a retail chain between 2012 and 2021, what I saw was that a great deal can be connected to an old system without changing it. Scenarios such as demand forecasting or stock optimisation only need to read; if records are to be written to the ERP, human approval should be mandatory in the first version.
Can AI write data directly to the ERP?
Technically yes, but it is not recommended for early projects. The safer route is for AI to produce a suggestion, for the user to see it on the ERP screen or an approval screen, and for the approved transaction to be recorded through the ERP's own business rules.
What is the biggest risk of an AI project on legacy systems?
Data meaning. Over the years the same field may have been used for different purposes, codes may have changed, and some processes may have run outside the system. The model can mistake these inconsistencies for real patterns. That is why the data dictionary and validation with the business unit come before the connection.
Should we use a data warehouse or the ERP database directly?
A data warehouse, if possible. Querying the ERP's live database directly carries both a performance risk and the risk of schema changes after an upgrade. A data warehouse or a read replica gives the AI team a stable, documented data layer.
