Ziwen v0.5 Adds Parent Accounts and Per-Window Memory Isolation
A developer-authored tutorial for the Ziwen AI homework assistant introduces v0.5, which adds parent registration and login, Bearer-token authentication, child profiles, and multiple chat windows per child. According to the tutorial, the shared handwritten @MemoryId is replaced with a parent-child-window key, while the server derives the parent and child identifiers and verifies window ownership before generating the key. The project’s developer describes this as separating conversations across families, children, and windows; the supplied report does not provide independent verification.
The tutorial demonstrates a concrete multi-user design that combines Bearer-token authentication, server-side ownership checks, and namespaced LangChain4j memory keys to guard against conversations leaking across users and windows.
AI 分得清老大和老二(多用户隔离与 token 认证)
系列第 5 篇 | 对应 git tag:
v0.5| 前置:v0.4读完这一篇,两个娃各自的聊天互不掺和;更重要的是,你搞懂了记忆隔离的真相:它就是一个 key 的命名空间。 本文源码:github.com/tongli99/zi… ,对应 tagv0.5——clone 后git checkout v0.5,或直接浏览 v0.5 快照。
开场:老二接着聊,AI 想起了老大的话
v0.4 结束时,字问只有一个用户:你。@MemoryId 传的是一段手写的字符串,谁打开页面,聊的都是同一段记忆。老二接着老大聊,AI 顺嘴接上了老大的上一句——不是模型记性好,是两段对话写进了同一个 key。
本篇干两件事:给 app 配家长账号(注册、登录、token),同时支持多个孩子聊天。
一、家长注册,名下挂娃、开窗口
这一版把 app 从"一个人用"升级成"一家人用"。家长注册用户名和密码登录;娃不单独注册,只是家长名下的一个昵称;一个娃还能开多个聊天窗口,每个窗口一段独立记忆。数据上就三张表: