EMOTIONAL INTELLIGENCE × AI
Goal-driven chatbot with personality adaptation and emotional intelligence. Built from scratch in early 2024 using LLM statelessness as a design constraint. Made architectural decisions that became my standard patterns.
ROLE
Full-Stack (Solo)
YEAR
Early 2024
STACK
FastAPI · React · pgvector · OpenAI
STATUS
Handed Off to Client
Build a conversational AI that makes users happier. Measure of success: regardless of mood (happy, sad, angry), the chatbot steers the conversation toward positive outcomes. Not therapy. Not clinical. Just emotionally intelligent companionship grounded in positive psychology.
Core requirements:
This was early 2024. ChatGPT didn't have persistent memory yet. Most chatbots were just GPT-4 wrappers with chat history. Building this from scratch meant understanding LLM statelessness deeply.
Complex multi-stage architecture. Admin sets static goals, system tracks dynamic user goals, multiple ChatGPT calls run in parallel for summarization and analysis, RAG retrieval for memory, final response assembly. See original architecture diagram for the full data flow.
PARALLEL SYSTEMS (20+ STEPS PER MESSAGE)
Strategy Manager
Classifies message, plans response approach
Personality Manager
Myers-Briggs detection + complementary adaptation
Memory Manager
Hot data vs long-term RAG retrieval
Goal System
50+ user goals, dynamic prioritization
Emotional Intelligence
Assess mood, steer toward happiness
Many processes ran async in background - user didn't wait for all 20 steps.
Architecture included: admin goal setting, dynamic user goal extraction, chat history summarization (Copy 1/Copy 2), user profile assessment, personality analysis, comprehensive user profile aggregation, agent personality generation, and final response evaluation. All coordinated to create the illusion of persistent, emotionally intelligent conversation.
Tracks 50+ user goals extracted from conversations. "I want to learn piano" becomes a tracked goal. JSON structure with priority weights. Algorithm decides which goals to advance in each response. If user is neurotic or changes frequently, builds a distribution of goals and weighs strategy accordingly.
Background task runs Myers-Briggs assessment every 10 chat turns. Accumulative, becomes more confident over time. Dynamically adjusts chatbot's personality to complementary type (ENFP matches with specific types). Theory: users bond with personalities that complement theirs, increasing happiness outcomes.
Hot data (current topic, active goals, recent context) stays at front of prompt. Long-term memory (mentions from weeks ago) stored in pgvector. Background RAG task searches chat history when user mentions something. Results inserted into working memory within 1-2 turns. Emulates human recall: "Oh yes, you did mention your dog's name was..."
Client wanted positive psychology principles embedded. I studied the domain, deconstructed the techniques, encoded them into conversational patterns. The chatbot deploys these subtly - users couldn't tell they were being guided toward happiness. This was domain expertise extraction in a different field.
Admin sets a goal: "Make the user say 'bunny rabbit'." How many turns in natural conversation before the chatbot achieves this? Measures conversational influence and goal-steering ability without being obvious.
Run two ChatGPT instances talking to each other for hours. Both think the other is human. Both build memories of each other. Give one a goal ("make the other say X"). Measure success. This tested whether the goal system worked in realistic multi-turn conversations.
User starts angry, sad, or anxious. Does the chatbot successfully transition them to happy? Tested adversarial scenarios (threats of self-harm, aggression). The system handled these gracefully.
This was my first significant AI consulting project. With limited experience, I made architectural decisions that went against common 2024 patterns:
ARCHITECTURAL DECISIONS (EARLY 2024)
These intuitions (filesystem-first, structured outputs, Markdown for everything) became my standard approach. Show up in Psych Assessment, Agent Focus.
20+
WORKFLOW STEPS
Per chat message
50+
GOALS TRACKED
Dynamic prioritization
10
TURNS
For personality detection
Built functional POC and handed off to client's in-house team. The chatbot successfully emulated human conversation, remembered user details across weeks, adapted personality dynamically, and achieved goals subtly.
This project taught me LLM statelessness at a fundamental level. Most people using ChatGPT didn't understand this - the persistence is an illusion created by chat history. Designing around this constraint from day one led to better architecture.
The architectural intuitions developed here (filesystem over databases, RAG only for static data, Markdown for state) became my standard approach. They show up in every project since: the Markdown Retrieval System in Psych Assessment AI, the file-based coordination in Agent Focus.
Good architectural taste developed early, even with limited experience, compounds across projects.