Everything K-culture — comebacks to K-beauty, straight to your inboxGet it in your inbox

METAL MEDIA

AFan4724/clone-chat

111JavaScriptMIT

Feed it your old chat logs, and a local AI clone learns to talk exactly like that person

clone-chat is a locally-run agent that imports a real person's chat history and learns their tone, favorite stickers, and reply rhythm to keep conversations going as that person. The agent itself decides whether to reply, how long to wait, how many messages to send, and whether to answer with text or voice, all based on evidence pulled from the imported logs. Everything runs on your own machine, so the data stays private.

What it does

  1. Chat exports from any messaging app are converted into a standard format; the system then extracts real message samples, tone summaries, reply delay patterns, active hours, and frequently used short phrases as behavioral statistics.
  2. It combines full-text search (FTS5) with locally computed semantic vector search to retrieve relevant past conversations as grounding for each reply, and builds a sticker index using only stickers the person actually sent, tagged by meaning and context.
  3. The agent is built with the OpenAI Agents SDK and supports switching between OpenAI-compatible model providers like DeepSeek, OpenAI, and Xiaomi's Mimo; each reply can be marked 'sounds like them' or not, feeding back into later turns.
  4. Beyond text, it supports voice messages both ways, delayed message delivery, handling of unread/undelivered messages, and proactive outreach, all inside a realistic chat UI with bubbles, typing indicators, and send status.
  5. Adding the app to an iPhone home screen with a locally installed HTTPS certificate enables push notifications on iOS, and by default the server only listens on localhost, keeping it off the public internet unless explicitly configured otherwise.

Why it matters

It's a concrete reference for anyone building a personal project to preserve or recreate how a close friend or family member talks, or for developers designing chat-data products who want to avoid sending private conversation data to a remote server. Being pure JavaScript also makes it easy for web developers to read and modify the code directly.

Terms in this repo

  • FTS5 · a built-in full-text search feature in SQLite databases
  • OpenAI Agents SDK · a toolkit from OpenAI for structuring an AI agent's decision-making and tool-use flow
  • OpenAI-compatible · a spec that lets other companies' models be called the same way as OpenAI's API
  • semantic vector search · a search method that turns sentences into number arrays to find ones with similar meaning

Repository description (English)

voice, proactive messages, long-term memory, fully private.

Open on GitHub

Trending repos

All repos →

Latest from METAL MEDIA