Skip to main content

Laura AI - Tech Stack of Our RoboAdvisor

Tobias Jonas Tobias Jonas 7 min read
Laura AI - Tech Stack of Our RoboAdvisor

How a GDPR-compliant RoboAdvisor was created in the Google Cloud using Scala & TypeScript.

In our last blog post, we explained how you can use our new RoboAdvisor “Laura AI” to create a digital mortgage financing and thus a financing concept for your dream property. Today we want to look at the tech stack behind the RoboAdvisor. We will not only look at the technology around React and the Scala microservice architecture, but also at the approach during development. Together with Volksbank Rosenheim Chiemsee, we defined the requirements according to lean startup principles and brought the product to market readiness within a year.

The Technology Behind Laura AI

After 12 sprints and monthly usability test sessions, we now have 15 private “Laura AI” repositories containing various frontend applications, serverless functions, infrastructure as code, and microservices for Kubernetes. In numbers, as of March 1, 2019, this means approximately 160,000 lines of code and over 5,000 lines of comments. Most of it was programmed in TypeScript and Scala.

Microservices with akka, play2 and NodeJS

Our heterogeneous backend consists of several micro and nano services.
We deployed large coherent blocks as microservices on Kubernetes and smaller nano services as serverless cloud functions.

The entire content management system (CMS) is programmed in Scala and uses the Play2 framework from Lightbend. Together with Slick and Flyway, seamless migration and integration of all required data on the database is guaranteed. This system delivers and stores all required data for the Laura AI React application via REST interfaces. This includes not only the basic parameters of the individual banks but also the language settings and the financing lexicon, which automatically trains the Dialogflow AI service in the background via an akka service.

The real estate crawler for analyzing real estate portals, as well as our sales crawler, are implemented using akka. They parse the fully rendered page and extract the necessary information from the HTML code. For portals that use og:graph, this data is also extracted.
We generate our PDFs of the final concepts via several NodeJS containers that check out Latex templates from Git in the background, enrich them with texts and SVG graphics, and then compile them into a PDF. This can then be downloaded as a PDF by the user via Firebase Storage.

The chatbot “Laura” is designed with Google’s Dialogflow dialog system, but for performance reasons it is not addressed directly from the frontend, but triggered via a chat gateway programmed with akka and Scala. Dynamic training of new words from the financing lexicon is also handled via this interface.

Besides the services hosted via Kubernetes, there are also many Google Cloud Functions that handle smaller tasks. One example is the Mailjet serverless function that we use to send emails. Unlike AWS, Google does not offer a service for direct email sending like AWS Simple Email Service (SES). Another example of a nano service is the anonymous account analysis and the conversion of this data into a household budget. Currently, this function is not active, as we cannot legally offer this without a BaFin license yet.

All our services are subject to strict quality controls. All services are equipped with unit or integration tests, and end-to-end tests exist for the important processes, which we programmed with cypress.io. Before a commit can be merged from the test environment to master, i.e., the production environment, a 4-eyes review is required. Once a pull request meets the necessary quality requirements and is merged, it is automatically brought into production via a continuous deployment pipeline using Circle CI. This applies regardless of whether it’s nano services or microservices on Kubernetes.

Laura AI User Interface

At public release, there are two TypeScript React applications.
One application is used for managing the RoboAdvisor’s data. There, administrators or partner banks can define their settings, and the chatbot can be further trained.
The second application is the “Laura AI” web application itself. Like the administration interface, it is also hosted via Firebase and offers entry points for desktop and mobile devices. The app’s React router decides whether the normal web app or the progressive web app for mobile devices should be delivered.
What’s also interesting about the frontend is that this application can be accessed via multiple domains. This is necessary because via jetzt-baufinanzieren.de we decide via geolocation which partner bank to route the request to, and on the other hand, each partner bank has the option to create its own subdomain that always contains the appropriate data for its own bank. Volksbank Rosenheim-Chiemsee, for example, chose baufinanzieren-rosenheim.de. In the coming weeks, further adjustments will follow specifically in this area to also get the “duplicate content” SEO problem under control. Each partner bank can then define its own start page. At release, we redirect all requests to one bank to the Volksbank Rosenheim-Chiemsee domain.

The Laura AI interface has undergone more than 10 usability tests at TechDivision’s usability test sessions over the past months. Unbiased testers have put the app to the test again and again. The respective improvements have always flowed into the next sprints. This way, we were able to design an interface with optimal user guidance and guide the user purposefully through the complex topic. One of the biggest hurdles with such a modern complex interface was and is definitely the Internet Explorer 11 issue, which has a pronounced idiosyncrasy in its interpretation of CSS attributes.

Google Cloud

Initially hosted at Amazon Web Services (AWS), we have now completely moved to Google Cloud. In addition to many Google Cloud Platform services, we also use additional services like Dialogflow (chatbot) and Firebase (React hosting and authentication).
Laura AI is divided into several Google projects, each forming its own private network. This way, the test environment is completely separated from the production environment, and we operate two separate Kubernetes clusters for our Docker containers. Data storage is, like the service architecture, very heterogeneous. We use PostgreSQL (Cloud SQL) for our structured data and Google’s Cloud Datastore for less structured data. Static files, such as images, are hosted via Firebase Storage. For user management, we use Firebase Authentication. This service is initially only necessary for employees and administrators, as the platform is publicly accessible.

Since we placed a very strong focus on the reactive manifesto during development and our services always operate in at least two data centers in the Frankfurt region, we can guarantee very high availability.
Our monitoring and logging is largely built with Google Stackdriver, and we automatically test the functionality of the application regularly.

The Path to ISO27001 and GDPR

In the banking environment, we as a startup quickly learned that security is paramount. We decided to appoint an external data protection officer who also holds CISO (Chief Information Security Officer) certification. Together, we laid the foundation for ISO27001 over several weeks and can now work in compliance with GDPR. During this time, we introduced an information security policy, created all necessary processes and documents, trained our employees in these areas, and tested and documented their knowledge with exams. Unfortunately, we also initially failed at a BaFin hurdle. We were unable to deliver a service for automatic classification of account data in the form of a household budget in the first release, as we lack the license for account information services and this cannot be provided by the partner bank either.

Lean Startup with a Bank

In implementing the “Laura AI” platform, we followed lean startup approaches and handled the project with sprints and agile management. We were initially only able to implement these approaches with Volksbank Rosenheim because we chose an agile fixed price. We were aware that this is actually a cardinal sin of modern software engineering, but we believed in success and long-term collaboration, which has proven true. Through our enormous commitment, we were able to convince VR-Bank to further develop the RoboAdvisor to a marketable product and release it to their customers on March 1, 2019.

Tobias Jonas
Written by Tobias Jonas CEO

Cloud-Architekt und Experte für AWS, Google Cloud, Azure und STACKIT. Vor der Gründung der innFactory bei Siemens und BMW tätig.

LinkedIn