Overview
A railway company in Europe wanted generative AI to help its engineers keep software in line with the European Railway Traffic Management System (ERTMS) standards. The aim was to speed up documentation and compliance review of the codebase, while engineers keep the final say on every finding.
Solution
We helped build a generative AI MVP on Microsoft Azure for the railway company. The work included configuring storage accounts, setting up compute environments and integrating Azure AI services. The MVP generates code documentation, checks code against ERTMS requirements, and processes incoming data as it arrives. It drafts compliance findings for engineers to review.
Technology Stack
Features
- Automatic generation of code documentation
- Suggestions that make code easier to read
- Code verification against stated requirements
- Draft compliance findings against ERTMS standards
- Integration with Azure AI services

Outcome
The MVP gives the client's engineers a faster start on documentation and compliance review. Key outcomes:
- Code documentation generation: documentation is drafted from the code, which makes it easier to keep in step with the ERTMS standards.
- Compliance checks: the system drafts compliance findings that engineers review and accept or reject.
- Real-time data processing: new data is processed as it arrives, so reviewers work with current information.
from kickoff to MVP
MVP capabilities: code documentation, compliance checks, code verification, real-time processing
specialists on the team
How We Build LLM Compliance Checking for Code
Compliance checking with language models works when the model never judges alone. A requirement, a piece of code and the evidence linking them all have to be visible to the reviewer. We build these systems as pipelines with three kinds of input and a human at the end:
- Regulations as data. Standards and national rules are split into individual clauses with an identifier, a version and an effective date. When a source changes, the pipeline compares versions and lists the clauses that moved.
- Code as data. The codebase is parsed into modules and functions, and the existing documentation and tests are attached to each one.
- Mapping. Retrieval over PostgreSQL with pgvector or a vector database proposes which clauses apply to which modules. The model explains each proposed link and cites the clause text and the code it relies on.
- Findings. For every clause the output is covered, not covered or unclear, with evidence. Draft documentation and amendment notes are generated from the same evidence.
- Human review. Engineers and compliance staff accept or reject each finding, and their decisions become test data for the next run.
Today we build the workflow with LangGraph and trace every step in LangSmith, so an auditor can see why each finding was made.
Why Compliance Work Needs Evidence
Regulated engineering has a specific failure mode. A model can produce a fluent compliance statement that cites the wrong clause, an outdated version of a standard, or code that does not do what the text claims. In safety-related domains such as railway signalling, that error is worse than no answer, because it looks finished.
The research points to the same remedy we use: give the model the right documents and train or prompt it to work from them. In the DRAFT study on safety-critical software assessment, a retrieval-augmented, fine-tuned model reached a 7% improvement in correctness over the baseline model, with better handling of evidence. The gain is real but modest, which is why the human reviewer stays in the loop.
We also keep the system narrow. It checks and drafts. It does not sign off. Every finding links to the clause and the code behind it, every regulation version is recorded, and each run stores the model version, prompt, settings and retrieved evidence, so it can be repeated and compared. More on our approach: generative AI consulting and private LLM deployment.