A century of paper contracts, finally readable by machines.
Vattenfall operates electricity distribution across Sweden. Running that infrastructure means tens of thousands of land-use agreements (markupplåtelseavtal) that authorise Vattenfall to route cables and equipment across private property. Every one of those agreements contains structured data such as contract dates, property references, property owner details and grid identifiers that the business needs to manage, renew, and act on.
That data existed and Vattenfall owned it, but because it lived inside scanned PDFs, as an image without consistent structure, it was functionally invisible to any system that depended on it. Querying it, reporting on it, feeding it into operational decisions: none of that was possible without a person first locating the right document, reading it, and manually typing the relevant fields into a document management system. The work was slow, but that was not the real problem. The data did not exist in any form a system could use. No query could find it. No report could include it. No automated process could act on it. Until someone opened the document and retyped the fields by hand, the data was not there.
The variety of documents made automation difficult. A contract from 2010 looks different from one written in 1940. Different layouts, different typefaces, sometimes handwritten text on paper that had been scanned into an archive. Any system capable of extracting from one format would struggle with the next. Vattenfall brought that problem to Devies with a clear brief: make the data accessible, without building something Vattenfall would have to run and maintain themselves/on their own.

“Before Dokustrakt, getting a single data field from a contract meant someone opening a PDF and typing it by hand. Now they upload a batch, review what the system extracted, and export. That is the whole process.”
Thomas Högberg, Teach lead at Devies Digital Code
Impact highlights

~3 500 hours
…of manual data entry eliminated across 45,000 agreements

2,500 contracts
processed per month through automated extraction.

SaaS service
built and operated by Devies, which owns the infrastructure and accountability.

Human review built in:
operators inspect and correct flagged fields before export
Validating the approach on real data before building the system
Vattenfall’s archive spans decades of contract history, and that history does not follow a single format. Committing to a full automation system without first testing whether AI could handle that variety would have been expensive and risky. Instead, the project started deliberately small: one contract type, a limited sample, a clear success criterion.
Devies trained a document-splitter and -extractor using Google Document AI using sample images, then wrote software to apply the trained model on actual PDFs and export structured fields to a spreadsheet. Testing against a broader sample surfaced the real depth of the problem quickly. Contracts from different eras brought different layouts, different typefaces, and in some cases handwritten fields that resist automated reading entirely. Complexity surfaced piece by piece, and the model had to adapt as new edge cases appeared.
The system was built first on contracts from 2015 onwards, where structure is consistent enough for the model to work reliably. The older archive is a harder problem, but the assumption guiding the next phase is that tomorrow’s contracts will look more like today’s than yesterday’s, so the foundation built on modern documents is a reasonable place to start expanding/generalizing from. How far the model can reach into the archive is something the work itself will answer.

From proof of concept to a product Vattenfall does not have to run
Dokustrakt is the productification of that proof of concept (POC). It is a hosted web application built and operated by Devies. Vattenfall uses the service, pays for consumption, and is never responsible for running or maintaining the infrastructure. That arrangement is mutually beneficial for both parties: Vattenfall focuses on its core business without taking on technical ownership, and Devies retains accountability for a service it built and continues to develop. The models from the original POC are still the ones running in production today.
Development followed the same principle as the POC. Working components went live before the entire system was finished, letting Vattenfall begin using the extraction service while the pipeline was still being refined and validated. The stack was built for durability: Rust for the backend and frontend, PostgreSQL for data storage, deployed on Azure with Kubernetes (AKS), Terraform, and Docker, with Google Document AI handling extraction.

"Our historical land-use agreements were functionally invisible to our systems until Devies stepped in. With Dokustrakt, we have automated away thousands of hours of manual data entry and turned static PDFs into structured, actionable data. Best of all, it is delivered as a service we do not have to maintain."
Erika Persson, Head of Department at Vattenfall Eldistribution AB
How Vattenfall continues to clear the archive
The archive is no longer a fixed cost of manual labour. Contracts are uploaded in batches, processed by the extraction model, and reviewed by a Vattenfall operator before the data is exported, replacing what used to require manual reading and typing, field by field. Around 2,500 contracts move through that pipeline each month.
Vattenfall brought a well-defined problem and years of real documents. Devies built the extraction model, turned it into a running service, and took on responsibility for keeping it that way. What changed is not the volume of contracts Vattenfall holds; it is that those contracts are no longer a queue waiting for someone to manually process them.



