Navigating Legacy Code: The Role of AI-Powered Documentation
Legacy code documentation software
Hemalee & Pubudu
8/27/20263 min read


The Programs Nobody Remembers: How We Built LegacyLens
Every organisation running IBM i (AS/400) has them. Programs written 25 or 30 years ago that quietly run the business every day — and that almost nobody fully understands anymore.
The person who wrote them may have retired. The documentation, if it ever existed, is long gone. The logic lives in one or two senior developers' heads. And so every change to those programs becomes a risk: touch the wrong line, and a business process that has run flawlessly for decades can break in a way no one can quickly explain.
After more than 15 years working on IBM i systems — including 11 years in core banking, plus warehouse management and capital markets — we saw this same problem everywhere. It is one of the biggest hidden risks facing the thousands of organisations still running critical workloads on IBM i today. So at Modnex, we decided to do something about it.
Introducing LegacyLens
LegacyLens is an AI-powered platform that reads legacy IBM i source code and produces clear, structured documentation — automatically.
You upload a source program — RPG, RPGLE, SQLRPGLE, COBOL, CL, or DDS — and LegacyLens returns:
A plain-English summary of what the program actually does
The business rules it enforces, with references back to the source lines
The files and database tables it uses, and whether it reads, writes, or updates each one
Call flow and data flow diagrams, generated automatically
An AI assistant you can ask anything about the code — from "what does this program do?" to "are there any SQL risks here?"
In other words, the knowledge that used to live in one person's head becomes something the whole team can read, review, and rely on.
Built for banks and insurers: fully on-premise
For regulated organisations, there is one requirement that overrides everything else: source code cannot leave the building.
A bank's core systems are among its most sensitive assets. Sending that source code to a public cloud AI service is, for many institutions, simply not an option — for regulatory, contractual, and risk reasons alike.
This is where LegacyLens is different. The AI runs entirely on-premise, on your own hardware. Your source code never leaves your infrastructure. There are no cloud APIs, and no per-file processing costs. You document your entire estate on your own terms, inside your own walls.
Why now
The timing is not accidental. The IBM i community is facing a well-documented skills challenge: a large share of experienced RPG and COBOL developers are approaching retirement, and far fewer people are entering the platform to replace them. When those developers leave, decades of undocumented knowledge can walk out of the door with them.
Documentation is the bridge. Before you can safely modernise a system — or even confidently maintain it — you have to understand what it does today. LegacyLens is designed to capture that understanding while the expertise to verify it is still available.
Human expertise, not just AI
We are deliberate about one thing: AI accelerates the work, but it does not replace the engineer.
Every piece of documentation LegacyLens produces is designed to be reviewed and verified by people who understand IBM i. Our own background — 15+ years on the platform, including core banking — is built into how the tool structures its output and into how we deliver it. For regulated environments, we are building a formal approval workflow into the product, so that documentation is signed off by the right people before it becomes the system of record.
The goal is not "AI that replaces your developers." It is a tool that gives your developers back the context they have been missing.
What's next
LegacyLens is already a working system, documenting real IBM i programs today. The road ahead includes:
Approval workflows for regulated environments — multi-stage sign-off with a full audit trail
Direct IBM i connectivity — pulling source members straight from the system, rather than uploading files
Modernisation support — assistance with tasks such as converting fixed-format RPG to free-format, with every change reviewed and tested
Talk to us
If your organisation depends on IBM i programs that only a handful of people truly understand, we would like to help.
We are working with a small number of IBM i shops on early-access pilots. If you would like to see LegacyLens applied to your own code — starting with a single program, so you can judge the quality for yourself — get in touch.
Modnex Ltd — modernising legacy systems, on your terms.
