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:
- Formalizacja metryk – śledzenie czasu rozwiązywania zgłoszeń przed i po wdrożeniu potoku AI w celu przygotowania uzasadnienia biznesowego.
- Wdrożenie zespołowe – pakowanie agenta jako usługi współdzielonej, aby wielu inżynierów mogło korzystać z tej samej bazy wiedzy.
- Integracja z CI/CD – przekazywanie zweryfikowanych skryptów bezpośrednio do potoku integracji ciągłej mogłoby domknąć cykl od zgłoszenia do produkcji bez konieczności ręcznego przekazywania zadań.
Jeśli te rozszerzenia zakończą się sukcesem, model ten może stać się wzorcem dla innych przedsiębiorstw zmagających się z ogromnymi, zakorzenionymi bazami kodu.
Wnioski
Prawdziwa wartość AI w środowiskach legacy nie polega na automatycznym pisaniu nowego kodu, lecz na natychmiastowym dostarczaniu odpowiedniego kontekstu. Przekształcając wielogodzinną pracę detektywistyczną starszego programisty w zaledwie kilka minut, przepływ pracy oparty na agencie AI może utrzymać funkcjonalność starzejących się systemów, obniżyć koszty wsparcia i stopniowo budować samowzmacniające się repozytorium wiedzy. Eksperyment pokazuje, że w przypadku oprogramowania legacy największy wzrost produktywności wynika ze skrócenia czasu poszukiwania odpowiedzi, a nie z generowania nowego kodu.
