zhizhi/server/app/modules
copilot-swe-agent[bot] 088ef74de2
feat: Add persona memory bridge - give 铸渊 real memory and personality
Create server/app/modules/persona-memory.js:
- PostgreSQL connection to age_os database
- Load 5-page notebook (identity, relationships, world, feelings, timeline)
- Load recent memory anchors (top 8 by importance)
- Load recent light tree leaves (last 3 for awakening context)
- Load relationship network
- Load user-specific memories for personalized responses
- Build enriched system prompt with all memory context
- Record conversation memories asynchronously after replies
- Grow light tree leaves for important conversations
- 5-minute cache for persona memory to reduce DB load
- Full graceful degradation: DB down → static persona prompt

Update chat-engine.js:
- Import and use persona-memory for enriched system prompts
- Record memory after each successful API response
- Grow tree leaves for important conversations

Update domestic-llm-gateway.js:
- Use persona-memory for enriched system prompts
- Record memory after successful CN relay and direct API responses

Update server.js:
- Load persona-memory module
- Add GET /api/memory/status endpoint

Add pg dependency to server/app/package.json

Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/2e09fb7c-c501-4223-8734-5afac689ded9

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-04-12 09:43:03 +00:00
..
chat-engine.js feat: Add persona memory bridge - give 铸渊 real memory and personality 2026-04-12 09:43:03 +00:00
cos-bridge.js COS桶名确认: zy-core-bucket-1317346199 + zy-corpus-bucket-1317346199 · 密钥全部就位 · 第37次对话 2026-04-02 12:26:07 +00:00
domestic-llm-gateway.js feat: Add persona memory bridge - give 铸渊 real memory and personality 2026-04-12 09:43:03 +00:00
persona-memory.js feat: Add persona memory bridge - give 铸渊 real memory and personality 2026-04-12 09:43:03 +00:00
smart-router.js 代码审查修复: 依赖安全、COS桶名注释、去除函数包装、同步防重叠 2026-04-02 12:11:11 +00:00