AI ·

How to Add AI to a Legacy System Without Rebuilding It First

by Maven Team, Software Development

A lot of businesses we talk to are stuck in the same loop. The board wants AI. The core system was built in 2008, runs on ColdFusion or PHP or an old .NET stack, and nobody wants to touch it. So the plan becomes "modernise first, then do AI", the modernisation is a two-year project nobody can get approved, and nothing happens.

There is a better order. You can ship a useful AI feature on top of an old system in weeks, without rewriting it, and do it in a way that moves the modernisation forward rather than adding to the mess. This is how we approach it.

Why legacy systems block AI

It is worth being clear about what actually gets in the way, because it is not the age of the code itself.

  • No way in. AI features need to read data and, eventually, take actions. Most legacy systems have no API. The only interface is the screens.
  • Data in strange places. Customer records in one database, notes in free-text fields, the important rules in a stored procedure nobody has opened since 2014.
  • Logic buried in the code. The business rules live in templates and page handlers, so an AI cannot use them without someone digging them out.
  • No visibility. No logging, no monitoring, no clear record of who changed what. That matters a lot once a model starts doing work.

None of these need a full rewrite to fix. They need a small, well-placed layer between the old system and the new capability.

Step 1: Pick one workflow, not "AI"

The most common reason first AI projects stall is scope. "Use AI across the business" is not a project. "Stop the operations team retyping enquiry emails into the job system" is.

A good first workflow usually has these traits:

  • It happens often. Daily, ideally many times a day, so the gain is obvious.
  • It is text-heavy. Emails, PDFs, notes, forms, manuals. This is where language models are strongest.
  • A person already checks the result. So there is a natural place for a human to approve what the AI produces.
  • You can measure it. Minutes per item, items per day, error rates. You want a before and after.

Examples we see again and again in older systems:

  1. Reading inbound emails or PDFs and turning them into a structured record in the old system.
  2. Answering staff questions from years of procedures, manuals and past cases.
  3. Summarising long case histories or account notes before a call.
  4. Classifying and routing incoming requests to the right team.

Pick one. Write down how it works today and how long it takes.

Step 2: Start read-only

The safest first AI feature reads from the legacy system and never writes to it. An assistant that answers "what is the status of this customer's last three orders and what did we promise them?" is useful on day one and cannot corrupt anything.

Read-only also forces you to answer the questions that matter later: where does the data really live, what does it mean, and which parts are trustworthy. If you want the detail on building this kind of assistant properly, our guide to building a production RAG chatbot covers the retrieval side.

Step 3: Put a thin API in front of the old system

This is the step that turns an AI pilot into the start of a modernisation.

Rather than letting a new AI service reach straight into the legacy database, build a small API that sits in front of the old system and exposes only what the AI feature needs. Three or four endpoints, clearly named, documented and tested:

  • GET /customers/{id}/summary
  • GET /orders?customer={id}
  • POST /enquiries/drafts

How you build it depends on what you have. In ColdFusion it can be a set of CFCs exposed as REST endpoints. More often we put a small Node.js service on AWS Lambda behind API Gateway, reading from database views that hide the worst of the schema. Either way, the legacy system keeps running exactly as it did.

That API is the first slice of a strangler-fig migration. Every endpoint you add for AI is one you would have needed anyway to modernise the platform. Over time more of the system sits behind the new layer, until replacing what is underneath becomes a series of small, safe steps instead of a big rewrite. If you already have an old REST API, moving it onto API Gateway is often the quickest way to get this layer in place.

Step 4: Draft, do not decide

When the feature does need to write, have the AI produce a draft that a person approves, and keep the legacy system as the system of record.

In practice that looks like this: the AI reads an enquiry email, extracts the customer, the job type, the address and the deadline, and creates a draft job through the new API. A member of the team sees the draft next to the original email, fixes anything that is wrong and clicks approve. Only then does the record land in the old system.

This does three things. It removes most of the typing, which is where the time goes. It keeps a person accountable for what goes into the business's core data. And it gives you a stream of corrections that tell you exactly where the AI is getting it wrong.

Once the approval rate is consistently high for a type of item, you can choose to let those through automatically and keep human review for the rest. Earn that trust with data, do not assume it.

Step 5: Test it like any other feature

"It looked fine in the demo" is not a test. Before the feature goes live:

  • Collect 50 to 100 real examples from the workflow, including the awkward ones.
  • Write down the right answer for each, ideally with the person who does the job today.
  • Run the AI against them and score the results. Re-run them every time you change the prompt, the model or the data.

This is an evaluation set, and it is the difference between AI that works and AI that works until it does not. We wrote a whole guide on testing AI features with evals because it matters this much.

Step 6: Log everything

Old systems rarely have good logging. Your AI layer should. For every request, record what went in, what the model returned, what the person changed, and what was finally saved. You will use this to improve the feature, to answer "why did it do that?", and to show auditors and customers that you know what your AI is doing.

Think about data protection here too. If personal data is going to a model provider, make sure you have the right agreement in place, know where the data is processed, and only send the fields the task actually needs. The thin API from step 3 makes this much easier, because it is the one place where you decide what leaves the old system.

What to avoid

A few approaches look faster at the start and cost more later:

  • Letting the model write straight into the legacy database. No validation, no business rules, no audit trail. One bad output and you are restoring from backup.
  • Screen-scraping the old interface. Automating clicks on the legacy screens can work as a stopgap, but it breaks every time a screen changes and leaves you with nothing reusable.
  • Building a separate AI app with its own copy of the data. Now you have two sources of truth and a sync problem.
  • Starting with an autonomous agent. Agents that take actions on their own are powerful, and we build them, but they belong on top of a system with clean APIs and good logging. Our guide to how to build an AI agent explains why the foundations come first.

A worked example

Here is how this plays out for a typical business. The details are illustrative, but the shape is one we see often.

A field services company of around forty people runs its jobs, customers and invoicing on a ColdFusion application built in-house fifteen years ago. Enquiries arrive by email, often with PDFs attached. Two people spend most of their day reading them and keying jobs into the system.

  • Weeks 1 to 2: Map the enquiry workflow, collect a hundred real emails, and agree what a correct job record looks like. Build a small API in front of the jobs and customers tables, with an endpoint for draft jobs.
  • Weeks 3 to 4: Build the extraction feature and a simple review screen that shows the email and the draft side by side. Run it against the hundred examples until the results are good enough to trust with review.
  • Week 5 onwards: Go live with every draft reviewed. Track time per enquiry, how often drafts need correcting, and which fields go wrong.

The old application is untouched apart from a few new database views. The team gets most of their day back. And the business now has a documented, tested API over its jobs and customers, which is the foundation for the next AI feature and the first real step toward replacing the ColdFusion screens.

A quick self-check

Before you start, run through these:

  1. Can you name one workflow, with a rough count of how many times it happens per week?
  2. Do you know where the data for that workflow actually lives?
  3. Is there a person who checks the output today and could review AI drafts?
  4. Do you have, or could you gather, 50 real examples with known correct answers?
  5. Is there any API in front of the legacy system today, or only screens and a database?
  6. Do you know what personal data the workflow touches and where it would be processed?

If you can answer the first four, you are ready to start. The last two tell you how much groundwork the first step needs.

The point

You do not have to choose between modernising and adopting AI, and you do not have to finish one before starting the other. Start with one workflow, put a small, clean API in front of the old system, keep a person in the loop and measure the results. Each AI feature you ship leaves the platform a little more modern than it was, and each step of modernisation makes the next AI feature easier.

More articles

Have a project like this?

Tell us what you are building. We will tell you honestly whether we can help, and what it would take.