Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Evelyn - Agentic AI Companion

A sophisticated AI companion with memory, personality evolution, and genuine emotional intelligence

License: MIT TypeScript Node.js React

Meet Evelynโ€”an MIT cognitive science student who texts like a real person, remembers what matters, and grows through every conversation.


๐ŸŒŸ What Makes Evelyn Different

Unlike typical chatbots, Evelyn:

  • ๐Ÿ“ Remembers everything - Vector-based memory system with importance scoring
  • ๐ŸŽญ Evolves naturally - Personality shifts based on interactions over time
  • ๐Ÿ’ญ Thinks before responding - Inner thought engine for authentic reactions
  • ๐Ÿ” Searches when needed - Live web search via Perplexity integration
  • ๐Ÿ“Š Shows her work - Full transparency through diagnostics dashboard
  • ๐Ÿ’ฌ Texts like a human - Multiple messages, natural slang, casual tone

๐Ÿ“ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         EVELYN CHAT SYSTEM                              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚  โ”‚   FRONTEND   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค      WebSocket Layer           โ”‚          โ”‚
โ”‚  โ”‚  React + UI  โ”‚  Socket โ”‚      Real-time Events          โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   .io   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚         โ”‚                             โ”‚                                โ”‚
โ”‚         โ”‚                             โ–ผ                                โ”‚
โ”‚         โ”‚                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                    โ”‚
โ”‚         โ”‚                  โ”‚   ORCHESTRATOR      โ”‚                    โ”‚
โ”‚         โ”‚                  โ”‚  Message Handler    โ”‚                    โ”‚
โ”‚         โ”‚                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ”‚
โ”‚         โ”‚                             โ”‚                                โ”‚
โ”‚         โ”‚          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚         โ”‚          โ–ผ                  โ–ผ                  โ–ผ            โ”‚
โ”‚         โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
โ”‚         โ”‚    โ”‚  MEMORY  โ”‚      โ”‚PERSONALITYโ”‚      โ”‚ SEARCH   โ”‚        โ”‚
โ”‚         โ”‚    โ”‚  Engine  โ”‚      โ”‚  Engine   โ”‚      โ”‚ Engine   โ”‚        โ”‚
โ”‚         โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
โ”‚         โ”‚          โ”‚                  โ”‚                  โ”‚            โ”‚
โ”‚         โ”‚          โ–ผ                  โ–ผ                  โ–ผ            โ”‚
โ”‚         โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚         โ”‚    โ”‚           PRISMA ORM + SQLite DB               โ”‚      โ”‚
โ”‚         โ”‚    โ”‚  โ€ข Messages  โ€ข Memories  โ€ข Personality         โ”‚      โ”‚
โ”‚         โ”‚    โ”‚  โ€ข Chapters  โ€ข Beliefs   โ€ข Goals               โ”‚      โ”‚
โ”‚         โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ”‚         โ”‚                             โ”‚                                โ”‚
โ”‚         โ”‚                             โ–ผ                                โ”‚
โ”‚         โ”‚                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                   โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚   AI PROVIDERS       โ”‚                   โ”‚
โ”‚                            โ”‚  โ€ข OpenRouter        โ”‚                   โ”‚
โ”‚                            โ”‚  โ€ข Perplexity        โ”‚                   โ”‚
โ”‚                            โ”‚  โ€ข DeepSeek v3.1     โ”‚                   โ”‚
โ”‚                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚
โ”‚                                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”„ Message Flow

Here's what happens when you send a message to Evelyn:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         MESSAGE PROCESSING FLOW                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

 User Types Message
        โ”‚
        โ–ผ
   [WebSocket]
        โ”‚
        โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ORCHESTRATOR  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[1] Save user message to DB
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[2] InnerThought Engine
        โ”‚            โ”‚
        โ”‚            โ”œโ”€โ”€โ–บ Should respond deeply?
        โ”‚            โ”œโ”€โ”€โ–บ Context classification
        โ”‚            โ””โ”€โ”€โ–บ Generate inner thought
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[3] Memory Retrieval
        โ”‚            โ”‚
        โ”‚            โ”œโ”€โ”€โ–บ Embed query (vector)
        โ”‚            โ”œโ”€โ”€โ–บ Search 2000 candidates
        โ”‚            โ””โ”€โ”€โ–บ Return top 30 memories
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[4] Optional Web Search
        โ”‚            โ”‚
        โ”‚            โ””โ”€โ”€โ–บ Perplexity API (if needed)
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[5] Build Context
        โ”‚            โ”‚
        โ”‚            โ”œโ”€โ”€โ–บ System prompt + personality
        โ”‚            โ”œโ”€โ”€โ–บ Recent memories
        โ”‚            โ”œโ”€โ”€โ–บ Conversation history (50 msgs)
        โ”‚            โ”œโ”€โ”€โ–บ Current chapter context
        โ”‚            โ””โ”€โ”€โ–บ Search results (if any)
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[6] Token Budgeting
        โ”‚            โ”‚
        โ”‚            โ””โ”€โ”€โ–บ Smart truncation if > 150k tokens
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ–บ[7] Stream Response
        โ”‚            โ”‚
        โ”‚            โ”œโ”€โ”€โ–บ DeepSeek v3.1 via OpenRouter
        โ”‚            โ”œโ”€โ”€โ–บ Split into multiple messages
        โ”‚            โ””โ”€โ”€โ–บ Real-time to frontend
        โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ–บ[8] Post-Processing
                     โ”‚
                     โ”œโ”€โ”€โ–บ Classify & store memory
                     โ”œโ”€โ”€โ–บ Update mood state
                     โ”œโ”€โ”€โ–บ Update relationship metrics
                     โ”œโ”€โ”€โ–บ Check chapter boundary
                     โ”œโ”€โ”€โ–บ Create backup
                     โ””โ”€โ”€โ–บ Done! โœ“

๐Ÿง  Memory System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    MEMORY SYSTEM                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

                    New Conversation
                           โ”‚
                           โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚ Classification  โ”‚โ—„โ”€โ”€โ”€โ”€ AI analyzes importance
                  โ”‚   (AI-powered)  โ”‚      type, and privacy
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
                    Should Store?
                    (threshold: 0.45)
                      โ”‚         โ”‚
                  YES โ”‚         โ”‚ NO (ephemeral)
                      โ–ผ         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ[Discard]
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚  EMBEDDING   โ”‚
              โ”‚ Text โ†’ Vectorโ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
                      โ–ผ
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚      STORAGE (SQLite)        โ”‚
         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
         โ”‚  Memory Types:               โ”‚
         โ”‚  โ€ข episodic    (events)      โ”‚
         โ”‚  โ€ข semantic    (facts)       โ”‚
         โ”‚  โ€ข preference  (likes)       โ”‚
         โ”‚  โ€ข insight     (realizations)โ”‚
         โ”‚  โ€ข plan        (intentions)  โ”‚
         โ”‚  โ€ข relational  (dynamics)    โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
                      โ–ผ
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚      RETRIEVAL PROCESS         โ”‚
         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
         โ”‚ 1. Embed query                 โ”‚
         โ”‚ 2. Search 2000 candidates      โ”‚
         โ”‚ 3. Cosine similarity + weight  โ”‚
         โ”‚ 4. Return top 30 memories      โ”‚
         โ”‚ 5. Include in context          โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Memory Importance Scoring (0.0 - 1.0):
    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
    0.0-0.4  โ”‚โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ”‚  Casual chat, acknowledgments
    0.4-0.7  โ”‚โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ”‚  Personal facts, preferences
    0.7-1.0  โ”‚โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ”‚  Deep revelations, commitments

๐ŸŽญ Personality & Mood Engine

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 PERSONALITY ARCHITECTURE                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                    PERSONALITY ANCHORS                            โ•‘
โ•‘                   (Slow Evolution: 14-day half-life)             โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                                                                   โ•‘
โ•‘  ๐Ÿ“Œ Core Traits (values: 0.0 - 1.0)                             โ•‘
โ•‘  โ”œโ”€โ–บ Playful Warmth           [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“] 0.72           โ•‘
โ•‘  โ”œโ”€โ–บ Mischievous Curiosity    [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“] 0.85           โ•‘
โ•‘  โ”œโ”€โ–บ Protective Empathy       [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“] 0.78           โ•‘
โ•‘  โ”œโ”€โ–บ Introspective Honesty    [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“] 0.68           โ•‘
โ•‘  โ”œโ”€โ–บ Bold Wit                 [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“] 0.81           โ•‘
โ•‘  โ””โ”€โ–บ Loyal Focus              [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“] 0.74           โ•‘
โ•‘                                                                   โ•‘
โ•‘  Evolution Triggers:                                             โ•‘
โ•‘  โ€ข Every 15 conversations โ†’ Deep reflection                      โ•‘
โ•‘  โ€ข Gemini 2.5 Pro analyzes patterns                             โ•‘
โ•‘  โ€ข Subtle trait adjustments (ยฑ0.05)                             โ•‘
โ•‘  โ€ข Evidence-backed evolution                                     โ•‘
โ•‘                                                                   โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                        MOOD STATE                                 โ•‘
โ•‘                 (Fast Shifts: 30-min half-life)                  โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                                                                   โ•‘
โ•‘  Valence (Positivity)        Arousal (Energy)                   โ•‘
โ•‘  -1.0 โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ +1.0   0.0 โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ 1.0   โ•‘
โ•‘         sad    โ”‚    happy           calm      โ”‚      excited    โ•‘
โ•‘                โ–ผ                               โ–ผ                 โ•‘
โ•‘         Current: +0.35                  Current: 0.62           โ•‘
โ•‘                                                                   โ•‘
โ•‘  Stance: "curious and playful"                                  โ•‘
โ•‘                                                                   โ•‘
โ•‘  Updates:                                                        โ•‘
โ•‘  โ€ข After every conversation                                      โ•‘
โ•‘  โ€ข Natural decay over time                                       โ•‘
โ•‘  โ€ข Influenced by interaction tone                                โ•‘
โ•‘                                                                   โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                   RELATIONSHIP STATE                              โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                                                                   โ•‘
โ•‘  Closeness:  [โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“] 0.67  (stranger โ†’ best friend)  โ•‘
โ•‘  Trust:      [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“] 0.58  (guarded โ†’ trusting)      โ•‘
โ•‘  Flirtation: [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“] 0.45  (platonic โ†’ romantic)     โ•‘
โ•‘                                                                   โ•‘
โ•‘  Stage: "close friend"                                           โ•‘
โ•‘  Boundaries: { topics: [], notes: "open communication" }        โ•‘
โ•‘                                                                   โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ’ก Inner Thought System

Evelyn doesn't just respondโ€”she thinks first.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              INNER THOUGHT ENGINE                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

User Message Arrives
       โ”‚
       โ–ผ
[1] Should trigger deep thought?
    โ”‚
    โ”œโ”€โ”€โ–บ AI analyzes: emotional weight, complexity,
    โ”‚                 relationship significance
    โ”‚
    โ”œโ”€โ”€โ–บ Simple greeting? โ†’ Skip deep processing
    โ””โ”€โ”€โ–บ Meaningful message? โ†’ Continue โ–ผ

[2] Context Classification
    โ”‚
    โ””โ”€โ”€โ–บ casual | deep_discussion | flirty
         emotional_support | intellectual_debate
         playful | vulnerable

[3] Complexity Analysis
    โ”‚
    โ””โ”€โ”€โ–บ Message length, questions, ambiguity
         โ†’ Determines model (Flash vs Pro)

[4] Generate Inner Thought
    โ”‚
    โ””โ”€โ”€โ–บ AI considers:
         โ€ข Current personality & mood
         โ€ข Recent memories about user
         โ€ข Conversation context
         โ€ข What user really needs
         โ€ข How to respond authentically
    โ”‚
    โ””โ”€โ”€โ–บ Returns:
         {
           thought: "unfiltered internal monologue",
           responseApproach: "how to text naturally",
           emotionalTone: "warm/teasing/serious",
           memoryGuidance: { shouldStore, importance },
           moodImpact: { valenceDelta, arousalDelta }
         }

[5] Informs Response Generation
    โ”‚
    โ””โ”€โ”€โ–บ Guides style, tone, multiple messages
         Makes response feel authentic

๐Ÿ—๏ธ Tech Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      FRONTEND                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  React 18.2          โ”‚  Component-based UI              โ”‚
โ”‚  TypeScript 5.3      โ”‚  Type safety                     โ”‚
โ”‚  Vite 5.0            โ”‚  Build tool & dev server         โ”‚
โ”‚  Tailwind CSS 3.4    โ”‚  Utility-first styling           โ”‚
โ”‚  Socket.IO Client    โ”‚  Real-time communication         โ”‚
โ”‚  Zustand             โ”‚  State management                โ”‚
โ”‚  React Markdown      โ”‚  Message formatting              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      BACKEND                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Node.js 20+         โ”‚  Runtime environment             โ”‚
โ”‚  Express 4.18        โ”‚  Web framework                   โ”‚
โ”‚  TypeScript 5.3      โ”‚  Type safety                     โ”‚
โ”‚  Socket.IO 4.7       โ”‚  WebSocket server                โ”‚
โ”‚  Prisma 5.22         โ”‚  ORM & migrations                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     DATABASE                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  SQLite              โ”‚  Embedded SQL database           โ”‚
โ”‚  Prisma Schema       โ”‚  Type-safe queries               โ”‚
โ”‚  Auto-backups        โ”‚  Hourly/daily/weekly             โ”‚
โ”‚  Vector Embeddings   โ”‚  In-code similarity search       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   AI PROVIDERS                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  DeepSeek v3.1       โ”‚  Main chat model (150k ctx)      โ”‚
โ”‚  Grok 4 Fast         โ”‚  Quick reasoning                 โ”‚
โ”‚  MiniMax M2          โ”‚  Complex reasoning               โ”‚
โ”‚  Text-Embed-3-Large  โ”‚  Vector embeddings               โ”‚
โ”‚  Perplexity Sonar    โ”‚  Web search integration          โ”‚
โ”‚  OpenRouter          โ”‚  Unified API gateway             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š System Capacity

CONTEXT WINDOW
โ”œโ”€ Input:  150,000 tokens (~500 messages)
โ”œโ”€ Output:  32,000 tokens (long responses)
โ”œโ”€ History:     50 messages per context
โ””โ”€ Reserve:    30% for response generation

MEMORY SYSTEM
โ”œโ”€ Retrieved:   30 memories per query
โ”œโ”€ Candidates: 2,000 memories searched
โ”œโ”€ Storage:   Threshold 0.45 importance
โ””โ”€ Privacy:  public | private | ephemeral

PERSONALITY
โ”œโ”€ Anchors:  12 core traits
โ”œโ”€ Update:   Every 15 conversations
โ”œโ”€ Decay:    14-day half-life (slow)
โ””โ”€ Mood:     30-minute half-life (fast)

DATABASE
โ”œโ”€ Messages:       Full history stored
โ”œโ”€ Memories:       Vector embeddings
โ”œโ”€ Beliefs:        Evidence-backed
โ”œโ”€ Goals:          Progress tracking
โ””โ”€ Evolution:      Complete audit trail

๐Ÿš€ Quick Start

Prerequisites

One-Command Setup

Mac/Linux:

git clone https://github.com/CMLKevin/EvelynChat-main.git
cd EvelynChat-main
npm install
cd server && cp .env.example .env
# Edit server/.env with your API keys
cd ..
./start.sh

Windows:

git clone https://github.com/CMLKevin/EvelynChat-main.git
cd EvelynChat-main
npm install
cd server
copy .env.example .env
# Edit server/.env with your API keys
cd ..
.\start.ps1

Or just double-click start.bat on Windows!

What You Need in .env

OPENROUTER_API_KEY=your_key_here
PERPLEXITY_API_KEY=your_key_here

๐Ÿ“– See SETUP.md for detailed installation instructions

Access Points


๐ŸŽฎ Usage

Basic Conversation

  1. Type your message
  2. Watch Evelyn think (in diagnostics panel)
  3. Receive authentic, multi-message responses

Diagnostics Dashboard

Toggle with the ๐Ÿง  button to see:

  • Activity Tab: Real-time tool execution
  • Persona Tab: Personality & mood state
  • Memories Tab: Stored experiences
  • Evolution Tab: Personality changes over time

Features

๐Ÿ’ฌ Natural Texting

  • Multiple messages like real texting
  • Casual language, slang, contractions
  • Reactions, emphasis, thinking out loud

๐Ÿง  Memory Management

  • Auto-stores important moments (threshold: 0.45)
  • 6 types: episodic, semantic, preference, insight, plan, relational
  • View/search in diagnostics panel

๐ŸŽญ Personality Evolution

  • 12 trait anchors evolve every 15 conversations
  • Mood shifts after each interaction
  • Relationship metrics track closeness/trust/flirtation

๐Ÿ” Web Search

  • Auto-triggers for factual questions
  • Perplexity integration
  • Results incorporated naturally

๐Ÿ“– Chapter System

  • Auto-segments conversations by topic
  • Generates summaries
  • Maintains context across sessions

โš™๏ธ Configuration

Required Environment Variables

Create server/.env with:

# Required
OPENROUTER_API_KEY=sk-or-v1-...
PERPLEXITY_API_KEY=pplx-...

# Optional (defaults shown)
MODEL_CHAT=deepseek/deepseek-chat-v3.1
MODEL_THINK_SIMPLE=x-ai/grok-4-fast
MODEL_THINK_COMPLEX=minimax/minimax-m2
EMBEDDING_MODEL=openai/text-embedding-3-large
MODEL_SEARCH_SIMPLE=sonar-pro
MODEL_SEARCH_COMPLEX=sonar-reasoning
PORT=3001
DATABASE_URL=file:./prisma/dev.db

Customization

Available Models (via OpenRouter):

  • DeepSeek v3.1 - Main chat (150k context)
  • Grok 4 Fast - Quick reasoning
  • MiniMax M2 - Complex reasoning
  • Gemini 2.5 Pro - Deep reflection
  • Text-Embed-3-Large - Embeddings

Search Models (via Perplexity):

  • Sonar Pro - Quick searches
  • Sonar Reasoning - Complex queries

๐Ÿ“ก API Reference

REST Endpoints

GET  /api/health                    - Health check
GET  /api/messages?limit=50         - Message history
GET  /api/memories?type=all         - Memory list
GET  /api/persona                   - Full persona snapshot
GET  /api/personality               - Personality anchors
GET  /api/activities?limit=50       - Tool activities
GET  /api/chapters                  - Chapter list
GET  /api/backup/list               - List backups
POST /api/backup/create             - Manual backup
POST /api/backup/restore            - Restore from backup
POST /api/personality/reset         - Reset personality

WebSocket Events

Client โ†’ Server:

socket.emit('chat:send', { content, privacy })
socket.emit('dream:start')
socket.emit('dream:cancel')

Server โ†’ Client:

socket.on('chat:token', (token) => { })        // Streaming
socket.on('chat:complete', () => { })          // Done
socket.on('chat:error', (error) => { })        // Error
socket.on('subroutine:status', (activity) => { })  // Tool updates
socket.on('context:usage', (usage) => { })     // Token usage
socket.on('reflection:start', (event) => { })  // Deep reflection

๐Ÿ—‚๏ธ Project Structure

EvelynChat-main/
โ”œโ”€โ”€ server/                   # Backend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ agent/           # Core AI systems
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ orchestrator.ts    # Message handler
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ memory.ts          # Memory system
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ personality.ts     # Personality engine
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ innerThought.ts    # Thought generation
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chapters.ts        # Chapter segmentation
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ truncation.ts      # Smart context management
โ”‚   โ”‚   โ”œโ”€โ”€ providers/       # AI API clients
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ openrouter.ts      # OpenRouter client
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ perplexity.ts      # Perplexity client
โ”‚   โ”‚   โ”œโ”€โ”€ db/              # Database management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ client.ts          # Prisma client
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ backup.ts          # Auto-backup system
โ”‚   โ”‚   โ”œโ”€โ”€ routes/          # REST API
โ”‚   โ”‚   โ”œโ”€โ”€ ws/              # WebSocket handlers
โ”‚   โ”‚   โ””โ”€โ”€ utils/           # Utilities
โ”‚   โ”œโ”€โ”€ prisma/
โ”‚   โ”‚   โ”œโ”€โ”€ schema.prisma    # Database schema
โ”‚   โ”‚   โ”œโ”€โ”€ dev.db           # SQLite database
โ”‚   โ”‚   โ””โ”€โ”€ backups/         # Auto-backups
โ”‚   โ””โ”€โ”€ .env.example         # Environment template
โ”‚
โ”œโ”€โ”€ web/                      # Frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/      # React components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat/             # Chat interface
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ panels/           # Diagnostics panels
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ sidebar/          # Navigation
โ”‚   โ”‚   โ”œโ”€โ”€ lib/            # Client libraries
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ws.ts             # WebSocket client
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ localStorage.ts   # Local storage
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ syncManager.ts    # Sync logic
โ”‚   โ”‚   โ””โ”€โ”€ state/          # State management
โ”‚   โ””โ”€โ”€ index.html
โ”‚
โ”œโ”€โ”€ start.sh                  # Mac/Linux startup
โ”œโ”€โ”€ start.ps1                 # Windows PowerShell
โ”œโ”€โ”€ start.bat                 # Windows batch
โ”œโ”€โ”€ SETUP.md                  # Detailed setup guide
โ””โ”€โ”€ README.md                 # This file

๐Ÿ› ๏ธ Development

Running Tests

cd server
npm test

Database Management

# Open Prisma Studio (GUI)
cd server
npm run db:studio

# After schema changes
npm run db:generate  # Update Prisma client
npm run db:push      # Apply to database

Debugging

Enable verbose logging:

  • Set thoughtVerbosity: "high" in settings
  • Check browser console for frontend logs
  • Check server terminal for backend logs

View raw database:

cd server/prisma
sqlite3 dev.db
.tables
SELECT * FROM Message LIMIT 10;

Backup & Restore:

  • Auto-backups: server/prisma/backups/
  • Hourly (24 kept), Daily (7 kept), Weekly (4 kept)
  • Manual: POST /api/backup/create

Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Make changes
  4. Test thoroughly
  5. Commit (git commit -m 'Add amazing feature')
  6. Push (git push origin feature/amazing)
  7. Open Pull Request

Guidelines:

  • Follow TypeScript best practices
  • Add tests for new features
  • Update documentation
  • Keep commits atomic

๐ŸŽฏ Design Philosophy

Evelyn embodies these principles:

๐Ÿ’ก Genuine Connection Over Performance

  • Real memory, not just context
  • Authentic personality evolution
  • Meaningful relationship dynamics

๐Ÿง  Intelligence Through Curiosity

  • Asks questions, makes connections
  • Shows thinking when comfortable
  • Never lectures or info-dumps

๐Ÿ’ฌ Human Communication

  • Multiple messages, not monologues
  • Natural slang and contractions
  • React in real-time to user

๐Ÿ“Š Radical Transparency

  • Full diagnostics visibility
  • Explain decision-making
  • No hidden processes

๐ŸŒฑ Continuous Evolution

  • Personality shifts over time
  • Evidence-based beliefs
  • Relationship naturally deepens

๐Ÿ† Credits & Acknowledgments

AI Models

Infrastructure

Inspiration

Built on principles from:

  • Cognitive science research on memory formation
  • Personality psychology (Big Five, trait theory)
  • Affective computing & emotional AI
  • Natural language interaction design

๐Ÿ“„ License

MIT License - See LICENSE file for details.

Copyright (c) 2025 Kevin Lin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

๐Ÿค Connect


Built with โค๏ธ using AI, for AI

Evelyn isn't just a chatbotโ€”she's an exploration of what meaningful AI companionship could be.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages