Wait for a message to finish before forming a reply
This TypeScript prototype connects to a WhatsApp account through Baileys and uses Gemini to draft responses. The message handler collects direct-message arrivals for a short silence window before replying. It also tracks typing presence so it can keep waiting while the other person is still composing, instead of treating every split line as a separate question.
The handler keeps pending message buffers per chat and includes separate logic for groups, message echoes and reconnect backlogs. That turns a quick API integration into a small event-processing problem with state, timing and duplicate handling.
Memory is scoped to a chat, but stored on the host
The code stores up to 100 messages per chat in JSON files under a local memory directory, and can seed that history from an imported chat export. Authentication state is also saved locally so the client can reconnect. This is simple to inspect and easy to run, but local files are not automatically protected by the operating system or encrypted by this application.
A person using the prototype should secure the machine, protect the session credentials, review what message content is retained and get clear consent before connecting it to anyone else’s account or automating conversations with other people.
Generated replies need human control
A model can misread tone, invent a detail or send a message at the wrong time. The project includes pause state, setup and help flows, but generated messages still deserve a careful test boundary before any real conversation is automated.
This repository is best understood as a personal automation experiment. It is not a privacy-audited messaging product, and it should not be connected to sensitive chats without a review of the data flow, retention and account risks.
INSPECT THE IMPLEMENTATION
Read the code and project notes
The details above describe the public repository and project status as reviewed for this portfolio. Follow the source to inspect the implementation, setup instructions and current limitations.
WhatsApp message handling and local memory code


