用本地架构让AI记住用户长期心理状态,实现持续陪伴式辅导。
The Model Is Not the Product: A Dual-Pillar Architecture for Local-First Psychological Coaching
- 构建本地运行的双支柱系统,通过记忆卡片持久保存对话内容。
- 实现近无限上下文窗口,支持跨会话连续性与行为追踪。
- 适合注重隐私、需长期陪伴的心理健康应用开发者参考。
现有语言模型应用难以满足情感支持需求,主要因无法在会话间保持深层持久上下文。本文提出Psych LM,一款运行于iOS的本地化心理辅导应用,验证了对这类应用而言,系统架构比模型本身更为关键。该系统在专为行为与生活辅导设计的本地优先运行时环境中,部署本地化语言模型,通过自动化的、用户可检查的记忆库,将对话转化为结构化记忆卡片(含事实、目标、事件),并利用语义与向量搜索动态注入提示词,实现近乎无限的上下文窗口。系统具备主动学习、检索增强生成与设备端运行特性。主要贡献包括:以隐私为核心属性的本地优先设计;详细描述用于持久保存用户关键信息的记忆库;独立于模型内部状态的确定性编排层,提供稳定的行为支撑;以及聚焦真实运行条件下系统可靠性的基准评估框架。研发过程证实,在移动环境严格限制下,通过优先保障架构控制与资源管理,仍可实现复杂、上下文感知的交互。
原文摘要 · Abstract (English)
Existing language model applications struggle to meet the demand for emotionally oriented support, primarily due to their inability to maintain deep, persistent context across sessions. This report introduces Psych LM, an iOS application that validates the thesis that, for such applications, the surrounding architecture is paramount. Psych LM runs a local, on-device language model within a purpose-built, local-first runtime designed for behavioral and life-coaching applications. The system achieves the practical effect of a near-infinite context window through an automated, user-inspectable memory corpus that converts conversations into structured memory cards, including facts, goals, and events, and dynamically injects them into the prompt via semantic and vector search. As such, the system can be defined as an active-learning, retrieval-augmented generative, on-device architecture. This architecture delivers four primary contributions: a local-first design where privacy is a core property; a detailed description of the memory corpus for persistent context of key user information; a deterministic orchestration layer that provides a stable behavioral spine independent of the model's internal state; and a benchmark framework focused on evaluating the integrated system's reliability under realistic operating conditions. The R and D process confirms that complex, context-aware interaction can be reliably achieved under the strict constraints of a mobile environment by prioritizing architectural control and resource management over simple model size.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。