One of the most persistent challenges in software development is having to deal with legacy code. As projects evolve, the underlying knowledge of the codebase inevitably decays. And this leads to significant challenges in understanding, maintaining, and modernizing legacy code

That’s why we developed Auto-docs, a cutting-edge solution that uses AI to automatically generate documentation for legacy codebases, no matter the programming language. For an in-depth look at Auto-docs, you can watch our on-demand webinar here.

The challenge of legacy code

Legacy code is the backbone of many successful businesses, but it comes with its own unique set of challenges. As projects evolve, more developers are added (and leave), and the codebase expands. This leads to a fragmentation of knowledge. 

The mental models that developers build around the codebase decay over time — especially as developers leave or move to other projects. This inevitably leads to significant portions of the codebases becoming black boxes, where no one fully understands how they work. This lack of understanding poses a real business risk as fixing bugs, adding new features, or modernizing the system become increasingly difficult, maybe even impossible. 

Developers have always understood the importance of documentation, but with advancements in AI and LLMs, the task of creating documentation isn’t the burden it used to be. In fact, a recent Google survey found that creating documentation is the third most important task for AI, after writing code and tests. 

This bar chart, titled ‘Responses to Question About Desire for AI Help,’ illustrates the percentage of developers who seek AI assistance across various tasks. The data, sourced from ‘Toward Effective AI Support for Developers: A Survey of Desires and Concerns’ by Mansi Khemka and Brian Houck, shows the highest demand for AI in ‘generating tests’ (44%), ‘analyzing code’ (42%), and ‘writing documentation’ (37%). Lower demand is seen for tasks like ‘managing calendar’ (3%) and ‘clarifying requirements’ (5%). This chart underscores the strong interest in AI for technical development tasks. Published on ACM.

LLMs and their limitations for documentation 

We’ve been working on fixing documentation from the get go. And while LLMs and Gen AI have unlocked significant new functionality, LLMs alone cannot document a complex codebase, and that’s simply because they weren’t designed to. 

  • LLMs are non-deterministic, producing different results with each run
  • LLMs hallucinate and generate false information often. Once they’re on the wrong path, they will continue convincingly to describe something that doesn’t exist. 
  • Even with unlimited context windows, LLMs are not trained to evaluate complex flows, structures, classes, and more. 

Taking a deterministic approach: No hallucinations, always accurate

In order to address the limitations of LLMs, we took a deterministic approach. This approach involves deep code analysis that accurately parses, ranks, and understands the code, ensuring that every documented flow and component is grounded in the logic of the codebase. 

This method eliminates hallucinations, meaning that no part of any document will ever be fabricated or guessed. The documentation is also customizable, allowing organizations to tailor the outputs to their specific needs. 

Swimm’s Auto-docs is language-agnostic with custom plugins to parse legacy languages including COBOL, FORTAN, and others. 

Documentation built for enterprise 

We built Auto-docs with extensive input from our enterprise design partners – it’s secure, scalable, and serves multiple use-cases across various organizations. Use cases cover everything from developers who require deeper insight into the code, to product managers who need high-level overviews. Additionally, documentation is generated locally, without any of your code being sent to external servers. Swimm documentation can also be integrated seamlessly with tools like GitHub Copilot to further enhance their outputs. 

In addition to documentation that contains live code examples from your repositories and explanations that describe that code, Swimm also generates Mermaid diagrams whenever it’s relevant to help visualize flows. 

Examples of Auto-docs


Overview documentation
gives developers a high-level summary so that they can get a broad understanding of a system, project or codebase. 

Class documentation provides detailed information about a specific class. It typically includes properties, functions, descriptions and more. 

Flow documentation refers to the detailed description and mapping of the processes, logic, or sequences within your system or codebase. 

Built directly into the Swimm platform

Let’s not forget: documentation is only helpful when developers are able to make use of it. All of the Swimm features that you know (and love) are built directly into Auto-docs:

  • Available in the IDE
  • Linked directly to code
  • Automatically kept up to date with code changes
  • AI chat contextualized to your org
  • Integrates with your existing wikis, IDPs, and Jira

Get started with Auto-docs

Auto-docs is available as part of our enterprise plans. If you’re already a client, get in touch with us, or if you would like to see Auto-docs on one of your repositories, book a demo here

Curious to learn more about the technology behind Auto-docs? Check out our launch webinar.