The technology stack that puts a Three Kingdoms-era companion on your Windows desktop.
The Four-Layer Architecture
Xuanji Diaochan is built on a cloud-local hybrid architecture — heavy computation happens in the cloud, while lightweight rendering and basic interaction happen locally. This keeps the desktop footprint minimal (no GPU required) while enabling sophisticated AI behavior.
Layer 1: LLM Backend (Cloud)
The foundation is a general-purpose large language model. Unlike game NPCs with scripted dialogue trees, she generates responses dynamically — understanding context, nuance, and emotional subtext. The model is selected for:
Natural conversational flow (no robotic "as an AI language model" disclaimers in-character)
Chinese language fluency with classical literary awareness
Context window large enough to hold weeks of relationship history
Layer 2: Aesthetic Prompt Layer (Cloud)
A raw LLM doesn't "know" it's Diaochan. The aesthetic prompt layer injects character identity, tone, and behavioral constraints into every API call. This includes:
Voice calibration — Classical Chinese speech patterns without sounding unnatural
Knowledge pruning — She knows about the Three Kingdoms era but doesn't reference things that break character (no smartphones, no modern politics)
Emotional range — Curious, playful, occasionally melancholy; never flat or purely informational
Safety guardrails — Deflection patterns for inappropriate topics that maintain character integrity
Layer 3: Long-Term Memory (Cloud)
Without memory, every conversation is a first date. The memory layer stores:
Factual memory — "User mentioned they have a cat named Mochi"
Emotional memory — "User was stressed about exams last week"
Relationship state — Trust level, shared jokes, milestone events
Interaction patterns — When the user typically engages, what topics they avoid
Memory is compressed and summarized over time, so early interactions influence later ones without consuming the entire context window.
Layer 4: Desktop Overlay (Local — Aura Shell)
This is what the user actually sees. The overlay renders Diaochan as a lightweight animated character in a small desktop window. Key design decisions:
No fullscreen — She's a companion, not a game. She coexists with your other windows.
Three scenes — Study, courtyard, window-side; each with ambient animations that change based on time of day and relationship state
Minimal resource usage — Pre-rendered video loops with lightweight compositing; no real-time 3D rendering
Screen context hooks — Optional: she can see what application is in focus to ground her proactive comments in reality
Why Cloud-Local Hybrid?
Pure local AI isn't there yet for rich conversational experiences. Pure cloud creates latency and privacy concerns. The hybrid approach:
Runs Locally
Runs in Cloud
Video rendering & animation
LLM inference
Screen capture (with permission)
Memory storage & retrieval
Basic state machine (idle/active/sleep)
Billing & token management
Audio playback
Prompt assembly & character logic
Privacy Design
Screen context is the most sensitive capability. Xuanji Diaochan handles it with strict controls:
Screen capture is opt-in — disabled by default
Only application name / window title is extracted, never full screen content
All cloud-bound data is transmitted over HTTPS
Memory can be cleared by the user at any time
Key Numbers
Metric
Value
Architecture layers
4 (LLM, Prompt, Memory, Overlay)
Local rendering method
Pre-rendered video loops — no GPU required
Desktop resource usage
Minimal — coexists with other windows
Memory model
Compressed & summarized over time for efficiency
Screen sensing
Opt-in, local-only, app name only
How Desktop AI Digital Humans Are Built
Choose an LLM backend: Select a model with strong conversational ability and sufficient context window for long-term memory
Build the character prompt layer: Inject personality, tone, knowledge boundaries, and safety guardrails into every API call
Implement the memory system: Store and retrieve conversation history, emotional states, and relationship milestones
Create the desktop overlay: Render the character using pre-rendered videos with lightweight compositing
Wire up screen context: Optionally detect active window for grounded proactive comments
FAQ: Technology
Q: Do I need an internet connection?
A: Character display works offline. LLM conversation, memory, and billing require internet.
Q: What LLM is used?
A: A general-purpose LLM with a custom Chinese aesthetic prompt layer — model selection optimized for conversational quality.
Q: Is my conversation data secure?
A: Yes — transmitted over HTTPS, stored encrypted, deletable on demand.
Published: August 7, 2025. Last updated: August 7, 2025.