Skip to project

Creations · Independent side project

ALT Artificial Learning Tutor

AI-supported learning, with teachers in control.

A platform for grounding AI in course materials, identifying knowledge gaps and helping students practise at their own pace.

Current implementation

Django core, course-grounded RAG, objective-level mastery and optional specialist services.

Planned evolution

Kafka workflows, dedicated compute pools, on-demand scaling and an independent Java acceptance framework.

From Proof of Concept to Distributed Architecture: Building ALT

The technical guides mentioned below refer to the ALT source repository; they are not published on this site.

Introduction

ALT (Artificial Learning Tutor) started with a relatively simple question: how can artificial intelligence be integrated into education without taking control of the educational process away from teachers?

General-purpose AI tools can explain concepts, generate exercises and answer questions. However, they do not necessarily understand what a particular student is supposed to learn, what material has already been covered, or whether the student has actually mastered a subject.

I wanted to explore a different approach. A platform where teachers remain in control of the educational process, while AI helps them identify knowledge gaps, generate additional practice, assess student performance and adapt the learning experience to individual needs.

ALT is an independent side project that I work on in my own time. It gives me an opportunity to explore software architecture, backend development, artificial intelligence and infrastructure while applying the quality engineering principles I developed throughout my professional career.

In this article, I want to cover how ALT was initially designed, its current implementation, why I deliberately started with a monolithic architecture, how I intend to evolve it into a distributed system, and what steps I plan to take to ensure quality throughout this transition.

1. The problem ALT is trying to solve

One of the challenges in education is that students rarely progress at the same pace. Even when they attend the same lessons and receive the same materials, their understanding of individual topics can differ significantly.

Teachers have limited time to identify these differences and prepare personalised exercises for every student. My own experience teaching programming and database fundamentals reinforced this observation. Two students can receive the same assessment score while struggling with completely different concepts. A score alone does not necessarily explain what needs to be addressed.

ALT is designed around several principles:

  • Teachers define educational material, learning objectives and assessment criteria.
  • AI operates within the context of the course rather than relying exclusively on its general knowledge.
  • Student progress is evaluated against individual learning objectives.
  • Identified knowledge gaps can trigger additional practice and remediation.
  • Different types of exercises require different assessment mechanisms.
  • Educational institutions should retain control over their data and infrastructure.

Rather than treating an assessment as the final stage of a learning process, I want ALT to use assessment results as input for subsequent learning activities. If a student struggles with a particular concept, the platform should identify the relevant learning objective, retrieve the appropriate educational material and provide additional opportunities to practise.

The objective is not to replace teachers. It is to provide them with better tools to understand and support their students.

2. Why I started with a monolith

When I started working on ALT, the primary objective was to build a proof of concept. At that point, I had a general understanding of what I wanted the platform to achieve, but many of the actual requirements, domain boundaries and technical challenges were still unknown.

Starting with a distributed architecture would have meant introducing additional complexity before validating the underlying idea. I would have needed to design inter-service communication, distributed data management, service discovery, deployment orchestration and failure recovery before knowing whether the educational workflows themselves made sense.

Instead, I chose Python and Django as the foundation of the application. Django provided a convenient environment for rapidly implementing the educational domain, managing data, exposing application functionality and experimenting with different approaches.

PostgreSQL was selected as the primary database, with pgvector providing vector storage and similarity search capabilities. This allowed me to implement Retrieval-Augmented Generation without introducing a separate vector database. RabbitMQ was selected to support asynchronous processing within the initial architecture.

This approach allowed me to concentrate on validating the actual product:

  • Can educational materials be processed and retrieved effectively?
  • Can AI-generated responses remain grounded in course materials?
  • Can learning objectives be associated with exercises and assessment results?
  • Can the platform identify knowledge gaps and provide meaningful additional practice?
  • Can different AI models be integrated without redesigning the application?

The monolith was not intended to be the final architecture. It was a deliberate decision to prioritise experimentation, functional validation and a better understanding of the problem.

I believe architectural decisions should be driven by actual requirements. Designing a complex distributed system before understanding the problem it needs to solve can be just as problematic as retaining a monolith after its limitations become apparent. The proof-of-concept stage allowed me to discover those limitations rather than speculate about them.

3. The current implementation

This section describes the implementation in the ALT source repository. The Kafka architecture, automatic workload scaling and Java automation framework discussed later are proposals, not capabilities of the current runtime. The implementation baseline and architecture reference provide the detailed current behaviour.

ALT currently follows a hybrid architecture centred on a Django monolith. Django serves the web interface and APIs, while Celery workers perform background jobs through RabbitMQ. PostgreSQL with pgvector stores application data and document embeddings. Separate speech, drawing and coding services are available under different configuration and deployment conditions.

Current hybrid architecture
Figure 1. The current runtime and its optional service integrations. Speech assessment and drawing evaluation retain local paths; the coding integration requires separate deployment and runner qualification. Remote drawing and coding services own their own databases, queues and assets, omitted here for clarity. View full size

The educational core

The main application is responsible for the educational domain and the orchestration of learning workflows. It implements teacher and student access, enrollment, courses and educational materials, learning objectives, exercise generation and management, assessment evidence, mastery tracking, tutor conversations, and personalised practice and remediation. Institution-level administration and tenant isolation remain requirements for a future production deployment.

Keeping these responsibilities within the same application during the proof-of-concept stage allowed me to experiment with how they interact without introducing unnecessary network dependencies.

As the domain becomes better understood, these responsibilities provide potential boundaries for future microservices. However, not every module necessarily needs to become a separate microservice. The eventual decomposition should reflect actual domain boundaries, operational requirements and dependencies rather than simply the existing application structure.

Retrieval-Augmented Generation

One of the first major technical components I implemented was the RAG pipeline.

Educational materials are imported, processed, divided into smaller chunks and converted into vector embeddings. These embeddings are stored in PostgreSQL using pgvector. For document question answering, the application embeds the question, retrieves relevant chunks within the selected document, builds a bounded context and supplies it to the language model. The response includes source references; if retrieval supplies no usable context, the application returns an insufficient-context response without calling the generation model.

RAG pipeline
Figure 2. The RAG pipeline separates knowledge ingestion from context retrieval and generation, allowing educational responses to be grounded in teacher-provided materials. View full size

For example, if a student is learning Python exception handling, the platform should prioritise the terminology, explanations and examples provided within the course rather than generating an answer exclusively from the language model's general knowledge.

RAG does not eliminate hallucinations, but it provides a mechanism for controlling the context available to the model and improving the relevance of generated responses.

Another important design consideration is model independence. ALT has configurable generation adapters for OpenAI-compatible endpoints and the LM Studio SDK, plus a mock provider for tests. These allow locally hosted open-weight models and compatible external endpoints to be used without changing the educational workflows. I have been experimenting with locally hosted models, including Gemma, as part of the development process.

I do not want the platform's educational functionality to depend entirely on a particular AI provider or model. Models will continue to evolve, and replacing one should not require redesigning the educational application.

Learning objectives and mastery

A central concept within ALT is the separation between completing an exercise and demonstrating mastery of a subject. Completing an exercise provides evidence of a student's understanding. However, a single successful attempt does not necessarily demonstrate that the student has mastered the underlying concept.

The implementation records objective-level evidence from quizzes, targeted practice and drawing evaluations. Configurable accuracy and minimum-evidence thresholds determine the resulting mastery status. Spoken completion is tracked separately against current published exercise revisions, while coding uses a separate weighted positive-evidence dimension. These mechanisms provide a more granular view of progress, but they do not constitute a validated measurement of learning.

This information can subsequently be used to identify knowledge gaps and determine whether additional practice is required. The intention is to create a continuous learning and remediation cycle rather than a system that simply generates exercises and records scores.

Spoken exercise processing

Spoken exercises represent one of the first areas where the limitations of keeping all functionality inside the monolith became apparent. Speech processing has different computational requirements, dependencies and execution characteristics from conventional educational business logic.

Spoken assessment supports a local content-only path and an optional independent evaluator accessed over HTTP. Content assessment transcribes the recording through the configured speech provider and compares the transcript with teacher-approved answers using defined normalisation rules. A local whisper.cpp runtime can provide transcription.

The remote evaluator also offers opt-in Japanese timing coaching. In that profile:

  • Whisper through whisper.cpp provides automatic speech recognition and transcription.
  • Montreal Forced Aligner (MFA) provides word and phoneme timings when the content matches and the required alignment assets are available.

Content matching determines the pass decision. Alignment timings are descriptive feedback; the implementation does not assign pronunciation or pitch-accent grades. The coaching profile is experimental and disabled by default, and its availability must be checked before publishing an exercise that requires it.

Separating the evaluator allows its dependencies and computational requirements to evolve independently of Django. The educational core continues to own access control, exercise revisions, stored attempts, pass evidence and progression. Remote assessment currently uses request/response contracts rather than Kafka commands and events. The spoken evaluator guide describes the supported paths and validation limits.

Drawing and writing exercise processing

The current Drawing / Writing Exercises feature evaluates a student's raster drawing against a teacher-selected reference image. It supports practice such as copying a character or diagram; it does not perform OCR, assess essays, interpret diagram meaning or grade stroke order.

Drawing is optional at course level. The default backend keeps its records and evaluation workflow in ALT, using Celery for background processing. An independent drawing service is also implemented, with its own PostgreSQL database, RabbitMQ queue and private asset storage. Switching to that service requires an explicit, verified data migration; an outage does not automatically switch backends.

In remote mode, ALT retains identity, course policy, lesson access, learning objectives and mastery. The service owns drawing content, immutable revisions, attempts, evaluations and assets. ALT reconciles a durable result and deletion feed to update evidence without reading the service's database. The drawing service runbook documents this boundary and cutover process.

Coding exercise processing

The repository also includes a separate coding exercise service. ALT owns course access, skills and learning links; the service owns authoring snapshots, execution jobs and results, with its own database, RabbitMQ infrastructure and private object storage.

Coding is disabled by default. Its execution design uses a dedicated Linux/KVM runner and a fresh Firecracker microVM for each test case. Learner access requires runtime qualification and explicit feature and course-policy enablement. The browser journey suite uses a deterministic runner fixture and therefore does not establish execution isolation. The coding operations guide distinguishes the implemented integration from the remaining deployment gates.

Identity management

Alongside ALT, I have been developing ALT-Identity, an experimental OpenID Connect provider intended exclusively for development and testing purposes.

Its purpose is to provide a controlled environment in which I can develop and validate authentication flows, identity integration and access control across the ALT ecosystem without introducing an external identity provider dependency during the proof-of-concept stage.

ALT-Identity is not a production-ready identity service. Implementing a production-grade identity provider introduces significant security, operational and compliance responsibilities that fall outside the current scope of this project.

ALT's authentication architecture is based on standardised OpenID Connect integration rather than a dependency on ALT-Identity itself. The experimental provider would need to be replaced with an established, production-grade identity management solution before any production deployment. The ability to replace the identity provider without significant changes to the application will also need to be validated.

4. The next architectural step

The proposed next architectural stage is a gradual transition towards an event-driven microservice architecture. Kafka-based dispatch, service-specific schedulers and automatic scaling are not implemented in the current runtime.

The reason for this transition is not simply that microservices are a popular architectural pattern. Different components of ALT have fundamentally different computational requirements, scaling characteristics and availability requirements.

For example, managing course information is relatively inexpensive compared to processing audio recordings, generating embeddings or running large language models. Scaling the entire application because one particular capability requires additional computational resources would be inefficient.

Target event-driven architecture
Figure 3. The proposed event-driven architecture uses Apache Kafka as its communication backbone. Each processing service has an independent load-balancing layer, pending workload queue and dedicated compute pool. Service boundaries and gateway are illustrative proposals. “Written” denotes the drawing/writing workload; coding infrastructure is omitted. View full size

The target architecture introduces Apache Kafka as the common event backbone, independently deployable microservices, dedicated load balancers and compute pools for individual service types, persistent workload queues, on-demand Podman container deployment, independent scaling and explicit ownership of business domains and data.

Event-driven communication

The proposal is to introduce Apache Kafka as the primary command and event backbone. RabbitMQ currently carries Celery and service-specific execution jobs; replacing those queues would require a separate migration decision for each workload. Introducing Kafka alone would not replace Celery task execution. Services will communicate through versioned commands and events.

A command represents a request to perform an operation, while an event represents something that has occurred within the system.

For example, submitting a spoken exercise may result in a command requesting speech assessment. Once processing is complete, the spoken exercise service publishes an event containing the assessment result. Other services can consume that event and perform their own operations, such as recording assessment evidence, updating mastery or determining whether additional practice is required.

The spoken exercise service does not need to understand how mastery is calculated or how remediation is organised. This separation reduces coupling between processing capabilities and educational business logic. It also allows additional consumers to be introduced without necessarily modifying the service responsible for producing an event.

Each service type is intended to have its own command and event topics, allowing workload consumption, access control, monitoring and retention policies to be managed independently.

Kafka will provide durable message transport and event retention. However, the management of pending workloads, execution state and resource availability will remain the responsibility of the relevant service infrastructure. The exact queue persistence mechanism remains to be selected.

Dedicated load balancers and compute pools

One of the more important aspects of the proposed architecture is the absence of a central workload dispatcher. Instead, each service type will have its own dedicated load-balancing layer and compute pool.

The spoken evaluator, drawing/writing service, AI inference service and embedding service would each manage their own execution infrastructure. The coding runner would retain its separate isolation boundary. Here, “load balancer” means an application-level workload scheduler that also coordinates worker capacity and deployment, rather than only an HTTP reverse proxy. This scheduling layer would need to be implemented and tested.

A service-specific load balancer will be responsible for:

  • Monitoring registered service nodes and tracking their health and availability.
  • Evaluating available processing capacity.
  • Distributing commands and their execution context.
  • Maintaining pending workloads.
  • Coordinating service deployment and scaling.
  • Handling interrupted or unsuccessful executions.

When a command arrives, the load balancer determines whether an appropriate node is available. If capacity is available, the command and all necessary execution context are forwarded to that node. If no node is available, the command is retained in a persistent queue until processing capacity becomes available.

Temporary resource exhaustion should leave an accepted command pending, subject to explicit admission limits, expiry and cancellation policies. Queue capacity and maximum waiting time must be bounded so that overload does not create an indefinitely growing backlog.

Each compute pool is dedicated to its respective service type. If all spoken exercise nodes are occupied while written exercise nodes are idle, spoken exercise commands remain queued rather than being redirected to unrelated infrastructure.

This makes resource allocation more predictable and allows each service pool to be optimised for its particular workload. For example, an AI inference pool may consist of GPU-equipped machines, while other processing services may primarily require CPU resources and sufficient memory.

The trade-off is that dedicated pools can result in underutilised hardware. However, they also provide clearer resource boundaries, more predictable performance and better workload isolation. A saturated spoken exercise pool should not prevent unrelated written exercises from being processed.

Each service pool can be expanded, upgraded or restarted independently, without requiring the entire platform to undergo the same operation.

Command execution context

A processing node should receive enough information to execute its assigned command without having to reconstruct the entire educational workflow through multiple additional service calls.

For a spoken exercise, this context could include:

  • A unique command identifier and correlation identifier.
  • The exercise and attempt identifiers.
  • The expected text and exercise language.
  • The assessment configuration and required model profile.
  • A reference to the submitted audio recording.

Large artifacts, such as audio recordings and documents, should be passed by reference rather than embedded directly into Kafka messages. The command should also identify the relevant versions of the exercise and assessment configuration so that processing remains consistent even if educational content changes while the command is waiting in a queue.

This approach allows processing services to remain relatively independent of the educational domain.

On-demand container deployment

The current development launcher already runs Django, Celery, PostgreSQL/pgvector and RabbitMQ as persistent Podman containers. Optional service deployments and host runtime management are also available. Automatic deployment in response to queued workloads is a proposed extension; Podman supplies the container runtime, while scheduling and scaling require additional control logic. Resource-intensive processing containers should not necessarily remain active when there is no work to perform.

The target architecture will support deploying service containers on demand, processing pending workloads and releasing computational resources when those containers are no longer required.

Command execution lifecycle
Figure 4. Commands are dispatched to available nodes within a dedicated service pool. When capacity is unavailable, the command remains queued until it can be processed. This is a proposed normal execution path. “Node available” means a compatible host has capacity; starting its container must include readiness checks before dispatch. Durable acceptance, expiry and recovery paths are omitted. View full size

For example, a spoken exercise workflow could operate as follows:

  1. A student submits an audio recording.
  2. An assessment command is published to Kafka.
  3. The spoken exercise load balancer receives the command.
  4. The load balancer identifies an available node within its dedicated compute pool.
  5. If necessary, the required Podman container is started and becomes ready.
  6. The command and its execution context are forwarded to the service.
  7. The configured speech provider transcribes the recording; an enabled timing-coaching profile also runs alignment when applicable.
  8. The assessment result is published to Kafka.
  9. Interested educational services process the resulting event.
  10. The processing container can be stopped after a configurable period of inactivity.

If all nodes are occupied, the command remains pending until sufficient processing capacity becomes available. The infrastructure required to receive commands, retain pending workloads and coordinate deployments must remain available even when processing workers are scaled down.

This approach is particularly relevant for AI workloads, where memory consumption and hardware requirements can vary significantly between services. At the same time, starting a container and loading an AI model introduces additional latency. For frequently used services, keeping a minimum number of instances active may be more efficient than repeatedly starting and stopping them.

The deployment strategy should therefore be configurable for each service type.

Data ownership and consistency

Moving towards microservices also requires reconsidering how data is managed. Within the monolith, different application modules can interact with the same database and participate in the same transactions. In a distributed architecture, services should have explicit ownership of their respective data.

For example, the service responsible for recording assessment results should own those records, while the mastery service should own the student's mastery state. Other services should interact with this information through established contracts rather than directly modifying another service's database.

This introduces eventual consistency into workflows that previously could have been completed within a single database transaction. A student may submit an exercise successfully before the assessment has been completed, and the assessment may be completed before the corresponding mastery state has been updated.

These intermediate states need to be represented explicitly rather than treated as unexpected behaviour.

Reliability in a distributed environment

Moving from a monolith to distributed services introduces an entirely different category of engineering challenges. A local function call can fail, but a distributed operation can also time out, be delivered more than once, complete without its result reaching the consumer, or be interrupted by the failure of an entire node.

The target architecture must therefore account for duplicate command and event delivery, idempotent processing, persistent workload state, retry and recovery mechanisms, service and node failures, event and API contract versioning, eventual consistency, distributed logging and tracing, and correlation between commands, events and educational workflows.

The coding service already uses a transactional dispatch outbox, and the drawing integration has durable jobs, recoverable leases and idempotent result reconciliation. I intend to evaluate how those patterns should extend to Kafka workflows. In particular, a Kafka offset must only be committed after a command has been durably accepted into execution state; result publication and educational updates also need explicit recovery and deduplication rules. These are not problems that disappear simply because Kafka is introduced. They need to be addressed explicitly through application and infrastructure design.

Observability will also become increasingly important. It should be possible to trace an educational workflow from the initial student submission through command dispatch, container execution, assessment and the eventual mastery update. Without this visibility, investigating defects in a distributed system would become unnecessarily difficult.

5. Maintaining quality during architectural refactoring

One of the biggest risks associated with architectural refactoring is introducing regressions into functionality that already works. A distributed architecture is not an improvement if the resulting system is less reliable or produces inconsistent educational outcomes.

ALT already has Python regression and integration tests, service contract checks, browser component regressions and Playwright user journeys. A Gitea regression workflow runs Django checks and pytest against isolated PostgreSQL/pgvector and RabbitMQ services, with deterministic AI providers. The browser journey suite covers real application and service workflows while substituting controlled external providers. These tests establish application behaviour; they do not qualify model quality or the real coding runner. Before further decomposition, I intend to extend this foundation with an independent Java acceptance framework.

My professional background includes several years of quality engineering, test automation, QA leadership and delivery management, primarily within financial technology and payment platforms. Working with financial systems, including systems processing ISO 20022 and ISO 8583 messages, taught me the importance of validating not only individual components, but also the interactions between them, particularly when processing involves multiple systems and asynchronous operations.

I want to apply the same principles to ALT. Quality should not be something that is addressed after the architectural work has been completed. It should be an integral part of the migration strategy.

A dedicated Java test automation framework

Although ALT is primarily implemented in Python, I have chosen Java for a proposed additional external test automation framework. The stack below describes that planned framework; it is not implemented in the ALT source repository and will complement the existing Python and Playwright suites.

Technology Responsibility
Java Primary automation language
Spring Boot Dependency injection, configuration and component lifecycle management
Gradle Build and dependency management
REST Assured API testing and response validation
Cucumber Behaviour-driven test scenarios
Selenium Browser-based testing
Spring Data JPA Database entry validation
JUnit Test execution
AssertJ Assertions
Apache Kafka Client Future command and event validation
Java test automation framework
Figure 5. The proposed Java automation framework would validate application behaviour through APIs, browser interfaces, optional database checks and, after Kafka integration, commands and events. View full size

Java was my primary test automation language during my work in fintech, and I have extensive experience with REST Assured and API-level validation. Keeping the framework in a separate project and exercising documented interfaces will make it independent of Django internals; using another language alone does not establish that independence.

The framework will interact with ALT through its exposed interfaces rather than depending directly on Django's internal implementation. Spring will provide dependency injection, configuration management and component lifecycle management. REST Assured will support API testing, Cucumber will provide behaviour-driven test scenarios, and Selenium will cover browser-based workflows.

Spring Data JPA will be used to validate database entries, ensuring that operations performed through application APIs or asynchronous workflows produce the expected persisted data. Database integration will remain optional, depending on the requirements of individual test scenarios.

Test data provisioning for the proposed Java framework will use supported application APIs rather than direct database manipulation. Any missing setup operations will need explicit support before those scenarios can run. Authentication flows will be covered by dedicated test scenarios rather than repeatedly validated as part of unrelated workflows.

Establishing a behavioural baseline

The first objective of the automation framework is to establish a baseline of ALT's existing functionality before significant refactoring begins. Rather than writing tests around the internal structure of the Django application, I intend to describe expected behaviour through business-oriented scenarios.

For example:

Given a student is enrolled in a published course
And an available lesson contains a single-question quiz linked to a learning objective
And the student's mastery evidence for that objective is empty
And the course mastery policy requires two correct answers with 100 percent accuracy
When the student submits a quiz attempt with a correct answer to that question
Then one correct evidence record is stored for that objective
And the objective status is "DEVELOPING"

The internal implementation of this workflow may change considerably during the transition to microservices. Initially, most operations may be performed within the Django application. Later, the same workflow may involve several independent services communicating through Kafka. However, the expected educational outcome should remain consistent.

The automation framework should allow me to verify that consistency throughout the migration. This does not mean that the existing implementation is automatically correct. Expected behaviour needs to be established from the educational requirements, with the existing application evaluated against those requirements. Where the current implementation contains defects, those defects should be addressed rather than preserved as part of the regression baseline.

API and database validation

API-level testing will form a significant part of the automation strategy. The framework will validate application behaviour through API requests, response structures, status codes and business-level assertions.

However, a successful API response does not necessarily guarantee that an operation has produced the expected persisted data. For scenarios where persistence is particularly important, Spring Data JPA will provide the ability to retrieve and validate database entries.

This will be especially useful when validating assessment results, mastery updates, exercise attempts and asynchronous processing outcomes. Database checks will be optional and read-only, using service-owned test adapters and credentials. They will couple those checks to the relevant storage schema, so end-to-end acceptance assertions should prefer public interfaces. As services are extracted, each adapter must respect the new data ownership boundaries.

Testing the distributed architecture

As individual services are extracted, the framework will gradually be extended to validate distributed workflows. This will require more than conventional REST API testing. Additional capabilities will include Kafka producers and consumers, event contract validation, correlation-based event tracking and asynchronous assertions.

I intend to validate scenarios such as:

  • A command is successfully processed when a service node is available.
  • A command remains pending when all compatible nodes are occupied.
  • A queued command is processed when capacity becomes available.
  • A service container can be deployed on demand.
  • A processing node can be restarted without silently losing an assigned workload.
  • Duplicate events do not produce duplicate assessment results.
  • Invalid commands are handled appropriately.
  • A failed spoken exercise service does not prevent unrelated written exercises from being processed.
  • Assessment results remain consistent after a service has been extracted from the monolith.
  • An interrupted workflow can recover without corrupting educational data.

Asynchronous assertions will use bounded waiting mechanisms rather than relying on arbitrary delays. The framework should also provide sufficient diagnostic information when a test fails, including relevant API requests and responses, correlation identifiers, observed events and database validation results.

A failed automated test should help identify the problem rather than simply indicate that something went wrong.

Testing service contracts

Service contracts will become increasingly important as the application is decomposed. A change to an event schema or API response may affect multiple consumers, even if the service introducing the change continues to operate correctly.

Contract validation will therefore cover API request and response structures, Kafka command and event schemas, required execution context, schema version compatibility, error and failure responses, and supported service capabilities.

The objective is to detect incompatible changes before they reach an integrated environment. This will complement, rather than replace, service-level unit tests and integration tests implemented within the individual services.

Performance and resilience testing

Functional correctness alone will not be sufficient to validate the new architecture. One of the main reasons for moving towards dedicated compute pools is to improve scalability and resource management. These improvements need to be measured.

I intend to establish performance baselines covering processing time, command dispatch latency, queue waiting time, container startup time and resource utilisation.

Resilience testing will focus on controlled infrastructure failures, including unavailable nodes, interrupted processing, container restarts and temporary communication failures. The objective is to understand how the system behaves when its assumptions are no longer valid.

It is particularly important to distinguish between a system that is temporarily unable to process additional work and a system that has lost or corrupted that work.

Testing AI-based functionality

AI introduces another challenge: its outputs are not always deterministic. Testing an AI-generated explanation by comparing it against a single expected string would provide limited value.

Instead, I intend to distinguish between deterministic application behaviour and probabilistic AI behaviour. Deterministic validation will cover aspects such as API contracts, access control, event delivery, data integrity, context retrieval under controlled conditions and workflow execution.

AI-specific validation will focus on:

  • Adherence to the requested output structure.
  • Relevance to the learning objective.
  • Grounding in the supplied educational material.
  • Factual consistency.
  • Language requirements.
  • Assessment consistency across controlled examples.
  • Regression detection when models or prompts are changed.

For the RAG pipeline, retrieval quality should also be evaluated independently of the language model's ability to generate an answer. If the relevant educational material is not retrieved, improving the generation prompt may not address the underlying problem.

For spoken exercises, testing will involve reference audio samples and expected transcription or alignment characteristics. The intention is to establish repeatable evaluation datasets rather than relying exclusively on subjective manual evaluation.

Model versions, prompt versions and relevant assessment configurations should be recorded to make evaluation results reproducible where possible. Not every aspect of AI-generated educational feedback can be validated automatically. Teacher review and human evaluation will remain important parts of the quality strategy.

Continuous integration and quality gates

The proposed Java framework will eventually join the existing CI checks. This is an extension of the current Gitea regression workflow, not the introduction of CI testing for the first time. Different levels of testing will be executed depending on the nature of the change.

Fast component and contract tests should provide immediate feedback during development, while broader integration and end-to-end scenarios should validate changes in an integrated environment. Performance, resilience and AI evaluation suites may require dedicated environments and additional execution time.

The objective is not to execute every possible test after every code change. It is to establish appropriate quality gates that provide meaningful feedback without making the development process unnecessarily slow.

6. Migration strategy

I do not intend to rewrite the entire application at once. A complete rewrite would introduce unnecessary risk, particularly given that the existing implementation already provides a foundation for validating educational workflows. Instead, I intend to follow an incremental migration strategy.

Incremental migration roadmap
Figure 6. Proposed incremental migration towards event-driven microservices, extending the existing regression baseline. “Written service” refers to drawing/writing integration. Security and recovery checks apply throughout; the final stage consolidates production-readiness evidence. View full size

Stage 1 — Establish the quality foundation

The first stage will build on the existing Python tests, Playwright journeys and Gitea checks, using the documented user journeys as the behavioural baseline. It will add the proposed Java automation framework where independent API and workflow coverage is useful. This includes establishing test data provisioning mechanisms, API validation, database entry validation and regression coverage for critical educational workflows. The existing implementation will provide the initial system against which these scenarios are executed.

Stage 2 — Introduce the event backbone

The second stage will introduce Apache Kafka, standardised command and event contracts, and the infrastructure required for service-specific load balancing. This stage will also establish the conventions for correlation identifiers, workload state, retries and error handling. The objective is to create a reusable infrastructure foundation before extracting a significant number of services.

Stage 3 — Validate the first Kafka-based workflow

The existing spoken exercise service provides a natural candidate for validating the new infrastructure. Its integration will allow me to evaluate the complete execution lifecycle: command publication, service-specific load balancing, node availability detection, persistent workload queuing, on-demand Podman container deployment, command execution, result publication, educational workflow continuation and failure recovery.

The optional remote drawing/writing service can subsequently be adapted to the same Kafka integration pattern, preserving its existing data ownership and reconciliation guarantees. This should help establish which parts of the infrastructure can be reused across different service types.

Stage 4 — Extract computationally intensive capabilities

Once the deployment, queuing, execution and recovery mechanisms have been validated, other computationally intensive capabilities can be extracted. Potential candidates include document ingestion, embedding generation, AI inference and exercise generation. Each processing capability will have its own service contracts, dedicated load-balancing layer and compute pool.

Stage 5 — Decompose the educational domain

Educational domain services can then be separated gradually, based on their actual responsibilities, dependencies and scaling requirements. Each extraction should be treated as an independently testable architectural change.

The monolith will continue to operate during this transition, with responsibilities gradually moving into independent services. The objective is to evolve the architecture without losing the functionality that justified building the platform in the first place.

Stage 6 — Production-readiness validation

Evaluating production readiness would require replacing the experimental identity provider with an established, production-grade identity management solution. Authentication, authorisation, tenant isolation and access control would form part of the security and automated regression testing strategy.

Additional work would be required in areas such as data protection, backup and recovery, infrastructure security, observability, operational documentation and deployment procedures. Given the nature of student information, educational records and audio recordings, production readiness cannot be evaluated exclusively from a functional perspective.

Conclusion

ALT started as a proof of concept because I wanted to validate an idea before committing to a complex architecture.

The monolithic implementation allowed me to experiment with educational workflows, implement the RAG pipeline and better understand the boundaries between different responsibilities. The optional spoken evaluator, the implemented drawing service extraction path and the disabled-by-default coding service represent the beginning of the platform's architectural evolution.

The proposed next stage would introduce Apache Kafka, dedicated service-specific compute pools, independent workload schedulers and automatic Podman deployment in response to demand. These mechanisms remain to be implemented and validated.

However, the architectural transition itself is only part of the challenge. Ensuring that existing functionality remains reliable throughout the migration is equally important. This is why extending the existing regression suites and developing the proposed independent Java acceptance framework are part of the migration plan.

As a side project, ALT gives me the freedom to experiment with different architectural approaches, evaluate their trade-offs and apply engineering principles in a practical context. It also allows me to build upon my professional experience in test automation and quality engineering while further developing my skills in software architecture, backend development, distributed systems and AI integration.

What makes this project particularly interesting to me is the opportunity to work across the entire engineering lifecycle: understanding the problem, designing the solution, implementing it, validating its behaviour and gradually evolving its architecture as requirements become better understood.

The objective is not to build a distributed system for the sake of building one. It is to understand when architectural complexity is justified, how to introduce it incrementally, and how to maintain quality throughout that process.