DEV Community

一辰怪谈
一辰怪谈

Posted on AI-assisted

How I Built a Local RAG Customer-Service Agent for WeChat Desktop

I built this as an indie side project after watching a friend do private-traffic customer service on WeChat. She juggled four or five WeChat accounts at once — switching between work and personal profiles, copying answers between chat windows, losing track of which customer was waiting. The keyword auto-reply tools she tried were too rigid: miss one synonym and the bot stays silent, fire a canned reply and the customer feels talked to by a machine. I wanted something that actually read her documentation and sounded like her — and that ran entirely on her own machine.

The result is 微信管家 (WeChat Butler), a Windows 10/11 desktop app that sits alongside the official WeChat desktop client and acts as a local customer-service agent. The whole stack is local: a vector knowledge base you build from your own PDF and DOCX files, per-chat persona prompts, an on-device vision pass for screenshots and stickers, human-like typing delays and split replies, and a local encrypted SQLite store that never phones home.

The problem

WeChat private traffic is built on relationships, not broadcast channels. Support agents run multiple accounts at once and the conversation graph is personal, not linear. Off-the-shelf auto-reply tools assume a single chatbot per domain and trigger on exact keywords or fuzzy match. In practice: coverage is fragile (reword once and the rule misses), tone is wrong (a generic bot voice breaks trust), media is ignored (stickers, forwarded screenshots, invoices — half the signal lives in images), and risk is opaque (sensitive words slip through or trigger over-sensitive blocks). Keyword rules don't scale to a real catalog, and cloud-hosted chatbots mean your customer conversations and product docs leave your machine — a non-starter for a small seller.

The approach

Local RAG over PDF and DOCX

The knowledge base is a local vector store built from files you drop in — product manuals, sizing charts, SOPs, FAQ exports — PDF and DOCX both. Re-index when a price changes; there is no managed embedding service, no API quota, no egress. When a message arrives, the agent retrieves relevant chunks and grounds its answer in them. If the docs don't cover the question, it hands off to the human instead of hallucinating.

Per-chat persona prompts

Not every customer needs the same voice. WeChat Butler supports per-group and per-contact persona prompts plus a reply strategy. A VIP group can get a detailed, patient tone with follow-up questions; a noisy broadcast group can get short confirmations. The persona is a prompt, not a toggle — you write the voice, and the RAG layer fills in the facts.

Vision for screenshots and stickers

Half of what customers send is an image. A forwarded product photo, a cropped invoice, a sticker that doubles as a question. WeChat Butler runs a local vision pass on images so the agent can reference what's actually in the screenshot — product name, price tag, error text — and react to stickers as conversation, not noise.

Human-like typing and split replies

A 200-word instant reply at 3 a.m. from an account that usually takes ten seconds to type is the number one tell-tale of automation. WeChat Butler applies a configurable human-like typing delay and splits long answers into segmented replies the way a real person would. It is not a promise that an account will never be flagged — WeChat's automation rules are real — but it removes the most obvious signals and lets you sleep.

Sensitive-word blocking

You define the words that must never leave the account, and replies that touch them are dropped or rewritten. It's a net, not a promise: a brand-new sensitive term always slips through the first time, but the rest of the time you don't have to scan sent messages at 2 a.m.

Local encrypted SQLite

Nothing leaves the machine. Chat history and the knowledge base are encrypted and stored in a local SQLite database; nothing is uploaded to any cloud. You can delete the data the same way you delete the app. That's the point.

Lessons learned

  1. Start local. The moment you put customer conversations in the cloud, trust and compliance become your product. Local-first forced the right decisions early.
  2. RAG is only as good as the docs you feed it. A sloppy FAQ becomes a sloppy agent. Index hygiene is a feature, not a chore.
  3. Per-chat tone matters more than accuracy gains. A 2% better retrieval score means less to a customer than the bot sounding like the person they know.
  4. Anti-detection is risk hygiene, not a shield. Typing delays and split replies reduce obvious signals; they don't rewrite the platform's terms. Treat them as one control among many.
  5. Local encryption has to be the default, not an option. If a customer has to opt in to privacy, too many won't.

Try it

WeChat Butler is a free download at https://vx.cuxn.cn/. It's built for Windows 10/11 and works alongside the official WeChat desktop client — it doesn't replace it. Drop in your docs, set a persona, and the agent does the rest locally.

Built as an indie project because a friend doing private-traffic customer service deserved a tool that respected her customers, her documents, and her sleep.

Top comments (1)

Collapse
 
officialmailkr profile image
오피셜메일 •

문서에 없는 질문은 사람에게 넘기고, 가격이 바뀌면 PDF·DOCX 지식을 다시 색인한다는 설계가 실무적입니다. 고객지원에서는 답변에 사용한 문서 버전과 마지막 갱신 시각도 상담 기록에 남기면, 오래된 가격표가 섞였을 때 원인을 찾기 쉬울 것 같습니다. 스크린샷에서 읽은 금액이나 청구 정보는 자동 답장 전에 사람 확인으로 보내는 분기도 유용하겠네요.