Shing Lyu

ADR as Event Sourcing: Rethinking Software Architecture Documentation in the Age of AI

By Shing Lyu    

Disclaimer: This content reflects my personal opinions, not those of any organizations I am or have been affiliated with. Code samples are provided for illustration purposes only, use with caution and test thoroughly before deployment.

Does any organization actually have good, up-to-date software architecture documentation? I’ve worked with enough teams to know the answer is almost always “no.” Most architecture docs become outdated the moment they’re written. Engineers don’t have time to maintain documentation while shipping features. Traditional Architecture Decision Records (ADRs) are often written after decisions are made, not during the decision-making process. And when you’re busy, you simply forget to document parts of your architecture, leaving it spotty and unreliable. With Generative AI, I think we should treat ADRs more like event sourcing—capturing decisions as they happen, not reconstructing them from memory weeks later.

The Fundamental Problem with Architecture Documentation

Documentation is treated as a separate activity from decision-making, and that’s where everything breaks down. Writing ADRs requires dedicated time that teams rarely have. By the time an ADR is written, the context and nuances are often lost. People forget the alternatives that were considered, why certain options were rejected, and what constraints influenced the final decision.

The result? Documentation lags behind reality, making it unreliable. Teams stop trusting their own docs. New engineers joining the team have no reliable source of truth about why things are the way they are. Architecture debt accumulates invisibly because there’s no record of what the intended design was supposed to be.

The Core Idea: Treat ADRs Like Event Sourcing

What if we treated ADRs more like event sourcing? In event sourcing, we capture events as they happen, not after the fact in big batches during dedicated document-writing timeslots. Architecture decisions happen in real-time during meetings, Slack or Zoom conversations, and design discussions. Instead of writing comprehensive docs later, we should capture the decision stream as it flows.

This includes both the event stream layer (individual ADRs capturing each decision) and a snapshot layer (the current state of the architecture)—I’ll explain this two-layer approach in detail shortly.

How Generative AI Enables This Shift

AI fundamentally changes what’s possible:

This solves the “not enough time to write” problem—AI does the writing. Humans make the decisions and provide oversight, but the administrative burden of documentation disappears.

The Two-Layer Approach

The event sourcing model has two layers, and we should adopt the same structure for architecture documentation:

Event stream layer: Individual ADRs capturing decisions as they happen (the events). Each meeting, design discussion, and significant conversation generates an ADR. These are immutable records of what was decided, when, and why.

Snapshot layer: Current state of architecture, updated based on ADRs (the projection). This is the “big picture” document that answers “what does our architecture look like right now?” It should be automatically updated by AI based on accumulated ADRs.

If we’re unsure about the current architecture status, we can infer it from all ADRs combined—like event sourcing replay, where you reconstruct current state from event history. With AI, this reconstruction work (which was previously hard manual work) can now be done much more efficiently.

Implementation: Making It Work in Practice

Project Kickoff: Establish Guiding Principles First

Before any AI-generated ADRs, you need a foundation. At project kickoff, you must document high-level ideas, business values, and guiding principles. This can be done with AI assistance based on meeting transcripts, but it’s a critical step.

Why is this so important? Without these guiding principles, AI writing ADRs may assume something completely wrong. If the AI doesn’t know that your team values “simplicity over features” or “prefer boring technology,” it might generate ADRs that completely miss the point. These guiding principles ensure all subsequent ADRs align with your project vision.

Capturing the Decision Stream

Once you have your foundation, you can start capturing decisions:

How to Write Good ADRs with AI

When generating ADRs with AI, follow these best practices:

Future Directions

Formal Method Verification with AI (During Design Phase)

TLA+ (Temporal Logic of Actions) is a formal specification language created by Leslie Lamport, the inventor of Paxos and LaTeX. It’s used to design, model, and verify concurrent and distributed systems. Unlike unit tests that check whether your code works, TLA+ can catch design flaws before any code is written—issues like deadlocks, race conditions, and invariant violations.

The problem is that TLA+ has a steep learning curve. Most teams don’t have the expertise. But with AI:

Imagine describing your distributed system’s design in plain English, and AI produces a TLA+ spec that proves whether your design can deadlock. That’s the future we’re heading toward.

AI-Powered Architecture Review (When Architecture Is Being Submitted)

Before an ADR gets merged, AI can review it:

Automated Architecture Compliance Checks (During Implementation)

Once code is being written, AI ensures implementation matches design:

Cross-Organizational Architecture Intelligence (Throughout All Phases)

AI with access to internal documentation across the organization can:

I’ve noticed that AI with access to internal documentation can really quickly help me find other designs that share the same characteristics. This saves enormous amounts of time and prevents teams from reinventing wheels.

Digital Twin for Architects

Historically, there are few architects in an organization and they are spread thin. People often have questions about how and why an architecture was designed a certain way. Product managers have questions about how much effort or change it takes to adapt old technology to new features.

By building a RAG (Retrieval-Augmented Generation) system based on all the architecture documents, you can build a chatbot that multiplies the architecture team’s capacity. This digital twin can answer routine questions, explain design decisions, and provide guidance—freeing up actual architects to focus on strategic work.

Benefits and Implications

Reduced Documentation Burden

Architects focus on making decisions; AI handles the documentation. Real-time capture means no loss of context. Documentation stays synchronized with reality because there’s no manual step that can be skipped.

Better Decision Quality

When AI can surface similar past decisions for context, decision quality improves. You’re not making choices in a vacuum—you can see what worked and what didn’t for similar problems. Cross-organizational patterns become visible, and consistency across teams improves naturally.

Faster Onboarding and Knowledge Transfer

New team members can replay ADR history to understand architectural evolution. They see not just the current state, but how it got that way. Context and reasoning are preserved, not just the final decisions.

This is especially valuable for decisions that seem arbitrary or like workarounds—there might be historical reasons why it’s designed that way. It also works the other way around: some decisions are thought to be set in stone, but in fact they were just random choices someone made in the past and can be easily changed. AI can answer questions about why things are the way they are, making knowledge transfer almost instantaneous.

Proactive Architecture Governance

Instead of discovering architectural problems during incident post-mortems, you catch issues early through automated compliance checks. This avoids costly policy violations or security issues that are detected too late. Technical debt accumulation is prevented because drift is detected immediately. Best practices are enforced consistently without relying on manual code review to catch everything.

Challenges and Considerations

There are real challenges to address:

Privacy and Sensitivity

Meeting transcriptions can contain sensitive information. You need proper access controls and data governance. Not all discussions should be automatically documented—some conversations need to stay private.

Here’s a big one: in high-stake meetings with heated debates, you don’t want the AI to mark somebody as irrational or label them as a troublemaker. That’s a huge political risk. AI-generated meeting summaries need to be neutral and factual, avoiding any language that could be used politically within the organization.

AI Accuracy and Hallucination Risks

Generated ADRs need human review and approval. AI can get things wrong—it might misinterpret a decision or miss important nuance. Critical decisions should still have human oversight. You need to balance automation with accountability.

The key is treating AI as a documentation assistant that drafts ADRs, not as the decision maker. Humans decide, AI documents.

Cultural Change Required

Teams need to trust AI-generated documentation. That’s a significant shift from the current model where humans write everything. People need to shift from “writing docs” to “reviewing AI-generated docs.” This requires organizational buy-in and process changes.

Some engineers will be skeptical. They’ll want to write their own ADRs. That’s fine—the AI-assisted workflow should be an option, not a mandate. Let teams adopt it when they’re ready.

Tool Integration and Infrastructure

Most enterprises are still at a stage where they buy several disconnected AI solutions. Integration is a big hassle, especially when you need to connect across different vendors—chat tools like Slack or Teams, wikis, Confluence, SharePoint, and meeting software. Enterprises usually don’t allow you to just build ad hoc API integrations with AIs they don’t fully control.

Version control is critical for AI—it allows rollback and an auditable history. But version control systems like Git are not user-friendly to non-technical users. Architects should be comfortable with version control tools to fully leverage this workflow.

There’s also the question of AI model access and cost. Running these systems requires API access to capable AI models, which has ongoing costs.

Conclusion: The Path Forward

The shift from manual documentation to AI-assisted event-driven ADRs is more than a productivity hack—it’s a fundamental rethinking of how we approach architecture work. By adopting an event sourcing mindset, we capture decisions as they happen. AI serves as the documentation assistant, not the decision maker. We maintain both the event stream (ADRs) and the snapshot (current architecture), giving us both history and current state.

The future of architecture work with AI means more time for actual design and decision-making, less time on administrative documentation tasks, and better-quality decisions through AI-powered insights and compliance checks.

My recommendation: start experimenting with AI-powered ADR workflows. Don’t try to build the entire system at once. Start small—transcribe one meeting and generate an ADR from it. See how it works for your team. Then build incrementally: add compliance checks, cross-organizational search, formal verification. Share your learnings with the community.

We’re at the beginning of a major shift in how architecture work gets done. The teams that figure out how to effectively combine human decision-making with AI-powered documentation and governance will have a significant advantage. The question isn’t whether this will become standard practice—it’s how quickly your organization will adapt.

Want to learn Rust? Check out my book: