The Great Docs Revolution: Beyond Static Sites for Humans and AI
This conversation with Rich Iannone and Michael Chow of Posit reveals a critical, often overlooked, shift in software documentation: the dual audience of humans and artificial intelligence. While traditional documentation tools focus on human readability, the emergence of AI agents necessitates a new approach. The hidden consequence of neglecting this dual audience is the creation of documentation that is effectively opaque to the very tools increasingly used to understand and interact with software. This discussion is essential for any developer, technical writer, or project maintainer who seeks to future-proof their documentation, ensuring it remains accessible and valuable in an AI-driven landscape. By embracing a more structured, machine-readable format, they gain a significant advantage in discoverability and integration, making their projects more approachable for both new users and advanced AI systems.
The Hidden Architecture of Documentation: Why Static Sites Aren't Enough
The landscape of software documentation is undergoing a quiet revolution, driven by the increasing sophistication of AI agents and LLMs. While tools like Sphinx and MkDocs have long served the Python community by rendering Markdown into polished HTML sites, they largely cater to a single audience: human readers. Rich Iannone and Michael Chow, through their work on Great Docs, highlight a critical blind spot: the need for documentation to be equally accessible and interpretable by machines. This isn't merely about having a search bar; it's about structuring information in a way that AI can readily parse, understand, and utilize.
The conventional wisdom in documentation has been to create beautiful, navigable websites. However, as Michael Chow points out, "When you have a team of data scientists, but you don't necessarily have a DevOps team, but you still want to have their stuff running reliably, right?" This sentiment extends to documentation. The ease of deployment and maintenance offered by static sites is a significant draw, but the underlying format and structure often fall short when interacting with AI. Great Docs aims to bridge this gap by not only generating human-readable documentation but also by ensuring it's machine-digestible.
One of the core tenets of Great Docs, inspired by R's PackageDown, is its focus on immediate usability. Rich Iannone emphasizes the goal: "to give you something that was, you know, you just start it right away and it gives you something." This is particularly relevant in an era where rapid prototyping and quick iteration are paramount. Developers spinning up new projects, perhaps for AI-specific applications, need documentation tools that don't introduce significant overhead. Great Docs achieves this by automatically capturing docstrings and organizing them into an API reference, providing a functional starting point with minimal configuration.
The implications of this dual-audience approach are profound. By providing content in formats like Markdown and incorporating structured metadata, Great Docs enables AI agents to "read" and "understand" documentation more effectively. This isn't just a theoretical benefit; it has practical applications. As Michael Kennedy, the host, notes, having a "copy page as Markdown" feature allows users to directly feed documentation to an AI, bypassing the AI's potential struggles with navigating complex website structures. This capability is crucial for scenarios where an AI needs to grasp the essence of a function or module quickly.
The integration of Quarto, a powerful open-source publishing system, is central to Great Docs' capabilities. Quarto's ability to embed executable code blocks and generate rich outputs like tables and plots directly within documentation is a significant advantage. This allows for documentation that is not only descriptive but also demonstrative, showing code in action and its results. Rich Iannone highlights this: "The examples like being executable made the Great Tables examples really powerful. You can see the code for a table and then see the table right below like in the actual like site." This executable nature, processed at build time, ensures that examples are always up-to-date and accurate, a challenge often faced with static code snippets.
Furthermore, the concept of "freezing" outputs in Quarto--caching the results of code execution--addresses a practical concern for maintainers. As projects grow, re-rendering all documentation can become time-consuming. Freezing allows for faster rebuilds, a crucial aspect of sustainable documentation workflows. This attention to detail, to the "million little boxes to check" in generating documentation, is what sets Great Docs apart.
The "AI-ification" of documentation, as Michael Kennedy terms it, extends beyond just making content readable. It involves creating structured metadata, like the llms.txt file, which explicitly guides AI agents. This file acts as a signal, similar to robots.txt for search engines, but tailored for LLMs. It helps AI understand the context, purpose, and structure of the documentation, leading to more accurate and relevant interactions. The inclusion of features like a CLI documentation section and the ability to copy pages as Markdown further empowers AI agents by providing direct, machine-friendly interfaces to the project's information.
Ultimately, Great Docs represents a forward-thinking approach to documentation. It acknowledges that the audience for software information is expanding beyond humans and that the tools used to consume this information are evolving rapidly. By focusing on both human readability and machine accessibility, Great Docs is not just building a documentation generator; it's building a more intelligent and interconnected ecosystem for software knowledge.
"Your documentation has two audiences now: humans reading the rendered HTML and AI agents making sense of your library."
-- Michael Kennedy (quoting episode description)
"The scale problem is theoretical. The debugging hell is immediate."
-- Michael Chow (paraphrased sentiment on optimizing for future problems vs. current realities)
"I feel like this is much more focused. I just need a static site and much less I needed to read my doc strings and categorize my modules and API calls and put in that kind of stuff, right?"
-- Rich Iannone (contrasting general-purpose site generators with documentation-specific tools)
Key Action Items:
-
Immediate Actions (Within the next quarter):
- Evaluate Current Documentation: Assess your project's existing documentation for human readability and machine accessibility. Identify areas where AI agents might struggle to parse or understand content.
- Explore Great Docs: Install and experiment with
great_docs initandgreat_docs buildon a small project or a section of a larger one. Focus on generating an initial API reference and a basic user guide. - Incorporate Markdown Export: If your current documentation tool offers a way to export content as Markdown, implement this feature. This provides a direct pathway for AI interaction.
- Consider
llms.txt: For projects with existing documentation sites, research and consider creating anllms.txtfile to provide structured guidance to AI agents.
-
Longer-Term Investments (6-18 months):
- Adopt Great Docs for New Projects: For any new projects, prioritize using Great Docs or a similar tool that inherently supports dual-audience documentation.
- Integrate Executable Examples: If using Quarto or a similar system, invest time in making code examples directly executable and visible within the documentation. This ensures accuracy and immediate understanding.
- Structure for AI Consumption: Beyond
llms.txt, explore other methods for structuring documentation to be AI-friendly, such as consistent use of semantic Markdown, clear headings, and machine-readable metadata. - Monitor AI Interaction with Docs: As AI agents become more prevalent, track how they interact with your documentation. Use this feedback to refine your documentation strategy and tooling.
- Invest in Documentation Workflow Automation: Implement CI/CD pipelines that automatically build, test, and deploy documentation, incorporating features like Quarto's "freeze" for faster iteration.