Some of the most valuable data in an enterprise lives in systems that were never designed for AI.
An ERP may have been implemented more than a decade ago. A CRM may contain years of custom fields and business rules. A mainframe may still run critical claims or transaction processing through COBOL applications that have worked reliably for years but expose little or no modern API access.
The challenge is not simply getting data out of these systems.
An AI application needs data in a form it can retrieve, interpret, and use safely. That means integration decisions have to account for data freshness, system ownership, schema changes, identity, access control, and the operational limitations of the source systems.
There is no single integration pattern that works for every enterprise environment. Four approaches cover many of the common scenarios, with the right choice depending on how current the data needs to be and what access the existing systems provide.
Pattern 1: Read Replica and Scheduled Extraction
For many enterprise applications, a read replica combined with scheduled extraction is a practical place to start.
Instead of querying the production database directly, the AI data pipeline reads from a replica or approved reporting database. An extraction job runs on a defined schedule, transforms the data into the format required by the AI or retrieval layer, and then indexes it.
This approach is particularly useful when the data does not need to be real-time.
Use it when
The underlying information can tolerate some delay, such as data that changes hourly or daily, and you have approved database-level access.
For example, an internal AI assistant answering questions about customer history may not need to reflect a transaction that happened 30 seconds ago.
Watch for schema changes
Legacy systems are rarely static.
A source-system team may add, rename, or change a field without considering the downstream AI pipeline. If the extraction process does not detect schema changes, the result can range from a failed pipeline to something more dangerous: a pipeline that continues running but produces incorrect data.
Schema validation and automated alerts should therefore be part of the integration rather than something added after the first failure.
Watch for soft deletes
Deleted records can create another subtle problem.
Some systems do not physically remove a record when it is deleted. Instead, they mark it as inactive, archived, or deleted.
If the AI index does not receive that state change, an old record may continue to appear in retrieval results and be presented as current information.
The extraction process therefore needs to capture deletion and status changes, not just newly created records.
Pattern 2: Build an Intermediate API Layer
Sometimes the source system already has an API, but it was designed for a very different purpose.
A CRM API may work well for individual record updates but become inefficient when an AI application needs to retrieve large amounts of related data. An ERP API may expose transactions through endpoints designed around the application’s user interface rather than the questions an AI system needs to answer.
In these situations, an intermediate service can provide a more suitable access layer.
The service can combine multiple source endpoints, apply business rules, normalise the response format, and expose only the information required by the AI application.
Use it when
The source system has programmatic access, but its existing API is unsuitable for the required query patterns, performance, or data model.
It is also useful when the AI application needs relatively current information rather than a periodically refreshed snapshot.
Watch for rate limits
Enterprise APIs are often designed around human-driven application usage, not unpredictable AI workloads.
A single user request can trigger multiple retrieval operations, and a growing user base can multiply that traffic quickly.
Caching, request batching, pagination, retry logic, and rate-limit handling should therefore be part of the architecture from the beginning.
Otherwise, an AI application can appear stable during testing and then start hitting API limits as soon as production usage increases.
Pattern 3: Change Data Capture
When data needs to stay close to real time and polling is not practical, change data capture (CDC) can be a better fit.
CDC monitors changes in a database, often by reading transaction logs or another database-supported change stream, and publishes those changes as events that downstream systems can process.
This allows the AI data pipeline to update incrementally instead of repeatedly extracting the entire dataset.
Use it when
Data freshness genuinely matters, the source database supports an appropriate CDC mechanism, and the organisation is prepared to operate the additional infrastructure.
For example, a fraud detection workflow or operational assistant may benefit from receiving changes within minutes rather than waiting for a nightly extraction.
Watch for operational complexity
CDC is not simply another connector.
It introduces its own infrastructure and failure modes. Teams need to consider monitoring, checkpointing, retries, event ordering, replay, schema evolution, and what happens when the downstream consumer falls behind.
The operational question matters as much as the architectural one:
Who will maintain the CDC pipeline when something goes wrong?
A near-real-time architecture is only useful if the organisation can operate it reliably.
This is also where project scoping can go wrong.
Proposals for custom AI software development that include a data-access assessment early in the process can identify whether scheduled extraction, an API layer, CDC, or another approach is appropriate before development estimates are finalised.
If the integration architecture is discovered halfway through development, changes to scope, infrastructure, and delivery timelines become much harder to manage.
Pattern 4: Terminal-Based Integration as a Last Resort
Some mainframe environments genuinely have limited programmatic access.
The data exists. The application displays it through a terminal interface. The underlying system may be highly reliable, but there may be no supported modern API for accessing the information.
In those cases, terminal emulation or screen-based integration can provide a bridge to the existing system.
It is not the preferred architecture, but it can be useful when replacing or modifying the underlying system is impractical.
Use it when
The business value of accessing the data is high, supported integration options are unavailable, and the organisation accepts the additional maintenance burden.
Watch for fragility
Screen-based integrations depend on the structure and behaviour of the terminal application.
A change to a screen layout, field position, navigation flow, or authentication process can break the integration.
For that reason, this approach should generally be treated as a bridge rather than the long-term target architecture where a more stable integration method is feasible.
The important thing is to document the dependency and have a plan for what happens if the underlying application changes.
The Identity Problem Nobody Scopes Early Enough
Data access is only half the integration problem.
The other half is knowing that records from different systems refer to the same thing.
A customer may have one identifier in the ERP, another in the CRM, and a third in the support platform. An email address may appear to be a common key until it changes, is shared by multiple contacts, or is stored differently across systems.
The same issue applies to employees, suppliers, products, assets, policies, and other business entities.
Imagine an AI assistant asked:
“Show me all outstanding issues for this customer and explain how they relate to their current contracts.”
To answer that question reliably, the system may need to connect:
- A CRM customer record
- An ERP account
- Support tickets
- Contracts in a document repository
- Possibly billing or payment records
If those systems do not share a reliable identifier, the AI model cannot solve the problem simply by being smarter.
The underlying data needs to be reconciled first.
This is known as entity resolution or record linkage, and it can become a substantial data engineering workstream.
Providers with enterprise integration experience should identify this during discovery rather than treating it as a minor implementation detail. When evaluating an approach to enterprise AI software development, it is worth asking specifically how customer, employee, product, and asset identities will be resolved across source systems.
Permissions Across Systems
Cross-system permissions introduce another layer of complexity.
Each enterprise application may have its own access model.
The ERP may control access through roles, business units, or cost centres. The CRM may use territory, ownership, or team-based permissions. A document repository may rely on folder inheritance and group membership.
These models do not automatically become compatible when their data is connected to an AI system.
Consider an AI assistant that can search across all three sources. A user may have permission to see a customer’s CRM record but not their financial information in the ERP.
The retrieval system needs to understand that distinction before restricted information reaches the model.
A common approach is to carry relevant entitlement metadata from the source systems into the AI index and apply permission filters during retrieval.
But that requires the data pipeline to capture more than business content. It also needs to preserve the access context associated with that content.
This is why permissions should be treated as part of data architecture rather than as a UI feature added at the end.
Mainframe Protocol Bridges, CDC Latency Benchmarks, and Retrieval-Time RBAC Filtering
Moving from architectural diagrams to production deployment requires concrete protocol adapters and deterministic security filtering. In legacy enterprise landscapes, transaction records typically originate across IBM z/OS DB2 subsystems accessed via IETF RFC 2355 TN3270E terminal streams or CICS transaction gateways, ERP ledgers exposing SAP BAPI/IDoc interfaces, and cloud relational replicas managed in PostgreSQL. Before indexing these records for retrieval-augmented generation (RAG), data engineering teams execute Fellegi-Sunter probabilistic record linkage alongside scikit-learn TF-IDF character n-gram similarity to reconcile unshared customer and vendor keys across systems.
| Integration Pattern | Representative Protocols & Connectors | End-to-End Replication Latency | Mainframe / Source CPU Impact (MIPS) | Schema Drift & RBAC Propagation |
|---|---|---|---|---|
| Scheduled Read Replica & Batch ETL | PostgreSQL Logical Standby, JDBC Bulk Copy, SFTP Flat Files | 4–24 hours | Low (offloaded to secondary replica) | High risk of stale ACLs during batch window; requires full snapshot reconciliation |
| Intermediate REST / GraphQL API Overlay | SAP OData / BAPI Gateway, CICS Transaction Server REST Bridge | 80–350 ms (synchronous per query) | Moderate to High under burst traffic | Enforces live session auth, but vulnerable to downstream rate limiting (HTTP 429) |
| Log-Based Change Data Capture (CDC) | Transaction Log Tailers, WAL Decoding, Event Streaming Topics | 0.5–3.0 seconds | Minimal (< 2–4% overhead reading redo logs) | Propagates row-level deletes and ACL updates continuously via dead-letter queues |
| Terminal Emulation (RFC 2355 TN3270E) | 3270 Screen Buffer Parsers, RPA Session Pools | 1.5–8.0 seconds per multi-screen flow | High per-transaction session overhead | Fragile to field-coordinate shifts; requires strict regression harnesses |
Simultaneously, propagating NIST role-based access control (RBAC) entitlements into the vector index ensures that query-time filtering enforces source-system permissions prior to top-k nearest-neighbor retrieval. Using Python and PostgreSQL row-level security predicates prevents unauthorized chunks from ever entering the LLM context window:
from dataclasses import dataclass
from typing import List, Set, Dict, Any
@dataclass
class IndexedChunk:
chunk_id: str
canonical_entity_id: str
source_system: str # e.g., "SAP_ERP_IDOC", "DB2_CDC", "SALESFORCE_CRM"
allowed_roles: Set[str]
tenant_org_unit: str
is_soft_deleted: bool
embedding: List[float]
text: str
def prefilter_authorized_chunks(
candidates: List[IndexedChunk],
user_roles: Set[str],
user_org_unit: str,
) -> List[IndexedChunk]:
"""Enforce NIST RBAC and CDC tombstone exclusions prior to vector similarity ranking."""
authorized = []
for chunk in candidates:
if chunk.is_soft_deleted:
continue
if chunk.tenant_org_unit != user_org_unit:
continue
if not (chunk.allowed_roles & user_roles):
continue
authorized.append(chunk)
return authorized
FAQ
Can AI work with mainframe data that has no API?
Yes, but the approach depends on what access the mainframe environment supports.
Options can include an approved database connection or read replica, scheduled batch extraction, existing integration middleware, change data capture where supported, or terminal-based integration as a last resort.
The main constraint is often not whether the data can technically be accessed. It is whether the organisation has the required permissions, operational support, and a safe way to expose that data to the AI application.
How long does AI legacy system integration typically take?
There is no reliable timeline that applies to every enterprise environment.
The effort depends on the number of source systems, quality of existing APIs, data volume, required freshness, identity resolution, permission models, security requirements, and whether new infrastructure needs to be introduced.
Projects involving several systems should estimate integration and data engineering as a major workstream rather than assuming it is a small prerequisite to AI development.
Should we build a data warehouse first?
Not necessarily.
If an existing data warehouse or lake already contains the required information and is sufficiently current, it may be the most practical source for the AI application.
Building a new warehouse solely to support one AI use case can introduce significant additional scope. A targeted integration or access layer may be more appropriate when the AI application only needs a limited set of data from a few systems.
The decision should be based on the organisation’s broader data strategy, the number of future use cases, data freshness requirements, governance needs, and the cost of maintaining another data layer.
Sequencing the Work
The order of the work matters.
1. Assess access first
For each source system, establish:
- What programmatic access exists
- Who owns that access
- What data can be exposed
- How frequently it changes
- What latency and rate limits apply
- What security and compliance restrictions exist
This assessment determines which integration patterns are realistic.
2. Resolve identity second
Before building cross-system AI workflows, determine how customers, employees, products, assets, and other relevant entities will be linked across systems.
If the identity mapping is unreliable, answers that combine information from multiple sources will be unreliable regardless of how capable the AI model is.
3. Design permissions alongside the data pipeline
Do not treat access control as a final application-layer feature.
Determine how source-system permissions will be represented, propagated, and enforced during retrieval.
4. Build the integration pipeline
Choose the appropriate pattern for each source: scheduled extraction, an intermediate API, CDC, terminal-based integration, or an existing enterprise data platform.
Include schema monitoring, error handling, retries, logging, and data-quality checks from the beginning.
5. Build the AI layer on top
Once the data is accessible, identity is resolved, and permissions are understood, the AI model becomes one component of the overall system rather than the centre of the architecture.
That is often the key lesson in enterprise AI integration.
The hardest part is not connecting an AI model to the enterprise. It is making sure the model receives the right information, from the right system, for the right user, at the right time.
Entity Resolution, Relational Schema Governance, and Retrieval-Time Access Control
In production retrieval-augmented generation (RAG) pipelines, deterministic and probabilistic record linkage reconciles disparate primary keys across ERP ledgers, CRM tables, and ticketing databases before vector indexing. Simultaneously, propagating NIST role-based access control (RBAC) metadata into the retrieval index ensures that query-time filtering enforces source-system entitlements prior to context window assembly. Engineering leaders scoping AI consulting and systems integration roadmaps should also weigh architectural complexity against maintenance overhead by evaluating when another enterprise integration becomes technical debt rather than operational progress.
For further technical perspectives on enterprise data architecture, RAG verification, and ERP modernization, explore our guides on connecting Salesforce Data Cloud, Databricks, and Agentforce, our practical RAG evaluation checklist for retrieval quality, streamlining ERP workflows and architecture, and AI simulation and digital adoption for enterprise software training.
Atlas Paragon Small Business Operations & Security Guides
Independent, evidence-backed checklists for small-business software selection, accounting workflows, and security.