It uses the Vercel AI SDK for the agent loop (generateText with multi-step tool use) and Baileys under the hood for WhatsApp. Supports Anthropic, OpenAI, or Ollama for local models.
Some things it handles that I couldn't find in existing WhatsApp bot repos:
- Per-chat message serialization (no race conditions when multiple messages arrive)
- Conversation summaries so the agent remembers context without stuffing full history into every call
- User profile extraction over time ("prefers Arabic", "lives in Dubai")
- Multi-agent routing — different agents for different groups/contacts/keywords
- Rate limiting and cooldowns per chat so a noisy group doesn't drain your API budget
- Cron triggers and human handoff
npx wa-agent init my-bot to get started.
GitHub: https://github.com/ibrahimhajjaj/wa-agent
npm: https://www.npmjs.com/package/wa-agent