Back to projects
RAGFeature ExtractionAI Agents

Danish Leasing Company: Contract AI

A contract-processing workflow for extracting structured meaning from large real-estate document sets.

Role
AI workflow and RAG engineering
Focus
RAG / Feature Extraction
Stack
Python, FastAPI, Docker

Context

The shape of the problem

The hard part was not simply reading contracts. Real-estate documents contain domain language, obligations, entity relationships, and inconsistent formats. The project needed a workflow that could be evaluated against business rules, not just a plausible summary.

Build

What I actually built

I designed a RAG-based extraction flow tailored to the leasing domain, combining retrieval, entity extraction, and structured processing steps. The emphasis was on making contractual information searchable, traceable, and accurate enough for a proof of concept with real operational value.

Engineering

Key decisions

01

Processing complex legal documents with variable formats and structures

Built a custom RAG pipeline tailored for real estate contracts

02

Accurately extracting entity relationships and contractual terms

Integrated specialized entity extraction and indexing mechanisms

03

Handling documents with specialized real estate and legal terminology

Developed adaptable workflows capable of handling varied document structures

04

Creating a system that could adapt to new document types without retraining

Outcome

What changed

  1. 01Achieved 95% accuracy in contract data extraction, exceeding initial expectations for the PoC
  2. 02Demonstrated the power of merging AI agents with crystal clear business rules

Stack

Tools and systems

PythonFastAPIDockerVector Databases

I build delightful systems.

© 2026 Kristian Ernst.