Icon
Back to Blog

Llanai's Tech Stack For the Engineers

Dive into the technical architecture of Llanai, exploring both the website and chatbot components. Learn about the AWS-based backend and LLM backbone I use to measure linguistic fluency.

Posted by

This is a continuation from Prompt Engineering a Teacher for Language Learning.


As Llanai continues to evolve, many have asked about the technical underpinnings of this language learning platform. In this article, I'll peel back the curtain and discuss the architecture of Llanai, diving into both the website and the AI-powered backend that drives the language learning experience.

Llanai: A Two-Part System

Llanai consists of two main components: the website and the chatbot. Let's explore each in detail.

The Website: Our Digital Storefront

Llanai's website serves as the global storefront, attracting users to the core product: the AI chatbot. I built the site using Marc Lou's Shipfast template and deployed it on Vercel. This approach allowed me to focus primarily on content development.

The Shipfast template has been invaluable, providing essential services for a full-stack web app, including authentication, payment processing, email handling, and database options. It's a powerful tool that I highly recommend for rapid development.

Below is an architectural schematic of Llanai's site tech stack using Shipfast and Vercel.

An architectural schematic of Llanai's site tech stack.
An architectural schematic of Llanai's site tech stack.

The Chatbot: The Heart of Llanai

About 80% of our development time went into building the chatbot. Its primary purpose is to advance the learner's fluency, which we measure through several linguistic traits:

  • Rhythm and flow
  • Speech Rate
  • Filler words, Repetitions, self-corrections
  • Grammar
  • Vocabulary

Technical Implementation

We use a combination of APIs and custom implementations to measure these metrics:

  • Rhythm and flow: Measured via the SpeechSuper API
  • Speech rate: Custom Python implementation
  • Filler words, repetitions, and corrections: OpenAI Whisper API for transcription, analyzed by an LLM

Below is an example of my speech rate over the first 9 lessons with Llanai.

A chart displaying the variable word speech rate of a user across different lessons.
Chart displaying my variable speech rate across lessons.

The LLM Sequence

To process user data and generate responses, we use a sequence of Large Language Models (LLMs):

  1. Onboarding LLM
  2. Teacher LLM
  3. Summary LLM
  4. Conversion LLM
  5. Inquiry LLM

Each LLM has a specific role in the chatbot's workflow, from onboarding new users to summarizing lessons and converting the user from free to paid.


I strayed away from an agentic workflow, because I wanted to avoid unpredictable behavior. All of this relies upon a internal timers, cache memory, and CRUD operations with the underlying AWS RDS PostgreSQL.

Backend Architecture

I chose AWS to host the chatbot due to its reliability and ability to handle complex tech stacks. Here's a breakdown of our backend architecture:

  • Backend Framework: FastAPI
  • Messaging: Twilio (for WhatsApp integration)
  • LLM Providers: OpenAI and Groq
  • Text-to-Speech: XI Labs
  • Pronunciation Analysis: SpeechSuper API
  • Containerization: Docker
  • Databases: AWS RDS PostgreSQL (long-term) and AWS ElastiCache (short-term)
  • Security: AWS Web App Firewall, Lambda, and DynamoDB
  • Load Distribution: AWS Load Balancer
An architectural schematic of Llanai's Chatbot.
An architectural schematic of Llanai's Chatbot.

Feedback and Visualization

The metrics collected serve two purposes:

  1. Input for the chatbot logic to create future learning plans
  2. Feedback for learners to highlight areas for improvement

Llanai comes with a web dashboard that offers an accessible interface for visualizing this information, including detailed assessments of grammar and syntax usage.


Below you can find example of visual feedback provided by Llanai.

Sentence: Gracias. Entonces somos seis personas y vamos a llegar a cerca de las ocho de la noche.  Tense Verb Errors: 0 All verbs are in the correct tense.  Conjugation Verb Errors: 0 All verbs are correctly conjugated.  Syntax Errors: 1 The syntax is correct, but 'a cerca de' should be 'cerca de' when referring to proximity in time.  Recommendations: Use 'cerca de' instead of 'a cerca de' to indicate approximation in time.
An example of Llanai's grammar correction feature.
A pie chart displaying the portion of syntax, tense, or verb conjugation errors.
A summary of a user's grammar errors across various lessons.

Looking Ahead

As Llanai continues to develop, focus is on growing the user base and meeting their needs. On the same time, I hope to make this a lean and efficient engineering process. I am eager to see how Llanai evolves and the impact it has on language learners worldwide.

Hope this has been enlightening for the tech-savvy readers. As always, I welcome feedback and suggestions as I continue to refine and improve Llanai.