Home Articles Resume Nala Project
ES EN

How Nala is built: architecture, safety, and a layered AI system

Nala technical architecture with safety layers, personalization, and conversational flow

After explaining what Nala is and why it makes sense as a product, the technical side deserves its own space.

It also helps to remember what the acronym stands for: Natural Adaptive Language Assistant. That idea of language, adaptation, and guided assistance is deeply reflected in how the system is architected.

Because Nala is not designed as a generic chat for children, but as a guided conversational system where every product decision also depends on a very specific architecture.

It is not an open chatbot

The starting point matters: Nala does not behave like a free-form, unpredictable chat governed by one giant prompt.

Its behavior is constrained by design. Every interaction goes through prior logic that tries to understand what the child needs and what kind of response is appropriate before any text is generated.

The goal is not to impress with a "creative" AI, but to build an experience that is stable, brief, understandable, and safe.

The stack behind it

The web application runs on Next.js 15 and React 19.

The conversational core lives in its own package called nala-ai-api, built with Genkit 1.33 and OpenAI models.

That separation helps preserve something important: the child-facing interface, the product logic, and the conversational orchestration do not end up mixed into a single layer that is hard to evolve.

A layered system on every turn

Each child message is not sent straight to the model just to "see what it says."

Before that, Nala moves through several stages:

  • intent detection
  • safety evaluation
  • context or tool retrieval when needed
  • generation of an adapted response
  • summarized memory to preserve continuity without storing sensitive information

In practice, this means the system tries to distinguish whether the child wants to play, talk, ask for help, follow a routine, regulate themselves, or simply ask a question.

The final response does not come only from the model. It comes from the combination of profile, context, limits, detected intent, and safety rules.

Structured personalization, not decorative personalization

One of the most important aspects of Nala is that personalization is not treated as a superficial layer.

Each child profile can define:

  • specific interests
  • conversational tone
  • response length
  • visible or disabled games
  • calming strategies
  • limits defined by the family

From the outside, that may look like simple configuration. Technically, it is a way to constrain the system and make it more useful.

The point is not just to make the AI "sound different." The point is to make it respond inside a clear and adapted framework.

Safety designed from the ground up

When a tool interacts with children, safety cannot depend on a single model inference.

That is why Nala includes several protection layers:

  • deterministic filters before the model is called
  • blocked topics defined by the family
  • tool interruption when a turn is not safe
  • escalation to an adult when a risky situation appears
  • short, controlled, and sanitized responses before anything reaches the client
  • memory designed to reject sensitive data

This reduces improvisation, limits ambiguity, and prevents everything from depending on one probabilistic answer.

Local tools and clear limits

Another important point is what Nala does not do.

Its internal tools do not execute external actions. They do not send messages, buy anything, trigger calendars, or connect to third-party services.

They operate in a controlled environment focused on context, memory, and local activities.

That greatly simplifies the risk surface and makes the system easier to reason about, audit, and constrain.

Useful memory without turning it into a black box

For a conversational experience to feel continuous, some memory is necessary.

But in Nala that memory is not designed to accumulate sensitive information or build an opaque history that is impossible to review.

The idea is to keep just enough summarized context to preserve continuity between turns without turning the system into a repository of delicate data.

Why this architecture matters

The technical side here is not a secondary detail.

In a children's product, architecture, safety, and user experience are tightly connected. If the technical foundation is weak, the experience stops being predictable. And if it stops being predictable, it also stops being appropriate for many children and many families.

That is why Nala is not trying to answer everything. It is trying to answer well inside a clear framework.

In summary

Nala is built as a guided conversational AI with explicit layers of intent, context, personalization, and safety.

It is not trying to appear more open. It is trying to be more useful, more governable, and calmer to use.

In a children's environment, that technical difference is not minor. It is exactly what makes the product meaningful.

#AI for Children#Software Architecture#Next.js#React#Genkit#OpenAI#AI Safety

Alex Sanz

I build products and systems where architecture, business needs, and AI become real, reliable, and maintainable capabilities.

Related articles

View all
013 min

A small model as the first stop

With Laya and Jev, something happened to me that hadn't happened with a model in a long time. I thought: this is exactly what I was trying to achieve. In our Gateway, we had set up…

024 min

ADRs: memory for humans and context for agents

A few years ago, during my time at Santander Bank, we started using Architecture Decision Records (ADRs) to keep track of certain architectural decisions: what had been decided, wh…