Slide 1

Slide 1 text

LLMs as domain experts

Slide 2

Slide 2 text

Talysson Oliveira Software architect & Chief Learning Officer at Codeminer42 @talyssonoc talysson.com

Slide 3

Slide 3 text

dddbrasil.com.br linkedin.com/company/dddbrasil youtube.com/@ddd-brasil

Slide 4

Slide 4 text

⚠ This is not a "how to drive a project with AI" talk Also not an "AI is bad/good" talk talysson.com

Slide 5

Slide 5 text

Can LLMs be used as domain experts? talysson.com

Slide 6

Slide 6 text

Can LLMs be used as domain experts? Can LLMs automate DDD practices? talysson.com

Slide 7

Slide 7 text

Automating Domain-Driven Design: Experience with a Prompting Framework Eisenreich, T., Jusic, H., & Wagner, S. (2026, March 27) https://arxiv.org/abs/2603.26244v1

Slide 8

Slide 8 text

Requirements Input Ubiquitous Language Establishment + Event Storming Simulation System Prompt: DDD Specialist and Architecture Sparring Partner Bounded Contexts Identification Aggregate Design Technical Architecture Mapping Eisenreich, T., Jusic, H., & Wagner, S. (2026, March 27) https://arxiv.org/abs/2603.26244v1 Domain Model

Slide 9

Slide 9 text

Ubiquitous Language Establishment Event Storming Simulation Errors accumulate without guidance Bounded Contexts Identification Aggregate Design Technical Architecture Mapping Eisenreich, T., Jusic, H., & Wagner, S. (2026, March 27) https://arxiv.org/abs/2603.26244v1

Slide 10

Slide 10 text

Ubiquitous Language Establishment Event Storming Simulation Errors accumulate without guidance Bounded Contexts Identification Aggregate Design Technical Architecture Mapping Eisenreich, T., Jusic, H., & Wagner, S. (2026, March 27) https://arxiv.org/abs/2603.26244v1

Slide 11

Slide 11 text

Can LLMs automate DDD practices? Some of them talysson.com

Slide 12

Slide 12 text

Should we automate these DDD practices? talysson.com

Slide 13

Slide 13 text

Ubiquitous Language Establishment Builds a shared understanding of the model Event Storming Simulation Errors accumulate without guidance Bounded Contexts Identification Aggregate Design Technical Architecture Mapping talysson.com Requires understanding of the model

Slide 14

Slide 14 text

Ubiquitous Language Establishment If you fully automate these Event Storming Simulation Errors accumulate without guidance Bounded Contexts Identification Aggregate Design Technical Architecture Mapping talysson.com You won't be able to guide these

Slide 15

Slide 15 text

Does it mean we should not use AI with DDD? No, but humans should be active, especially in the groundwork talysson.com

Slide 16

Slide 16 text

What about SDD? Spec-Driven Development talysson.com

Slide 17

Slide 17 text

Idea Specification Implementation Refinement talysson.com Validation

Slide 18

Slide 18 text

"The code is a lossy projection from the specification" AI Engineer. (2025, July 12). The New Code - Sean Grove, OpenAI. https://www.youtube.com/watch?v=8rABwKRsec4

Slide 19

Slide 19 text

A set of properties a useful specification needs - Communicates meaning and intent - Uses a consistent and unambiguous vocabulary - Define a scope to which it applies talysson.com

Slide 20

Slide 20 text

DDD spent 20 years solving a problem SDD just discovered it has: Effective and meaningful communication talysson.com

Slide 21

Slide 21 text

We just need to write very detailed specifications! … right? talysson.com

Slide 22

Slide 22 text

"[...] would be an utterly simple person […] if he thinks written words are of any use except to remind him who knows the matter about which they are written, […] if you question them [the words], wishing to know about their sayings, they always say only one and the same thing [...]" - Phaedrus, Plato, 370 BC talysson.com

Slide 23

Slide 23 text

"[...] the programmer's knowledge transcends that [knowledge] given in documentation [...]" - Programming as Theory Building, Peter Naur, 1985 talysson.com

Slide 24

Slide 24 text

"The code is a lossy projection from the specification" talysson.com

Slide 25

Slide 25 text

"The code is a lossy projection from the specification" The specification is a lossy projection from the model talysson.com

Slide 26

Slide 26 text

The model isn't a document or the code It is shared understanding and intuition talysson.com

Slide 27

Slide 27 text

Where is AI useful when practicing DDD? talysson.com

Slide 28

Slide 28 text

LLMs as domain experts talysson.com

Slide 29

Slide 29 text

LLMs as domain experts Why would we want LLMs as domain experts? talysson.com

Slide 30

Slide 30 text

To represent a problem + solution, we need a domain model To explore a domain model, we need domain knowledge To have domain knowledge, we need domain experts And sometimes, domain experts may not be available talysson.com

Slide 31

Slide 31 text

Why would domain experts not be available - Their available time is scarce - The access to them is not easy or practical - The communication is not in tune yet - The team doesn't have domain experts (yet) talysson.com

Slide 32

Slide 32 text

How can LLMs help us in these cases? talysson.com

Slide 33

Slide 33 text

Ubiquitous language Domain experts talysson.com Development experts

Slide 34

Slide 34 text

Domain experts talysson.com Development experts

Slide 35

Slide 35 text

Domain experts talysson.com Development experts

Slide 36

Slide 36 text

Domain experts Development experts We do this first talysson.com

Slide 37

Slide 37 text

To make the best out of this Domain experts Development experts We do this first talysson.com

Slide 38

Slide 38 text

Example: Special in-flight meals talysson.com

Slide 39

Slide 39 text

In-flight meals talysson.com

Slide 40

Slide 40 text

talysson.com

Slide 41

Slide 41 text

talysson.com

Slide 42

Slide 42 text

You can't "vibe" your way to something you can't recognize when you get there talysson.com

Slide 43

Slide 43 text

What problem are we solving? talysson.com

Slide 44

Slide 44 text

Special in-flight meals system - Allow airlines to offer special in-flights meals paid in advance - Customers order special meals up to 5 hours before the boarding - A list of meals is sent to a specialized company, which will cook and deliver them directly to the airports - Customers can rate their experience and be part of a loyalty program and get discounts and gifts talysson.com

Slide 45

Slide 45 text

In-flight meals Logistics talysson.com

Slide 46

Slide 46 text

talysson.com

Slide 47

Slide 47 text

talysson.com

Slide 48

Slide 48 text

talysson.com

Slide 49

Slide 49 text

talysson.com

Slide 50

Slide 50 text

In-flight trolleys (meal carts) Turnaround schedules Extra in-flight meals Cold chain Long-haul flights talysson.com HACCP (Hazard Analysis Critical Control Point) In-flight meal shortage Standardization

Slide 51

Slide 51 text

Then, ask about these concepts in the same conversation (within the same LLM context) talysson.com

Slide 52

Slide 52 text

talysson.com

Slide 53

Slide 53 text

talysson.com

Slide 54

Slide 54 text

HACCP Domain experts talysson.com HACCP Development experts

Slide 55

Slide 55 text

HACCP Domain experts talysson.com Development experts

Slide 56

Slide 56 text

Use LLMs to prime yourself for conversations with domain experts talysson.com

Slide 57

Slide 57 text

But there are two catches! talysson.com

Slide 58

Slide 58 text

1 An LLM will give you the industry-average knowledge This knowledge/vocabulary might not work for your case talysson.com

Slide 59

Slide 59 text

2 LLMs are sycophants "You're absolutely right!" The "tone" you use with LLMs might push them towards the wrong direction talysson.com

Slide 60

Slide 60 text

Pay close attention to the confidence provided by conversations with LLMs talysson.com

Slide 61

Slide 61 text

What if there are no domain experts? talysson.com

Slide 62

Slide 62 text

talysson.com

Slide 63

Slide 63 text

talysson.com

Slide 64

Slide 64 text

talysson.com

Slide 65

Slide 65 text

Use LLMs to empower your team while the team explores the domain model talysson.com

Slide 66

Slide 66 text

Can LLMs help during EventStorming? talysson.com

Slide 67

Slide 67 text

Yes But the LLM is never in the room talysson.com

Slide 68

Slide 68 text

Roles played outside of the EventStorming room 1. Make the industry-average knowledge useful - 2. 3. Generate candidate domain events before the session, read and compare with the wall only afterwards Role-play the absent stakeholder - Generate questions the absent stakeholder would make, never answers - Direct the questions to this person after the session Check the graph structure - talysson.com Events with no trigger or consumer, orderings that can't happen, …

Slide 69

Slide 69 text

Using LLMs to make the access to the model easier for the whole team talysson.com

Slide 70

Slide 70 text

LLMs don't think You can't give them model intuition talysson.com

Slide 71

Slide 71 text

But you can document the model as much as possible and feed it to a LLM talysson.com

Slide 72

Slide 72 text

The documentation does not contain the totality of the model But it can be good enough! talysson.com

Slide 73

Slide 73 text

Documenting the domain model - Sub-domains and bounded contexts - Scope and responsibilities - Ubiquitous language glossary - Context map - Specifications, use cases and user stories of your system - Tactical patterns talysson.com - Aggregates, entities, value objects, domain services, … - Architecture Decision Record (ADR)

Slide 74

Slide 74 text

Written (or at least guided) by a human - Your documents should use the ubiquitous language - Actively guide it not to let LLMism sneak into it - Otherwise your docs will eventually look like this: - - "This check is load-bearing in the process" - "And it answers the question plus expose one more wrinkle" - "And the trap is zero-dollar invoices" Said no human domain expert ever talysson.com

Slide 75

Slide 75 text

Fill the gaps where an LLM could hallucinate - Don't leave important concepts implicit - When images are needed, add a description as well - Explicitly state possible misunderstandings - E.g.: " is not the same as " - Zero documentation is better than misleading/outdated documentation - But zero documentation means the LLM gets more… creative - Treat hallucinations as a sign of a gap in your docs talysson.com

Slide 76

Slide 76 text

Checking the ubiquitous language with LLMs 1. Synonyms - 2. Homonyms - 3. "Find one word that is used for more than one concept" Glossary drift - 4. "Find two or more words used for the same concept" "Find terms in code that aren't in the glossary, and vice-versa" Name vs behavior - talysson.com "The glossary says XYZ, does the code agree?"

Slide 77

Slide 77 text

Use tools to make it even more LLM-friendly - Use team workspaces in LLM chat tools - Connect the LLM to MCP servers of your platforms - - Version control system (GitHub, Gitlab, …) - Wiki (Confluence, Notion, …) - Project management (Jira, Linear, …) Use well-known LLM-friendly formats talysson.com - AGENTS.md / CLAUDE.md - Mermaid diagrams - Skills for well-defined patterns

Slide 78

Slide 78 text

talysson.com

Slide 79

Slide 79 text

LLMs as domain experts - LLMs can't be fully trusted, they can hallucinate - Arguably, humans can make mistakes too - The difference being that humans: - Can actually think - Have long-term memory - Can be held accountable - Domain experts provide expertise and collaboratively explore the model - LLMs can be used to the former, but should not make decisions on the latter talysson.com

Slide 80

Slide 80 text

It's ok to let LLMs write the code But the model belongs to humans talysson.com

Slide 81

Slide 81 text

Thank you! @talyssonoc talysson.com