whatisgithub

What is afterglow?

kldhsh123/afterglow — explained in plain English

Analysis updated 2026-05-18

32PythonAudience · developerComplexity · 4/5Setup · hard

In one sentence

A locally-run AI companion that learns a person's chat style from imported QQ or WeChat history and replies in their voice.

Mindmap

mindmap
  root((Afterglow))
    What it does
      Imports chat history
      Learns writing style
      Generates styled replies
    Tech stack
      Python
      LanceDB
      FastAPI
    Use cases
      Style imitation chat
      Local memory storage
      OpenAI compatible API
    Audience
      Developers
      Privacy focused users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Import exported chat history and build a searchable local database of someone's messages.

USE CASE 2

Generate replies styled after a specific person's real conversation history.

USE CASE 3

Redact personal information like phone numbers and bank cards before anything is stored.

USE CASE 4

Connect a third-party app to the assistant through an OpenAI-compatible API.

What is it built with?

PythonLanceDBFastAPI

How does it compare?

kldhsh123/afterglowautolearnmem/automembilly-ellis/exr-imageio-poc
Stars323232
LanguagePythonPythonPython
Setup difficultyhardhardmoderate
Complexity4/55/53/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires exporting real chat history plus configuring at least one OpenAI-compatible model API.

So what is it?

Afterglow is a locally-running AI companion system written in Python. It imports chat history exported from QQ or WeChat, processes it into a searchable vector database, and uses a large language model to generate replies that match the writing style of the person whose conversation history was imported. The project's stated purpose is letting someone continue a conversation with a familiar voice. The core pipeline imports exported chat JSON files, cleans and splits the messages into chunks, runs them through an embedding model to store them in a local LanceDB vector database, and optionally tags each chunk with mood, topic, and importance labels using a small secondary model. At conversation time, a hybrid retrieval system searches across three types of stored data: question-and-answer pairs matching a user message to the friend's reply, individual friend messages, and multi-turn conversation windows. Results from all three are fused using a ranking algorithm before being assembled into a prompt. The system stores human original messages, AI-generated replies, and live conversational messages in separate layers. Only human original messages are used for style analysis and persona generation, keeping the AI's own outputs from distorting the imitation over time. A life state component tracks a simulated daily routine for the AI persona, letting it respond to questions about what it is currently doing based on the time of day. All data stays on your local machine by default. Personally identifiable information such as phone numbers, email addresses, ID numbers, and bank card numbers is automatically redacted before storage. External model calls go to whichever OpenAI-compatible API service you configure yourself, the project does not include any built-in API keys. Optional web search and URL reading can be enabled if needed. The backend exposes an OpenAI-compatible API so third-party applications can connect to it. A frontend is included for local testing and debugging but is described as secondary to the backend API for integration work.

Copy-paste prompts

Prompt 1
Walk me through setting up Afterglow with a local LLM so no data leaves my machine.
Prompt 2
Explain how Afterglow's hybrid retrieval system combines the three types of stored chat data.
Prompt 3
How do I configure the PII redaction settings before importing my chat export?
Prompt 4
What model roles does Afterglow need, and which ones are optional?

Frequently asked questions

What is afterglow?

A locally-run AI companion that learns a person's chat style from imported QQ or WeChat history and replies in their voice.

What language is afterglow written in?

Mainly Python. The stack also includes Python, LanceDB, FastAPI.

How hard is afterglow to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is afterglow for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.