How Nubank refactors millions of lines of code to improve engineering efficiency with Devin

8x
engineering time efficiency gain
20x
cost savings
Vimeo

Overview

One of Nubank’s most critical, company-wide projects for 2023-2024 was a migration of their core ETL — an 8 year old, multi-million lines of code monolith — to sub-modules. To handle such a large refactor, their only option was a multi-year effort that distributed repetitive refactoring work across over one thousand of their engineers. With Devin, however, this changed: engineers were able to delegate Devin to handle their migrations and achieve a 12x efficiency improvement in terms of engineering hours saved, and over 20x cost savings. Among others, Data, Collections, and Risk business units verified and completed their migrations in weeks instead of months or years.

The Problem

Nubank was born into the tradition of centralized ETL FinServ architectures. To date, the monolith architecture had worked well for Nubank — it enabled the developer autonomy and flexibility that carried them through their hypergrowth phases. After 8 years, however, Nubank’s sheer volume of customer growth, as well as geographic and product expansion beyond their original credit card business, led to an entangled, behemoth ETL with countless cross-dependencies and no clear path to continuing to scale.

For Nubankers, business critical data transformations started taking increasingly long to run, with chains of dependencies as deep as 70 and insufficient formal agreements on who was responsible for maintaining what. As the company continued to grow, it became clear that the ETL would be a primary bottleneck to scale.

Nubank concluded that there was an urgent need to split up their monolithic ETL repository, amassing over 6 million lines of code, into smaller, more flexible sub-modules.

Nubank’s code migration was filled with the monotonous, repetitive work that engineers dread. Moving each data class implementation from one architecture to another while tracing imports correctly, performing multiple delicate refactoring steps, and accounting for any number of edge cases was highly tedious, even to do just once or twice. At Nubank’s scale, however, the total migration scope involved more than 1,000 engineers moving ~100,000 data class implementations over an expected timeline of 18 months.

In a world where engineering resources are scarce, such large-scale migrations and modernizations become massively expensive, time-consuming projects that distract from any engineering team’s core mission: building better products for customers. Unfortunately, this is the reality for many of the world’s largest organizations.

The Decision: an army of Devins to tackle subtasks in parallel

At project outset in 2023, Nubank had no choice but to rely on their engineers to perform code changes manually. Migrating one data class was a highly discretionary task, with multiple variations, edge cases, and ad hoc decision-making — far too complex to be scriptable, but high-volume enough to be a significant manual effort.

Within weeks of Devin’s launch, Nubank identified a clear opportunity to accelerate their refactor at a fraction of the engineering hours. Migration or large refactoring tasks are often fantastic projects for Devin: after investing a small, fixed cost to teach Devin how to approach sub-tasks, Devin can go and complete the migration autonomously. A human is kept in the loop just to manage the project and approve Devin’s changes.

The Solution: Custom ETL Migration Devin

A task of this magnitude, with the vast number of variations that it had, was a ripe opportunity for fine-tuning. The Nubank team helped to collect examples of previous migrations their engineers had done manually, some of which were fed to Devin for fine-tuning. The rest were used to create a benchmark evaluation set. Against this evaluation set, we observed a doubling of Devin’s task completion scores after fine-tuning, as well as a 4x improvement in task speed. Roughly 40 minutes per sub-task dropped to 10, which made the whole migration start to look much cheaper and less time-consuming, allowing the company to devote more energy to new business and new value creation instead.

Devin contributed to its own speed improvements by building itself classical tools and scripts it would later use on the most common, mechanical components of the migration. For instance, detecting the country extension of a data class (either ‘br’, ‘co’, or ‘mx’) based on its file path was a few-step process for each sub-task. Devin’s script automatically turned this into a single step executable — improvements from which added up immensely across all tens of thousands of sub-tasks.

There is also a compounding advantage on Devin’s learning. In the first weeks, it was common to see outstanding errors to fix, or small things Devin wasn’t sure how to solve. But as Devin saw more examples and gained familiarity with the task, it started to avoid rabbit holes more often and find faster solutions to previously-seen errors and edge cases. Much like a human engineer, we observed obvious speed and reliability improvements with every day Devin worked on the migration.

Results: Delivering an 8-12x faster migration, lifting a burden from every engineer, and slashing migration costs by 20x.

“Devin provided an easy way to reduce the number of engineering hours for the migration, in a way that was more stable and less prone to human error. Rather than engineers having to work across several files and complete an entire migration task 100%, they could just review Devin’s changes, make minor adjustments, then merge their PR”

Jose Carlos Castro, Senior Product Manager

8-12x efficiency gains This is calculated by comparing the typical engineering hours required to complete a data class migration task against the total engineering hours spent prompting and reviewing Devin’s work on the same task.
Over 20x cost savings on scope of the migration delegated to Devin This is calculated by comparing the cost of running Devin versus the hourly cost of an engineer completing that task. The significant savings are heavily driven by speed of task execution and cost effectiveness of Devin relative to human engineering time – it does not even consider the value captured by completing the entire project months ahead of schedule!
Fewer dreaded migration tasks for Nubank engineers

How Itaú Deployed AI Across the SDLC at Global-Finance Scale

Vimeo
6x
faster .NET -> Java migration of 59 services
5x
faster SQL server migration of 800 database objects
70%
of security vulnerabilities automatically remediated
300,000+
repos documented
2x'ed
test coverage, from ~50% to ~90+%

About the company

Itaú Unibanco is Latin America's largest bank with estimated US$ 500B in assets, over 70 million customers, operations across 18 countries, and one of the largest engineering organizations in Latin America, with over 17,000 people working in tech.

Industry: Financial services Visit site

Overview

Itaú’s rollout of Devin represents one of the largest coordinated AI adoptions within a financial institution globally, touching the entire software development lifecycle.

“In today’s landscape of rapid technological evolution and fierce competition, speed is the ultimate competitive advantage. AI is the critical enabler that allows us to dramatically accelerate our ability to respond to customer needs and deliver innovative solutions faster than ever before, securing a decisive market position for our customers and shareholders. And for that, Devin is an important strategic investment.”

Carlos Eduardo Mazzei, CTO at Itaú

Since the partnership began in December 2024, Itaú achieved outstanding results:

Key results & use cases

Software Development Lifecycle Stage Examples
Understanding code and planning a change 300,000+ repos documented and continuously updated, helping accelerate onboarding and context gathering.

Principal engineers design architecture ~10x faster.
Writing code SQL server migrations completed 5x faster; .NET → Java migrated 6x faster at 5x lower cost.

~70% of vulnerabilities from SonarQube/Fortify/Veracode resolved automatically.
Reviewing code Devin conducts first-pass reviews before a human engineer.
Testing & QA 2x’ed test coverage from 50% to ~90+% with Devin writing tests.

How Itaú evaluated Devin

Itaú initially attempted traditional A/B testing - comparing teams using Devin against those without. But this approach assumed Devin was a tool you apply to discrete tasks. In practice, teams interacted with Devin much more organically: once they understood its capabilities, they continuously discovered new ways it could support their work.

“As people get familiar with Devin, they naturally expand how they collaborate with it”

Roberto Frossard, Head of Itaú’s Institute of Science and Technology

So Itaú shifted to measuring what happens when teams fully commit. One squad adopted Devin broadly across their workflow and delivered two releases in three months - double what had originally been planned. Engineers were able to tackle long-standing items in the backlog, move faster on complex tasks, and spend more time on higher-impact work that usually gets postponed.

“For us, the value is in helping our engineers learn faster, explore more paths, and unlock work that normally takes much longer”

Roberto Frossard, Head of Itaú’s Institute of Science and Technology

Within five months, demand grew so rapidly that a waitlist of nearly 1,000 developers formed. Nine months later, Itaú and Cognition partnered to expand Devin to everyone working with technology at the bank. Today, 75% of teams use Devin. Even the bank’s CTO, Cadu, uses Devin daily.

This transformation was enabled by close partnership with Cognition.

“Working with the Cognition team has been exceptional. Cognition has been able to address super-complex problems at outstanding speed and product quality, backed by a team that is technically outstanding. We are excited to build this future together and to explore new ways to collaborate and learn along the way.”

Carlos Eduardo Mazzei, CTO at Itaú

“The Cognition team is always responsive and ready to dig into technical challenges. Customer-centricity is a core value at Itaú, and Cognition has shown the same commitment by partnering with us to explore new ways of working, enhance developer experience and help us deliver the best products to our customers.”

Gabriel Pegorelli, Head of Developer Experience of Itaú

Deep Dive

Itaú uses Devin in two ways:

  • As an institutional knowledge layer: Devin maintains continuously updated documentation for Itaú’s repo codebase. Engineers can query Devin as if consulting a deeply tenured senior engineer. This dramatically improves onboarding, understanding of legacy systems, and productivity. This persistent knowledge layer creates long-term organizational memory, reducing bottlenecks and enabling engineers to ship new capabilities faster - a core element of Itaú’s strategy for sustainable value creation.

“Developers at Itaú have been excited by how far Devin can go. We’ve seen it handle problems we initially thought were too complex, especially for teams working across massive codebases where most other products struggle to absorb that amount of context.”

Stéfano Georgetti, Product Manager for Emerging Technologies at Itaú

  • As a specialized platform to support engineers: Devin executes coding tasks in parallel, accelerating work that would otherwise take significant manual effort. It supports migrations and modernization, remediates security vulnerabilities, reviews code, writes tests, and helps clear ticket backlogs. The goal is to leverage human engineers. By offloading repetitive execution work to Devin, engineers can focus on architecture, design, and business-critical problem solving - accelerating delivery while elevating the role of human engineers.

Across the bank, Itaú saw a 20-30% increase in throughput and 10-15% reduction in cycle time, with outsized impact in the use cases below.

Migrations & modernizations

Challenge: Large-scale migrations are high-effort, repetitive, and block teams from delivering features. Itaú faced major efforts that would have consumed months of engineering time.

Solution:

  1. CNPJ Compliance: New regulations required adding alphanumeric support to tax IDs across hundreds of thousands of files in 300,000+ repositories, including COBOL and other legacy stacks. Previously considered infeasible to automate, Devin supported end-to-end migrations across all repos in coordination with a centralized team. One team’s SQL Server migration - covering 800 database objects across stored procedures - was completed 5x faster.

  2. .NET → Java: Itaú needed to migrate 59 legacy .NET backend-for-frontend services to Java. Devin analyzed the .NET services, generated Java equivalents aligned to Itaú’s architecture standards, and consolidated them into just 9 services. By using Devin, the project was completed in 6x less time, weeks instead of months, at 5x lower cost and with a more efficient roadmap and simpler long-term architecture.

Remediating security vulnerabilities automatically

Challenge: Static analysis tools like SonarQube, Fortify, and Veracode flagged a high volume of findings. Managing these alerts manually created operational friction: security teams had to coordinate remediations across many squads, and engineers spent time resolving low-complexity issues that added up across the codebase.

Solution: Devin was integrated into CI/CD pipelines. When SonarQube or Fortify or Veracode flags an issue, Devin automatically analyzes and fixes it, leaving engineers to review the patch. Now, ~70% of vulnerabilities are resolved automatically, clearing historical backlogs and reducing security risk.

Documenting large codebases

Challenge: With 300,000+ repos, Itaú has one of Latin America’s largest software ecosystems - thousands of services across legacy systems, modern microservices, regulatory data flows, and critical financial workloads. In environments of this scale, keeping documentation comprehensive, up to date, and easily discoverable is a continual challenge.

Solution: Itaú is deploying Devin’s Wiki and Devin Search as part of its knowledge layer across the bank. Devin Wiki generates continuously-updated documentation, documenting API contracts, service boundaries, data models, workflows, and architecture - fully synchronized with code changes and with native Portuguese support. Devin Search enables engineers to ask questions and receive explanations, diagrams, dependency graphs, and history. Now ramping onto new projects is faster, modernization is smoother, troubleshooting is easier, and the bank is less dependent on institutional memory.

Designing new systems

Challenge: Designing new integrations or modifying existing services required deep familiarity with legacy codebases, architecture decisions, and data flow constraints. Architectural planning often began with weeks of reverse-engineering, dependency tracing, and meetings to gather context from senior engineers.

Solution: Engineers use Devin Wiki and Devin Search to navigate architecture and code. Devin generates architecture diagrams, traces data flows, highlights integration and security considerations, and refines system boundaries. What previously took hours of meetings and context gathering now can takes minutes - around 10x faster in some of the most expressive cases.

“In 10–15 minutes, I have a complete architecture proposal I can walk into a meeting with. Others react to it instead of starting from zero.”

Abner das Dores, Solutions Architect Lead

This compression of architectural planning exemplifies the bank’s belief that speed is the ultimate competitive advantage - and that AI is essential to achieving it.

Code reviews

Challenge: Code reviews ensure functionality, security, and performance, but consume significant engineering time and reduce the speed of delivery.

Solution: Every PR will soon have a Devin-generated first-pass review paired with a generated wiki entry. Using service tokens and GitHub Actions, Devin operates as a native agent within existing pipelines.

Incident triage

Challenge: With thousands of services built over different technology generations, incident signals were not always straightforward to interpret. Engineers often spent significant time navigating legacy code paths and correlating logs to identify root causes, which made triage slower and less predictable in complex scenarios.

Solution: In one incident, after engineers hit dead ends, Devin analyzed the legacy codebase, proposed five likely failure points, and guided the fix. Bank-wide, Devin-assisted diagnosis is helping engineering teams resolve issues more confidently and with less rework, consistently saving meaningful hours of investigation every month and improving overall incident recovery times.

Building a frontend

Challenge: A Treasury backend squad needed a UI for an internal pricing calculator but lacked frontend engineers immediately available to develop the project.

Solution: Given a written spec, Devin built the UI, integrated existing APIs, added validation and tests, completed reviews, and shipped the feature within one day. The team now maintains the interface without dedicated frontend staffing.

Testing

Challenge: Test-writing is critical, but in fast-moving delivery environments it can be challenging to prioritize alongside more time-sensitive engineering tasks.

Solution: Devin writes tests from a human-provided playbook, and engineers review them for correctness. Test coverage increased from <50% to ~90+%.

What’s next: elevating engineers’ roles

As Devin becomes deeply embedded across Itaú’s engineering organization, the bank is rethinking the nature of engineering work. Engineers are spending more time on architecture, problem framing, and business context, while AI handles routine and repetitive tasks and helps engineers plan complex new projects. This shift reflects Itaú’s broader AI strategy: increasing engineering leverage so teams can deliver meaningful change faster.

“You have to think of it as a companion, not just a tool.”

Roberto Frossard, Head of Itaú’s Institute of Science and Technology (ICTi)