kldhsh123/Afterglow
基于 RAG(免微调)从聊天记录唤起语气与回忆:让曾经对话的温度,延续为往后的陪伴。 | Zero-finetuning RAG to revive tone and memories from chat logs: Let the warmth of past conversations continue into companionship.
What it solves
Afterglow is designed to recreate the feeling of chatting with a specific person by using their real historical chat logs. It allows users to build a digital companion that mimics the personality, expression style, and shared memories of a real individual without needing to fine-tune the underlying LLM.
How it works
The system uses a Retrieval-Augmented Generation (RAG) pipeline combined with persona management. It processes imported chat logs (from platforms like QQ, WeChat, and Douyin) through a pipeline that cleans, splits, and vectorizes the text.
Key components include:
- Hybrid Retrieval: A five-way vector recall system that retrieves relevant historical texts, image summaries, and live memories using RRF (Reciprocal Rank Fusion).
- Persona & State Management: It maintains a persona card, circadian (sleep/wake) profiles, and life states to ensure the AI's responses are contextually appropriate to the time of day and the person's habits.
- Offline Analysis: Tools like
xuwen analyzegenerate timelines and personality reports from the chat history to further refine the AI's behavior. - OpenAI Compatible API: The backend provides an API that allows the system to be connected to various third-party clients or bots (e.g., QQBot, WeiXinBot).
Who it’s for
Individuals who want to preserve the linguistic style and memories of a loved one or a friend, or those looking to create highly personalized AI companions based on real-world interaction data.
Highlights
- Multi-source Import: Supports various chat export formats including JSON and JSONL from multiple social platforms.
- Local-First Privacy: Uses LanceDB for local storage of vectors and personas, supporting PII redaction and offline model services.
- Proactive Messaging: Includes an engine that can initiate conversations based on analyzed personality traits and schedules.
- Memory Layering: Distinguishes between real human history, new user messages, and AI-generated responses to prevent AI content from polluting the long-term persona.
Related
- Project
- Project
- Project
- Project
- Project