Skip to content
hamzah105Public

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

OpenChat

Open-source WhatsApp automation agent. Natural, human-like replies. Plug and play.

What is OpenChat?

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

Features

  • 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

Quick Start

Prerequisites

  • Node.js 18+ (download)
  • A phone with WhatsApp (for QR login)
  • OpenRouter API key (free tier available at openrouter.ai)

Install

# 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
  1. Scan the QR code with WhatsApp (Settings → Linked Devices → Link a Device)
  2. Done. Your agent is live.

Configuration

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 Examples

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

Model Options

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)

Security & Privacy

  • 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)

Project Structure

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

Dependencies

Package Purpose
whatsapp-web.js WhatsApp Web client (QR login, messaging)
qrcode-terminal Terminal QR code display
dotenv Environment variable loading

License

MIT — do what you want with it.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages