wagent
v1.0.2
Published
WhatsApp Agent — AI-powered WhatsApp assistant using WAMCP + Groq
Readme
wagent
Programmable WhatsApp AI agent that runs from your terminal.
It pairs with WhatsApp first, then asks for an AI provider/API key, then bootstraps itself by messaging you for identity, purpose, vibe, and permissions.
Install / Run
npx wagentOr install globally:
npm i -g wagent
wagentFrom source:
pnpm install
pnpm build
pnpm wagentFirst Run Flow
- Pair WhatsApp by scanning the QR code.
- Choose an AI provider.
- Enter API key.
- The agent messages you to configure its identity and permissions.
- It drafts a system prompt and asks for confirmation.
- After confirmation, it compacts setup context and follows the saved prompt.
Providers
Setup wizard options:
- Gemini + Web Search (recommended)
- Groq
- Other OpenAI-compatible endpoint
Config is stored locally, not in .env:
- Linux/macOS:
~/.config/wagent/config.json - Windows:
%APPDATA%/wagent/config.json
The WhatsApp SQLite session is stored in the same config directory as wagent.db.
Environment variables still work for advanced use:
GROQ_API_KEY=...
GROQ_BASE_URL=https://api.groq.com/openai/v1
GROQ_MODEL=openai/gpt-oss-120bCommands
wagent # start agent
wagent start # start agent
wagent setup # re-run provider/API-key setup after WhatsApp pairing
wagent config # show config path/provider/model
wagent --verbose # lifecycle logs
wagent --debug # debug logsMessage Permissions
By default:
- The agent only reads/responds to you.
- It does not auto-reply to others.
- Group chats are ignored unless someone tags
@wagent. @wagentbypasses filters, including blacklist.
The bootstrap conversation lets you configure who it can read, reply to, or message.
Anti-Ban / Human-Like Behavior
- Replies are delayed randomly between 2 and 8 seconds.
- The agent waits if the chat is currently typing/recording when WhatsApp presence is available.
- CLI logs are quiet by default.
Capabilities
- Send text, image, video, audio, documents, contacts, polls, location
- Search/resolve contacts by name, phone, or JID
- Manage profile/status
- Manage groups/chats
- Remember and compact context
- Enforce read/reply/send policy before model access
Notes
This should run on an always-on machine/VPS. It is not suitable for Vercel serverless because Baileys needs a persistent WhatsApp WebSocket and durable session storage.
License
MIT
