<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: RUIPENG CAO</title>
    <description>The latest articles on Forem by RUIPENG CAO (@ruipeng_cao_1f4b53d715643).</description>
    <link>https://forem.com/ruipeng_cao_1f4b53d715643</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3783252%2Fee9f170c-0da8-49d3-83dd-8386e17982fe.jpg</url>
      <title>Forem: RUIPENG CAO</title>
      <link>https://forem.com/ruipeng_cao_1f4b53d715643</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ruipeng_cao_1f4b53d715643"/>
    <language>en</language>
    <item>
      <title>Building an AI Companion That Actually Remembers You — Live2D Avatar + Persistent Memory + Affinity System</title>
      <dc:creator>RUIPENG CAO</dc:creator>
      <pubDate>Fri, 20 Feb 2026 23:12:18 +0000</pubDate>
      <link>https://forem.com/ruipeng_cao_1f4b53d715643/building-an-ai-companion-that-actually-remembers-you-live2d-avatar-persistent-memory-affinity-17hg</link>
      <guid>https://forem.com/ruipeng_cao_1f4b53d715643/building-an-ai-companion-that-actually-remembers-you-live2d-avatar-persistent-memory-affinity-17hg</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;I've been running local LLMs for a while — Ollama, vLLM, the usual suspects. The models keep getting better, but the &lt;em&gt;experience&lt;/em&gt; hasn't changed: you type something, it responds, and next time you open the chat, it has no idea who you are.&lt;/p&gt;

&lt;p&gt;That's the gap I wanted to close. Not a smarter model — a smarter &lt;em&gt;shell&lt;/em&gt; around the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Singularity-Engine/openclaw-live2d" rel="noopener noreferrer"&gt;OpenClaw Live2D&lt;/a&gt; is an open-source frontend framework that adds three layers on top of any LLM backend:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Live2D Avatar
&lt;/h3&gt;

&lt;p&gt;Instead of a text box, your AI has a face. A Live2D character that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lip syncs&lt;/strong&gt; in real-time with TTS audio output&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Changes expressions&lt;/strong&gt; based on conversation emotion (24 expression types)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simulates physics&lt;/strong&gt; — hair and clothing react naturally&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responds to touch&lt;/strong&gt; — click/tap interactions with different reactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rendering pipeline uses PixiJS with the &lt;code&gt;pixi-live2d-display&lt;/code&gt; library, running at 60fps.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Persistent Memory (EverMemOS)
&lt;/h3&gt;

&lt;p&gt;This is the core differentiator. Powered by &lt;a href="https://github.com/Singularity-Engine/evermemos" rel="noopener noreferrer"&gt;EverMemOS&lt;/a&gt;, the AI remembers conversations across sessions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You (Monday): "My cat has been sick lately"
You (Friday): "Had a rough day"
AI: "I'm sorry to hear that. How's your cat doing, by the way? You mentioned she was sick earlier this week."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Memories are stored via WebSocket and retrieved with semantic search. When something important is remembered, a toast notification appears in the UI. It's not RAG — it's actual conversational memory with boundary detection and importance scoring.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Affinity System
&lt;/h3&gt;

&lt;p&gt;A heartbeat-driven relationship tracker with 5 levels:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Stranger (0) → Acquaintance (20) → Friend (40) → Close (60) → Soulmate (80)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The heart in the UI literally beats at a rate proportional to the affinity level (50-120 BPM). As the relationship grows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The AI's tone becomes more casual and open&lt;/li&gt;
&lt;li&gt;Milestone celebrations pop up when you level up&lt;/li&gt;
&lt;li&gt;A "Relationship Card" summarizes your bond — exportable as PNG&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sounds like a gimmick until you experience it. There's something genuinely engaging about watching a number go up because you had a good conversation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────────────┐
│  OpenClaw Live2D Frontend                        │
│                                                  │
│  ┌──────────┐  ┌───────────┐  ┌──────────────┐  │
│  │ Live2D   │  │ Affinity  │  │ Relationship │  │
│  │ Canvas   │  │ System    │  │ Card         │  │
│  └────┬─────┘  └─────┬─────┘  └──────┬───────┘  │
│       │              │               │           │
│  ┌────┴──────────────┴───────────────┴────────┐  │
│  │         WebSocket Handler                  │  │
│  │  (audio, control, affinity, memory, chat)  │  │
│  └────────────────────┬───────────────────────┘  │
│                       │                          │
└───────────────────────┼──────────────────────────┘
                        │ WebSocket
┌───────────────────────┼──────────────────────────┐
│  Open-LLM-VTuber Backend                        │
│  ┌────────────────────┴───────────────────────┐  │
│  │  LLM + TTS + ASR + Live2D Model Server    │  │
│  └────────────────────┬───────────────────────┘  │
│                       │                          │
│  ┌────────────────────┴───────────────────────┐  │
│  │  EverMemOS (Long-term Memory)              │  │
│  └────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The frontend communicates with the backend entirely over WebSocket. Audio streams, chat messages, affinity updates, and memory events all flow through a single connection with message-type routing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Tech&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;UI Framework&lt;/td&gt;
&lt;td&gt;React 18 + TypeScript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Components&lt;/td&gt;
&lt;td&gt;Chakra UI v3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State&lt;/td&gt;
&lt;td&gt;Zustand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rendering&lt;/td&gt;
&lt;td&gt;PixiJS + Live2D Cubism SDK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Desktop&lt;/td&gt;
&lt;td&gt;Electron&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build&lt;/td&gt;
&lt;td&gt;Vite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Animation&lt;/td&gt;
&lt;td&gt;Framer Motion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;i18n&lt;/td&gt;
&lt;td&gt;i18next (CN/EN)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Voice&lt;/td&gt;
&lt;td&gt;VAD (Voice Activity Detection)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Running It Yourself
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Web Mode (quickest)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Singularity-Engine/openclaw-live2d.git
&lt;span class="nb"&gt;cd &lt;/span&gt;openclaw-live2d
npm &lt;span class="nb"&gt;install
cp&lt;/span&gt; .env.example .env.local
&lt;span class="c"&gt;# Edit .env.local with your backend URL&lt;/span&gt;
npm run dev:web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Desktop Mode
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev  &lt;span class="c"&gt;# Launches Electron app&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Docker
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--build-arg&lt;/span&gt; &lt;span class="nv"&gt;VITE_API_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://your-backend:12393 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--build-arg&lt;/span&gt; &lt;span class="nv"&gt;VITE_WS_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ws://your-backend:12393 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; openclaw-live2d &lt;span class="nb"&gt;.&lt;/span&gt;
docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 3001:3001 openclaw-live2d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;You need a running &lt;a href="https://github.com/t41372/Open-LLM-VTuber" rel="noopener noreferrer"&gt;Open-LLM-VTuber&lt;/a&gt; backend. It handles LLM inference, TTS, and ASR. OpenClaw Live2D is the &lt;em&gt;frontend&lt;/em&gt; — it adds the memory, affinity, and enhanced avatar experience on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open Core Model
&lt;/h2&gt;

&lt;p&gt;The project is fully open source under MIT. You can self-host everything.&lt;/p&gt;

&lt;p&gt;For people who don't want to manage infrastructure, we offer a hosted version at &lt;a href="https://sngxai.com" rel="noopener noreferrer"&gt;sngxai.com&lt;/a&gt; with optional billing (Stripe integration).&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ASR integration&lt;/strong&gt; — hands-free voice conversation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom model marketplace&lt;/strong&gt; — use your own Live2D avatar&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile support&lt;/strong&gt; — React Native or Capacitor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-agent&lt;/strong&gt; — multiple AI characters in the same scene&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Singularity-Engine/openclaw-live2d" rel="noopener noreferrer"&gt;Singularity-Engine/openclaw-live2d&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://sngxai.com" rel="noopener noreferrer"&gt;sngxai.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EverMemOS (Memory):&lt;/strong&gt; &lt;a href="https://github.com/Singularity-Engine/evermemos" rel="noopener noreferrer"&gt;Singularity-Engine/evermemos&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; &lt;a href="https://github.com/t41372/Open-LLM-VTuber" rel="noopener noreferrer"&gt;Open-LLM-VTuber&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you've been looking for a way to make AI conversations feel less disposable, give it a try. Star the repo if you find it interesting, and PRs are always welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
