Legacy coexistence
AI Integration with Legacy Systems
Connect AI to legacy applications through supported interfaces, controlled adapters and record-level reconciliation throughout coexistence.
A legacy application can remain the system of record while an AI service helps interpret documents, prepare updates or explain exceptions. The difficult work is establishing a supported route into that application without losing transaction meaning or creating two competing sources of truth. A successful connection is only the start of that work.
This guide is for IT owners integrating AI with older applications that may offer file exchange, a restricted API, database views or only an operator interface. It focuses on adapters, coexistence and reconciliation. The worked example is a batch exchange of asset-service records, with explicit handling of accepted, rejected and unknown outcomes.
Choose the interface by the evidence it can provide
Inventory the interfaces the application owner or vendor supports. Record what each can read, change and acknowledge. A documented application API may be preferable, but a controlled batch interface can be a sound choice when immediate execution is unnecessary and it provides reliable per-record outcomes. The absence of a modern REST endpoint does not automatically justify screen automation or database writes.
| Interface | Useful when | Evidence gap to resolve |
|---|---|---|
| Supported application API | The required operation and permissions are exposed. | Confirm business-state validation and recovery after an uncertain response. |
| Controlled file exchange | The process tolerates batches and has a defined import contract. | Prove file completeness, record outcomes and duplicate handling. |
| Read-only database view | Approved reporting access provides the needed context. | Establish freshness, meaning and permission scope; it is not a write interface. |
| Operator-interface automation | No suitable supported interface exists and the process can be tightly bounded. | Detect changed screens, session loss, partial actions and ambiguous confirmation. |
| Application extension | A small supported change can expose a reliable business operation. | Agree source ownership, vendor support, regression and maintenance. |
Evaluate workload and operational tolerance alongside technical reach. A nightly validated import may be more appropriate for a low-frequency review process than a fragile imitation of an operator. Conversely, a batch that cannot meet the required decision window should not be described as real-time integration. Make the latency trade-off explicit.
Use an adapter to protect meaning
A legacy field named status may encode several historical meanings that a new AI service should not need to reproduce. Define a small canonical contract for the new service, then translate it at an adapter boundary. Microsoft's anti-corruption-layer pattern describes this separation between systems with different semantics. It is an architectural pattern, not a requirement to buy a particular cloud product.
The adapter should have a documented purpose: mapping identifiers, translating values, validating the supported operation and preserving acknowledgement meaning. Avoid putting every new business rule into it simply because it is convenient. Rules owned by the source application should remain recognisable, while new AI proposal rules should have their own owner.
Record the adapter's limitations. It adds a component that needs deployment, monitoring and support, and it cannot make an unreliable source acknowledgement reliable by renaming it “success”. Integration architecture patterns helps compare adapter placement and orchestration choices, while custom CRM contract discovery is useful where the legacy application has undocumented business semantics.
Worked example: a batch contains 300 asset-service updates
In an illustrative estate, AI extracts proposed service classifications from approved technician notes. A reviewer accepts a batch of 300 asset-service updates for a legacy maintenance application. The export contains a batch identifier, record identifiers and a controlled operation reference for each item. The legacy importer returns 289 accepted records, eight rejected records and no conclusive result for three records.
The reconciliation equation is 300 = 289 accepted + 8 rejected + 3 unknown. The integration is not allowed to mark the batch complete by counting only the 297 known results. Nor should it resend all 300 records, because some accepted records may trigger a repeated business effect on import.
For the eight explicit rejections, retain the reason and determine whether corrected data requires fresh review. For the three unknown outcomes, use the application's supported lookup or reconciliation report to establish whether they committed. If no reliable lookup exists, hold them for authorised investigation. A timeout or missing line in a result file is not proof that the corresponding operation failed.
The original batch remains immutable as evidence. Corrections or authorised retries receive their own execution references linked to the original operation. This preserves what was approved, what was attempted and what eventually happened without rewriting the history to look cleaner.
Specify the file contract and acknowledgement contract separately
The file contract should define encoding, separators, quoting, line endings, date formats, mandatory fields and treatment of empty values. Include Arabic and mixed-language test records. Distinguish a byte-level checksum used to detect file changes from business validation of the records inside it. A matching checksum does not prove that the file contains the right assets or authorised updates.
Agree how a complete file becomes visible to the importer. The receiving system should not read a file that is still being written. The supported mechanism may involve an agreed transfer protocol, a completion marker or another documented handover. Do not assume that a local file rename provides the same guarantee across every storage and transport arrangement.
The acknowledgement contract must state whether it reports receipt, validation or committed application changes. Require a clear link to the submitted batch and record references. If the legacy system provides only a file-level result, establish whether that result is truly all-or-nothing or whether a separate record-level report is required. Acceptance must reflect the actual importer behaviour.
Keep coexistence from producing competing writers
During rollout, operators may continue using the original interface while the new integration begins processing selected records. Define who owns each operation and how competing changes are detected. A new AI feature should not quietly become a second master for fields that the legacy application still controls.
Choose a narrow cutover boundary: one operation, one approved record group or one scheduled batch. Compare outcomes in a read-only or proposal-only stage where useful, then enable controlled execution with a clear rollback decision. The strangler-fig pattern describes gradual replacement of selected functionality while systems coexist. Adding AI beside a legacy application does not itself require replacing the whole application.
When a path is replaced, identify the old jobs, credentials and manual procedures that must be disabled or redirected. Leaving both active can duplicate work even when each path behaves correctly in isolation. Keep the coexistence map current until the relevant old path is retired.
Define rollback as a business decision
Stopping new submissions is different from reversing committed changes. A technical rollback of the adapter does not undo records already accepted by the legacy system. Before release, decide which changes can be corrected, which require a compensating business action and which should remain with a recorded exception.
For the illustrative batch, rollback could mean pausing the next batch, preserving all receipts and investigating the affected records. It should not mean restoring an old database snapshot that would erase legitimate work performed by other users. The recovery approach must respect the source application's supported procedures and retention requirements.
Deployment models can help organise the release boundary. Integration timeline planning should include the legacy owner's change windows, test-data preparation and reconciliation availability as dependencies, rather than presenting connector development as the entire schedule.
Test the conditions the old interface handles poorly
Use controlled tests for incomplete files, duplicate batch identifiers, malformed Arabic text, invalid reference codes, unavailable destinations and late acknowledgements. Include a record changed by an operator after export. Verify that the integration can explain which records require attention and why, without asking staff to compare two large spreadsheets manually.
For screen automation, explicitly test a changed layout, unexpected dialogue, expired session and partial completion. A screenshot that resembles success is weaker than an application record or supported report confirming the result. If reliable confirmation is unavailable, reduce the action scope or retain human operation; do not hide the evidence limitation.
The integration test plan should include the reconciliation arithmetic and an operator exercise. Ask a person who did not build the adapter to resolve a simulated partial batch using the handover instructions. This tests whether the design is supportable, not just whether its developer can debug it.
Deliver a maintainable bridge
The handover should contain interface contracts, mappings, supported limits, credentials ownership, batch or operation history, exception procedures and the retirement criteria for any replaced path. Keep source extracts and sensitive technician notes under appropriate access controls; routine logs can usually refer to them rather than duplicate them.
For AI integration and delivery with OpenForAI, bring the supported legacy interfaces, a masked sample exchange and an example of how the application confirms a completed operation. Enquire about integrating AI with a legacy system around a defined business change. The practical deliverable is a bridge whose outcomes can be reconciled and supported throughout coexistence.
FAQ
Your questions, answered.
Can AI integrate with a legacy system that only imports files?
Yes, when the process tolerates batch timing and the import interface has a reliable contract. Define completeness, encoding, identifiers, validation and acknowledgement semantics. Prove how accepted, rejected and unknown records are reconciled. File transport alone is insufficient: the project needs evidence of the application outcome and a safe procedure for corrections and retries.
When is screen automation appropriate for a legacy AI integration?
Consider it only after assessing supported interfaces and the practical constraints of the task. The action must be bounded, the interface stable enough to test and the outcome independently confirmable. Include changed screens, session expiry and partial completion in acceptance. If reliable confirmation is unavailable, retain human operation or narrow the scope rather than claiming dependable autonomous execution.
How should a legacy batch with partial results be reconciled?
Account for every submitted operation as accepted, rejected or unknown, using durable batch and record references. Correct explicit rejections under the agreed review process. Investigate unknown outcomes through supported lookup or operator reconciliation before retrying. Keep the original batch unchanged and link later attempts to it, so that completed work is not repeated blindly.
Does an anti-corruption layer require replacing the legacy application?
No. It translates between different system meanings and can support long-term coexistence. Whether replacement is appropriate is a separate decision. Keep the adapter focused on its agreed boundary, with ownership and operational support. If it is temporary, define the condition for retirement; if it is permanent, plan its lifecycle as a maintained component.
What does rollback mean after a legacy import has committed?
It may mean stopping new work and using supported correction or compensating procedures for affected records. Rolling back adapter code does not reverse committed source changes. Avoid restoring a database snapshot that would erase unrelated legitimate activity. Define recovery with the application owner and retain the receipts needed to identify precisely what requires attention.
How can we prevent duplicate processing while old and new paths coexist?
Assign one authoritative path for each operation or record group and document when that ownership changes. Identify old jobs, credentials and manual procedures that must be disabled or redirected at cutover. Test duplicate and delayed messages, and preserve operation references for reconciliation. Two independently correct paths can still duplicate business work when both remain active.