Building EmotionalChat: Engineering Emotions into Conversational AI

EmotionalChat is an experimental web application that explores the boundaries of human-AI interaction by integrating emotional variability and contextual awareness into large language model responses. It is a research-driven platform designed to test how users engage with agents that deviate from traditionally "neutral" chatbot behavior, offering instead interactions shaped by emotions like anger, sadness, boredom, and more.

Blog Image
Main interface with conversation history and quick prompts.

Tech Stack & Architecture

The project was architected using a Kubernetes-based infrastructure to ensure scalability and modular deployment. I containerized both the frontend and backend using Docker, and orchestrated everything through a fully automated CI/CD pipeline.

The frontend is built with Nuxt 3, leveraging Vue.js and Tailwind CSS to provide a minimalistic, responsive, and highly interactive user interface. The design emphasizes clarity and emotional expressiveness, aligning with the theme of the project.

On the backend, I used FastAPI, which offers high-performance async APIs and smooth integration with modern Python libraries. The FastAPI server acts as a gateway to a fine-tuned LLaMA model, serving customized conversational agents. Each agent is trained or prompted to respond in ways that reflect specific human emotions or non-standard communication patterns.

Blog Image
Login screen with OAuth and email sign-in options.

Goals, Emotion Design, and User Experience

The core objective of EmotionalChat is to design agents that interact in unconventional yet emotionally familiar ways. These agents express emotions like anger, boredom, or sadness—styles rarely explored in AI—opening new ground for testing how humans perceive, interpret, and emotionally engage with non-neutral AI systems.

To provide contextual depth and prevent generic outputs, the system integrates Retrieval-Augmented Generation (RAG). These models dynamically pull relevant data from external knowledge sources and feed it to the language model during runtime, producing responses that are grounded, accurate, and scenario-aware.

In EmotionalChat, RAGs ground conversations in realistic contexts (e.g., therapy or work), reduce hallucinations, maintain consistent emotional tone, and personalize interactions based on user context. This combination of emotion-driven design and RAG-enhanced grounding results in a powerful, research-ready tool for affective computing and HCI.

Use Cases & Research Intent

The app is designed as a tool for research, both in HCI and affective computing. It can help answer questions like:

  • How do users react to emotionally expressive AI?
  • Can emotional variability increase engagement, empathy, or trust?
  • What ethical concerns arise when AI mimics frustration, boredom, or sadness?

Ultimately, EmotionalChat aims to bridge computational efficiency with emotional depth, offering a platform where engineers, researchers, and users alike can explore new dimensions of human-machine communication.