Open-source WhatsApp automation agent. Natural, human-like replies. Plug and play.
OpenChat turns your WhatsApp into a smart, auto-replying agent that feels human.
It uses an LLM (via OpenRouter API) to generate contextual, natural replies — not canned responses. It knows the time, date, and conversation context. It matches tone, answers questions properly, and stays casual for quick chats.
Use cases:
- Personal — auto-reply when you're busy
- Business — basic customer support, FAQ answers
- Automation — intelligent message handling
- Human-like replies — no robotic "How can I help you?" bot responses
- Context-aware — knows the time, date, and conversation history
- Smart reply logic — short for casual, detailed for questions
- Configurable identity — name, personality, tone — all in
config.js - Group chat toggle — enable or disable group responses
- Privacy-first — no message logging by default, no tracking
- One-command setup — install and run in minutes
- Node.js 18+ (download)
- A phone with WhatsApp (for QR login)
- OpenRouter API key (free tier available at openrouter.ai)
# Clone the repo
git clone https://github.com/hamzah105/openchat.git
cd openchat
# Install dependencies
npm install
# Set up your API key
cp .env.example .env
# Edit .env and add your OPENROUTER_API_KEY
# Run
node index.js- Scan the QR code with WhatsApp (Settings → Linked Devices → Link a Device)
- Done. Your agent is live.
Edit config.js to customize everything:
module.exports = {
name: "Friend", // Your display name
personality: "casual", // casual | professional | friendly | witty
tone: "chill", // chill | warm | formal
allowGroups: false, // respond in groups?
model: "qwen/qwen3-coder-plus", // LLM model on OpenRouter
maxHistory: 10, // recent messages per contact
timezone: "", // leave empty to auto-detect
logMessages: false, // privacy: off by default
};Changes apply on restart.
| Personality | Tone | Behavior |
|---|---|---|
| Casual | Chill | Relaxed, everyday language, no formality |
| Professional | Formal | Polished and respectful, structured |
| Friendly | Warm | Warm, approachable, uses emojis |
| Witty | Chill | Clever humor, sharp but not mean |
Any model from OpenRouter works:
qwen/qwen3-coder-plus(default, fast, free tier)openai/gpt-4o(high quality)anthropic/claude-sonnet-4(excellent reasoning)google/gemini-pro(good balance)
- No default logging — messages are not stored unless you enable
logMessages - No external data sharing — your messages only go to the LLM API
- No hidden tracking — zero telemetry
- API keys stay local — stored in
.env(gitignored)
openchat/
├── index.js # Main application
├── config.js # Your configuration
├── package.json # Dependencies
├── .env.example # API key template
├── .gitignore # Git ignore rules
├── README.md # You are here
├── session/ # WhatsApp session (auto-created)
└── logs/ # Optional message logs
| Package | Purpose |
|---|---|
whatsapp-web.js |
WhatsApp Web client (QR login, messaging) |
qrcode-terminal |
Terminal QR code display |
dotenv |
Environment variable loading |
MIT — do what you want with it.