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

AI Insideはエンジニア2名とDevinだけで、いかにして製品開発期間を従来の6カ月から3ヶ月へと短縮できたか

Vimeo
~2x
最重要新製品の開発スピード向上
80-90%
エンジニアリング作業のDevin利用率(導入当初は50%)
<30分
60以上のリポジトリにわたるDockerバージョン移行の所要時間
3.5x
1人あたりのPRマージ件数が前年比で向上

会社概要

AI Insideは、日本のAI-OCR分野において5年連続でトップシェアを維持する企業です。政府機関や大企業を含む3,000以上の組織が、同社の製品「DX Suite」を活用し、紙文書のデジタルデータ化を実現しています。

業界: AI / SaaS 本社所在地: 東京都 サイトを見る

AI Insideは、日本で最も広く利用されているAI-OCRソフトウェアを開発しています。政府機関や大企業を含む3,000以上の組織が、同社の製品「DX Suite」を活用し、請求書や医療関連報告書などの紙文書をデジタルデータに変換しています。

2025年、AI Insideは、企業が自社の内部データをAIエージェントに変換できるプラットフォーム「Leapnet」の開発に着手しました。エンジニアの大西啓貴が入社して2日目、CTOの井上拓真から与えられた使命は「この組織の開発能力を数十倍に引き上げてください」でした。

「Leapnet」プロジェクトは、13人のチームから2人のエンジニアが配属され、「3人目のチームメンバー」としてDevinが起用されました。このプロジェクトは、当初予定されていた開発期間の6ヶ月以上から、わずか3ヶ月でリリースされました。AI InsideのVPoE (Vice President of Engineering) 三谷辰秋は、後に次のように述べています。

Devinがなければ、エンジニアが10人ほど必要だっただろう。

— 三谷辰秋氏、VPoE

なぜ他のツールではなくDevinが選ばれるのか

チームは、Devinを採用する前に、いくつかのIDEベースのコーディングアシスタントと自律型エージェントを評価しました。評価の中の最優先基準は2つあり、一つはツールが「作業単位(unit-of-work)」レベルで自律的に実行できるかどうか、もう一つはエンタープライズ規模の巨大なコードベース上で安定して動作できるかどうかでした。

コーディングアシスタントは有用でしたが、全プロセス(調査、修正、プルリクエストの作成)を任せることができませんでした。一方で、自律型エージェントはまずまずでしたが、なかには新規開発のアプリで機能しても、大規模な既存システムで機能しないものや、運用面で管理が難しいものもありました。

Devinは、DX Suiteのような60以上のリポジトリからなるシステムを確実に探索・修正できる唯一のツールでした。それはまるで画面の向こうにエンジニアがいるかのようでした。誰もがチームメイトのようにAIと協働でき、私たちの「Work with Buddy」というコンセプトに合致していました。

— 大西啓貴氏、エンジニア

「Leapnet」の構築

AI Insideにとって「Leapnet」のリリースは必然でしたが、DX Suiteからエンジニアリングチーム全員を割く余裕はなく、同社は、このプロジェクトにエンジニア2名を配置しました。つまり、2名で対応できるだけの仕事と、実際にプロジェクトに必要な仕事とのギャップをDevinが埋めてくれることに賭けたのです。

エンジニアたちは、作業のあらゆる過程でDevinを活用しました:

  • まず、Devinにリポジトリをスキャンさせ、データフローをマッピングして既存システムを把握させました
  • 続いて、設計に移る前に、対話を通じて機能の実現可能性をテストしました
  • 設計者はFigmaでUIのモックアップを作成し、エンジニアはFigmaの出力をDevinに入力してフロントエンドコードを生成しました
  • バックエンドとインフラ作業を並行して進めるため、Devinセッションを同時に実行しました

ローカル環境では正常に動作していたコードがステージング環境で失敗した際、DevinはAWSやGCPから直接ログを取得し、エラーを追跡して問題を修正しました。これにより、従来2時間かかっていたデバッグ作業が約30分に短縮されました。またDevinの出力が期待通りでなかった場合、エンジニアたちはそのセッションを破棄し、一からやり直しました。これはDevinは独自のインスタンス上で動作するため、反復コストはゼロのため、成し得たことです。

このプロジェクトは、当初6ヶ月を超えると見込まれていましたが、実際は約3ヶ月で設計段階から最初のリリースへと至りました。チームは、3倍以上の作業スピードアップを報告し、一度に3~4つのDevinセッションを並行して実行できたことがその一因であると考えています。また、1人あたりのプルリクエストのマージ件数は、前年の約3.5倍に増加しました。

「Leapnet」そしてその先へ

Devinの影響は、フラグシップ製品構築にとどまらず、保守・運用にまで及びました。

DX Suiteは60を超えるリポジトリを網羅しています。 あるDockerベースイメージのバージョンがサポート終了となった際、ひとりのエンジニアがDevinにアップデート情報とともに、指示プロンプトを1つ与えました。Devinは60以上のリポジトリすべてを検索し、影響を受ける8~9つのリポジトリを特定して各バージョン番号をアップデートし、プルリクエストを作成しました。以前はエンジニア2人で5日間かかっていた一連の作業がDevinに要した時間は30分足らずでした。

サポート対応において、 チームはDevinをNew Relicに連携させ、初期段階の根本原因調査を実施しました。以前は手作業によるログ照合やリポジトリ横断検索に半日を要した作業が、今では1時間ほどで完了し、そのうち人間による作業は15分程度で済みます。

これは単なる自動化にとどまらず、新たな才能を生み出したのです。

— 大西啓貴氏、エンジニア

エンジニア以外の社員も用途を見出しました。 会計チーム所属のある社員は、経営学部卒で、コーディング経験はほとんどないにもかかわらず、Devinを使って、ExcelファイルやPDFからデータを抽出し、API経由で支払依頼書を作成するワークフロー自動化ツールを構築しました。これまで2~3日かかっていた毎月の経理業務が、約半日に短縮される見込みです。

エンジニアでなくとも、Devinを使えば技術的な問題を解決できる。

— 大西啓貴氏、エンジニア

普及率 50%から90%へ

2025年初頭にチームがDevinの利用を開始した当初、その利用率はGitHub Copilotとほぼ半々でしたが、秋までに80~90%がDevinへシフトしていました。精度が向上したことで、チームは他種モデルと照合して回答を再確認せずに済むほどになりました。

「Knowledge」「Playbooks」「Secrets」といった機能により、Devinは環境設定手順、認証情報、クラウドインフラストラクチャに確実にアクセスできるようになり、その適用範囲はユニットテストやフォーマット調整にとどまらず、包括的な調査、UI検証、ステージング環境でのデバッグにまで拡大しました。

メンバーは小さな成功を積み重ねることで、徐々に確信を持てるようになったのだと思います。

— 大西啓貴氏、エンジニア

今後の期待

AI Insideは現在、要件定義やシステム設計といった初期段階からDevinを活用することを前提に、開発プロセスの再設計を進めています。

AI Insideが特に注目しているのが、いわゆる「競争型開発」です。これは、Devinに競合する2つの実装機能を構築させて、比較するというもので、以前はコストがかかりすぎて現実的ではありませんでした。

Devinはまさに「可能性の塊」だと確信している。ほとんどのAIツールはコーディングに重点を置いています。しかしDevinは、開発プロセスを全面的に変えることができます。エンジニアだけでなく、会社全体での製品開発への参加が実現するかもしれません。

— 大西啓貴氏、エンジニア

Devinとの作業を始める準備はできましたか?

今すぐDevinとの作業を始めましょうお問い合わせいただき、AI Insideのようにエンジニア少数でも大規模な製品開発を実現する方法をご相談ください。