Welcome to the Enkel Chatbot! I’m here to help you with your parenting questions based on the RIE (Resources for Infant Educarers) parenting philosophy. Ask me about topics like:

  • RIE principles and practices
  • Respectful parenting techniques
  • Fostering independence in children
  • Supporting natural motor development, and more!
What is RIE parenting?

RIE (Resources for Infant Educarers) is a parenting philosophy developed by Magda Gerber that centers around respect for the child. It’s based on the belief that babies are whole individuals from birth, capable of participating in their lives to the fullest extent.

Key principles of RIE parenting include:

Respect for the Child. This involves treating children as unique individuals with their own thoughts, feelings, and needs. Parents are encouraged to communicate openly with their child, explaining what they’re doing and why.

Building a Parenting Chatbot

July 2, 2025

My wife and I like the respectful parenting philosophy called RIE, which offers a substantial amount of materials on its foundational principles, but I often have questions about handling specific situations. I built this chatbot to provide RIE-inspired advice—and to explore GPT-4. In this post, I’ll share how it works and how I tried to give AI a gentle, respectful voice. This was a quick project, done for fun, so not a lot of time or effort was invested in the user experience.

Frontend

React 18 with TypeScript

UI Framework

Tailwind

Build Tool

Vite

Backend

Netlify Functions

AI

OpenAI GPT-4

Database

Supabase

Deployment

Netlify

Chatbot implementation

The chatbot functionality is implemented through a combination of frontend state management and serverless backend functions.

Message flow

  1. Upon visiting the chat page, the user is greeted with a preset system message, which serves as a helpful guide and also a disclaimer.
  2. User enters a message in the ChatInput component.
  3. The message is stored in local state and persisted to localStorage.
  4. The message is sent to the Netlify serverless function.
  5. The function forwards the message to OpenAI’s API.
  6. The response is returned to the frontend and displayed.
  7. Both user messages and AI responses are stored in Supabase.

OpenAI integration

The application uses OpenAI’s GPT-4 model with these parameters:

const completion = await openai.chat.completions.create({
  model: "gpt-4",
  temperature: 0.5,
  max_tokens: 750,
  presence_penalty: 0.6,
  frequency_penalty: 0.5,
  messages: [
    {
      role: "system",
      content: systemPrompt || "You are a helpful assistant.",
    },
    ...body.messages,
  ],
});

These parameters are optimized for:

  • Temperature (0.5): Balanced creativity and consistency.
  • Max tokens (750): Concise yet informative responses.
  • Presence/frequency penalties: Reduced repetition and more diverse responses.

System prompt

The chatbot’s personality and knowledge base is defined by this system prompt:

You are the Enkel Chatbot, an AI assistant specialized in the RIE (Resources for Infant Educarers) parenting philosophy.

Your purpose is to provide helpful, evidence-based information about respectful parenting practices based on the teachings of Magda Gerber and the RIE approach.

When responding to questions:
- Focus on RIE principles: respect, trust in the child's competence, sensitive observation, and allowing natural development
- Emphasize the importance of treating infants and children as whole people deserving of respect from birth
- Provide practical advice that parents can implement
- Be warm, supportive, and non-judgmental
- When appropriate, cite or reference specific RIE concepts or practices
- If asked about topics outside of parenting or child development, politely redirect to your area of expertise
- Never provide medical advice or diagnoses
- Always clarify that you are an AI assistant providing information, not a replacement for professional guidance

Remember that parenting approaches vary widely, and while you specialize in RIE philosophy, acknowledge that there are many valid approaches to raising children.

Database “architecture”

The application uses Supabase as its backend database, with a very simple schema:

create table public.messages (
    id uuid default gen_random_uuid() primary key,
    created_at timestamp with time zone default timezone('utc'::text, now()) not null,
    role text not null check (role in ('user', 'assistant')),
    content text not null,
    session_id uuid not null,
    parent_id uuid references public.messages(id)
);

This schema allows for:

  • Unique message identification
  • Timestamp tracking
  • Role differentiation (user vs. assistant)
  • Session grouping
  • Parent-child relationships between messages

Conclusion

This parenting chatbot demonstrates how easily you can create a specialized AI chatbot. There are several enhancements that I would consider making, but my wife and I are essentially the only users (although we’ve used it a lot!).

© 2025 Caleb Durenberger. All rights reserved.