Legacy Modernization
Smart Agent
What if you could ask a 20-year-old codebase anything — and actually get a trustworthy answer?

nvisia AI Lab · Prototype
Legacy Modernization Smart Agent
A custom AI agent that reads, understands, and answers questions about large legacy codebases — and generates clean specifications to guide a modern replacement.
No Client Data
Demonstrated safely at the Symposium
Live Demo
Run against nvisia's own codebase
Built by
Mark Panthofer
What This Prototype Does
Reads and understands large legacy codebases, answers natural language questions with precision, and generates structured OpenSpec specifications to guide a modern replacement — all with humans firmly in control.
The Legacy Modernization Challenge
Every organization with a large, aging codebase faces the same problem: the system has been running for 20+ years, thousands of lines of code, and the people who built it are gone. Even the best analysts only know their corner of it.
Before you can modernize, you have to understand. And understanding a system of that complexity — deeply enough to rebuild it cleanly — is one of the hardest and most expensive parts of any modernization effort.
"You're in the unenviable position of having to replace an old WebSphere portal app with React and modern Java. To do that, you have to really understand those requirements."
Mark Panthofer
20+
Years Running
Typical age of legacy systems facing modernization
1000s
Lines of Code
Undocumented, untested, and deeply intertwined
0
Original Authors
The people who built it are long gone
A Two-Layer Approach: Deterministic + AI
The Smart Agent combines the precision of deterministic code analysis with the flexibility of natural language AI — delivering accurate, targeted answers without hallucination.
Layer 1
Code Intelligence (Deterministic)
A containerized Docker scanner crawls the codebase using TreeSitter and CodeQL — two tools that parse not just what the code does, but what it means and how components relate to each other.
The result is a structured database of semantic expressions, relationships, and metadata — all linked back to actual source files.

Layer 2
The Smart Agent (AI)
A custom GitHub Copilot agent, equipped with specific "skills" for querying that database, is layered on top. Business analysts ask natural language questions. The agent narrows in on precisely the right subset of code.
No context stuffing. No hallucination-prone broad dumps. Just targeted, accurate answers.
"It understands that code base inside and out. I can ask it any question and it's going to dial in on the correct bit of code quickly."
From Understanding to Specification
Once the analysis is complete, the agent generates OpenSpec-formatted specifications — structured, versioned, human-reviewable documents that define what the new system needs to do.
Codebase Scan
Docker scanner with TreeSitter and CodeQL builds a semantic database of the entire legacy system.
Natural Language Q&A
Business analysts query the Smart Agent in plain English. The agent targets the right code precisely.
OpenSpec Generation
Structured, versioned specifications are generated and reviewed by analysts before any architecture decisions are made.
Clean New Architecture
The new system is designed independently — free of technical debt — with features added and validated one by one.

This is not automated modernization. It's AI-accelerated clarity — with humans firmly in control of every architectural decision.
Honest Findings: What Surprised Everyone
After running the Smart Agent against a real codebase with analysts who had worked the system for two decades, several things stood out.
Accuracy Exceeded Expectations
During a live session with analysts who had worked the system for 20 years, the agent surfaced features and behaviors even they weren't fully aware of.
Targeted Queries = Token Efficiency
By pre-digesting the codebase deterministically and only querying what's needed, the system stays well within practical token limits even on large models.
This Isn't a One-Time Demo
The tooling, approach, and agent skills developed here go into nvisia's analysis harness. Future client engagements can use what Mark built.
⚠️ Humans Still Own the "What"
Specs are reviewed, approved, and refined by business analysts before any code is generated. This is a tool for accelerating understanding, not replacing judgment.
Tech Stack
Every component was chosen for precision, scalability, and practical deployment in real client engagements.
Code Parsing
TreeSitter + CodeQL — semantic parsing that understands meaning and relationships, not just syntax.
Containerization
Docker — the scanner runs in a fully containerized environment for portability and repeatability.
Agent Platform
GitHub Copilot — custom agent with purpose-built skills for querying the semantic database.
Model
Claude Opus via Copilot — high-capability reasoning model powering the natural language interface.
Output Format
OpenSpec — structured, versioned, human-reviewable specifications ready for architectural planning.
Demo Codebase
nvisia ETF System — nvisia-owned codebase used for all demonstrations. No client data involved.
See It Live at the nvisia AI Symposium
Visit the Legacy Modernization booth to experience the Smart Agent in action against a real codebase.
Live Q&A
Ask the Smart Agent questions against a real codebase and watch it dial in on the right code instantly.
No Context Overload
See how the agent narrows to exactly the right code without stuffing the context window.
Sample OpenSpec Output
Review real specification documents generated directly from legacy code analysis.
Full Workflow
From codebase scan to specification to new architecture planning — the complete end-to-end story.
Mark Panthofer will be on-site to walk through the approach and answer questions.
Ready to Modernize Your Legacy Systems?
Whether you're curious about this prototype or exploring how AI can accelerate your next modernization effort, the nvisia AI Lab team wants to hear from you.
nvisia AI Lab · Building what's next, responsibly.