Let the warmth of past conversations continue into companionship.
通过真实聊天记录构建可检索的关系记忆、角色设定与表达风格。结合 RAG、角色上下文和兼容 OpenAI 的 API,让 AI 在新的对话中延续熟悉的交流方式。
Build retrievable relationship memories, persona and expressive style from real chat history. RAG, persona context and an OpenAI-compatible API bring familiar conversational patterns into new exchanges.
Share your experience. Bug reports, deployment problems and stories about using Afterglow are welcome. Join our Discord server, QQ group 330316577 or use Discussions. With your consent, your story may appear on the project website, credited or anonymous as you prefer.
Important 重要
Afterglow generates AI continuations, not the original person. Obtain necessary permission, understand what data reaches model providers, and distinguish generated text from real people. Do not impersonate, harass, defraud, publish private chats or present generated replies as someone’s own words.
If you are experiencing acute grief, depression or self-harm risk, prioritize people you trust and professional support. Read Responsible use and privacy.
What it is
Afterglow is a locally hosted AI companion. It cleans, splits and vectorizes real chats, then combines persona, circadian patterns, Life state and relationship memories to supply relevant historical evidence to a chat model.
It does not fine-tune or modify model weights, restore a person or replace real relationships. Results depend on the amount and distinctiveness of the source chats and the chosen model.
Offline import: A/B/C text indexes, persona/style/circadian/lightweight proactive profiles; no automatic relationship reports or proactive AI attribution.
Explicit analysis:xuwen analyze generates relationship reports; independent analyze-proactive produces proactive tendencies with a read-only quality check.
Online conversations: Five vector paths and Recent Live feed concurrent retrieval/relationship/Life context, then response policy and prompt construction.
Runtime use: Timeline is view-only; personality and Life have independent switches. Proactive scheduling prefers the dedicated report with legacy fallback.
Local persistence: Vectors, persona, circadian/Life state, images and stickers stay in local storage by default.
The maintainer recommends running from source for convenient configuration and advanced/experimental features.
Windows desktop
Afterglow Desktop is the Windows desktop client for Afterglow. It bundles the original Afterglow core and a portable Python runtime, bringing the setup wizard, model connections, chat history import, chat and analysis together in one interface. Separate installation directories can each keep their own configuration and data.
Docker
mkdir -p ~/afterglow && cd ~/afterglow
curl -fsSLo compose.yaml \
https://raw.githubusercontent.com/kldhsh123/Afterglow/main/docker/compose.standalone.yaml
# Create initial language and container-access settings; edit existing .env fields manually
if [ ! -f .env ]; then
printf '%s\n' 'XUWEN_LANGUAGE=en' 'CONFIG_UI_LOCALHOST_ONLY=false' > .env
fi
docker compose pull && docker compose up -d
docker compose logs backend | grep -iE "token|/config/"
Copy the session setup token from the logs, open http://localhost:8000/config/ and complete the eight steps. Configuration goes to the working directory’s .env; data goes to .data/. Then:
Requires Python 3.12.x (>=3.12,<3.13) and uv. Start with the wizard:
cd backend
uv sync --extra dev
XUWEN_LANGUAGE=en uv run uvicorn xuwen.chat_api.app:create_app --factory --reload
Missing required configuration makes the console print a setup token. Open http://127.0.0.1:8000/config/, set identities, models, imports and access password, then restart.
XUWEN_LANGUAGE=en is the backend default; zh-CN selects Chinese. It controls startup and proactive messages, including rewrites/fallbacks. CLI --language en / --language zh-CN and HTTP Accept-Language: en / Accept-Language: zh-CN override their own output scopes. Normal chat follows the conversation and explicit requests. Internal model instructions use English; original evidence and custom prompts are preserved.
The chat UI, wizard and documentation have independent language selectors. First use selects Chinese for Simplified/Traditional Chinese browser preferences and English otherwise. Manual selection is remembered. Wizard provider presets are Chinese-only; empty English services suggest Google chat and OpenAI embeddings/auxiliary models without overwriting saved configuration.
The source startup prefix above uses Bash / WSL syntax. See Quick start for PowerShell syntax, language precedence, the frontend and third-party clients.
Chinese sources are in docs/wiki/; English sources are in docs/en/. GitHub Actions builds the documentation website; the old Wiki remains a generated compatibility mirror.
Issues and pull requests are welcome. Read the contribution guide before modifying the project; the English development guide covers setup, plugins and checks.
Acknowledgements
Thanks to the LINUX DO community for suggestions that have shaped and refined many implementation details.
Special thanks to GuDong, who has used Afterglow since its early versions and continually contributed bug reports and improvement suggestions.
Thanks to everyone who has submitted issues, pull requests, usage feedback and redacted reproduction material.
The issue templates were adapted from AstrBot for Afterglow’s reporting process. Both projects use GNU AGPL v3.0.
Thanks also to ECYLT and its anime API relay for past model-service support.
评论