The author of a 20-year-old insurance platform ran 108 support tickets through a custom AI-agent pipeline and the result is a workflow that turns a multi-hour, senior-developer task into a handful of minutes, a shift that could reshape how enterprises keep legacy code alive.
Why legacy systems matter more than new code
The insurance application in question is a monolith of 2.3 million lines of code and roughly 1,000 PL/SQL packages. Its size alone makes it impossible for any single person to own the whole codebase. Add to that a maze of customer-specific configuration parameters, scattered documentation, and a ticket archive that stretches back to 2017, and the real bottleneck becomes “finding context,” not writing code.
Typical modern AI hype focuses on generating fresh code for greenfield projects. In this case the hard part is not the syntax of PL/SQL but locating the exact piece of logic, the relevant configuration, and the historical ticket that first described the problem. An experienced developer can spend hours stitching together clues from GitLab, SVN, wikis, and old support tickets. The AI agent does the same work in minutes.
The workflow in practice
When a new ticket lands, the author runs a single command. The agent then:
- Pulls the ticket text and any attached files through the ticket-system API.
- Executes a keyword and vector search across the entire ticket archive to surface similar past cases.
- Queries a personal library of reusable SQL scripts.
- Inspects code history in the version-control systems (GitLab or SVN).
All findings are compiled into one file that also suggests the next step—usually a code fix, a draft reply to the customer, or a request for additional diagnostics.
Built-in capabilities
The author has defined 24 “skills” for the agent, grouped into four categories:
- Context access – reading APIs, manuals, and databases to pull relevant facts.
- Domain knowledge – interpreting insurance accounting rules and the system’s architecture.
- Writing – generating PL/SQL snippets and packaging them for deployment.
- Meta – recognizing patterns and automatically creating new skills when needed.
These skills let the agent act as a junior engineer that never sleeps, surfacing the exact line of code or configuration that a ticket references.
Safety nets built into the loop
Automation in a production environment demands safeguards. The author follows two simple rules:
- Static validation – every generated script is run through an
EXPLAIN PLANagainst the live schema. This checks for syntax or logical errors without actually executing the code. - Dual-model confirmation – a second, independent AI agent reviews any change deemed risky. If both models arrive at the same conclusion, the author proceeds; otherwise, the ticket is escalated for manual review.
These checks keep the process from becoming a black box that could inadvertently break a critical insurance transaction.
Compounding benefits
Each ticket’s output is attached back to the ticket record, creating a living knowledge base. When a similar issue resurfaces months or years later, the agent can read not only the previous solution but also the reasoning that led to it. In effect, every resolved ticket becomes training data for future tickets, accelerating the cycle further.
Honest limitations
- Manual testing remains – the author still validates changes in a test environment before promotion.
- No hard-stop metrics – while the time saved feels substantial, the author has not quantified the exact reduction in hours.
- Personal setup – the current implementation lives on a single workstation; scaling it across a team would require additional engineering.
These constraints keep the approach from being a turnkey product, but they do not diminish the core insight: AI can collapse context gathering from hours to minutes.
What to watch next
The author’s experiment is a proof-of-concept rather than a commercial offering. The next logical steps include:
- Memformalkan metrik – menjejaki masa penyelesaian tiket sebelum dan selepas saluran paip AI untuk membina kes perniagaan.
- Pelaksanaan pasukan – membungkus ejen sebagai perkhidmatan kongsi supaya ramai jurutera dapat memanfaatkan pangkalan pengetahuan yang sama.
- Integrasi dengan CI/CD – memasukkan skrip yang telah disahkan secara terus ke dalam saluran paip integrasi berterusan boleh melengkapkan kitaran daripada tiket ke pengeluaran tanpa penyerahan manual.
Jika peluasan ini berjaya, model ini boleh menjadi templat untuk perusahaan lain yang bergelut dengan pangkalan kod yang besar dan sudah lama wujud.
Rumusan
Nilai sebenar AI dalam persekitaran legasi bukan pada penulisan kod baharu secara automatik, tetapi pada memaparkan konteks yang betul secara serta-merta. Dengan menukarkan kerja penyiasatan berjam-jam oleh pembangun kanan kepada beberapa minit sahaja, aliran kerja ejen AI dapat memastikan sistem lama kekal berfungsi, mengurangkan kos sokongan, dan membina repositori pengetahuan yang memperkukuh diri secara beransur-ansur. Eksperimen ini menunjukkan bahawa, bagi perisian legasi, peningkatan produktiviti terbesar datang daripada memendekkan pencarian jawapan, bukan daripada menjana kod baharu.
