Overview01
An AI assistant for kids' education has to work every time. A student who gets an error or a garbled answer usually doesn't try again.
The Kigumi Group builds KiguLab, a digital wellbeing and AI-ethics curriculum for ages 8–21. It covers digital wellbeing, critical thinking, ethical AI companionship, cyber resilience and privacy, through short "edutainment" lessons in English, Thai and Chinese, with AI tutors that teach alongside human coaches. I worked on the backend behind the AI assistant.
- 01
Increased code coverage from 90% to 98% and resolved recurring AI assistant pipeline failures caused by unstable backend connections and malformed query formulation to the image-generation and GPT models. I did this by writing unit and integration tests and diagnosing issues through targeted debugging, which improved reliability and response consistency.

Fixing the AI assistant pipeline02
The assistant takes a learner's message, builds a query, and sends it to either a GPT model for text or an image-generation model for pictures. Failures kept coming back, and they came from two different places:
Two failure classes that looked alike from outside, with two different fixes.
1 · Unstable backend connections
Some model calls dropped or stalled because the connection between the backend and the model services wasn't reliable. To the learner this looked random: the same question would work once and fail the next time.
2 · Malformed query formulation
Other failures came from the request itself. Queries to the GPT and image models were sometimes put together wrongly, so the model got a bad request and either errored or answered inconsistently.
Why did the assistant only fail some of the time?
Two separate causes: unstable backend connections, and malformed queries sent to the GPT and image models.
Same symptom, different bugs. Sneaky.
How I fixed them
- Targeted debugging to separate the two failure classes, since they looked alike from the outside but needed different fixes.
- Integration tests that exercise the real request path to the models, so connection and request-shape problems show up in testing instead of in front of a student.
- Unit tests on how queries are formed, so a malformed request is caught by a test before it ships.
The result was fewer pipeline failures and more consistent responses from the assistant.

This is the assistant whose pipeline I fixed.
From 90% to 98% coverage03
Coverage was already 90%, and the last 10% is usually the hardest: error paths, edge cases, and code that talks to external services. That's also where the pipeline bugs were.
Coverage from 90% to 98%: the hardest 8%.
- Unit tests for backend logic in isolation, including how queries to the models are built.
- Integration tests for the joins between components, where unstable connections and bad requests actually fail.
- The failures I diagnosed were pinned down by tests, which guards against regressions.