csr1010/whatsapp-ai-agent-sdk

The open-source AI agent SDK for WhatsApp. Bring your own model, your own number, your own data. Local-first, no forced cloud, no vendor lock-in.

What it solves

Building an AI agent on WhatsApp often forces you to hand your data to someone else's cloud or build a whole new app. This SDK lets you run a real agent that can use tools, remember context, and hold conversations, directly on WhatsApp, with everything stored locally in one file. No account with the SDK provider, no server routing your messages—your data never leaves your machine.

How it works

You run a one-command installer (npm create @wappy_ai/agent) that asks a few questions (which model provider, where to store retrieved knowledge, whether to add a productivity agent). It then generates a working project. You fill in your own model API key and WhatsApp Cloud API credentials, run npm run dev, and a webhook server starts, opening a tunnel to connect to Meta. The agent itself is built from shared packages: @wappy_ai/core defines the contracts, @wappy_ai/harness handles the agent's thinking, memory, and tool decisions, and @wappy_ai/whatsapp handles correct WhatsApp integration (formatting, retries, webhook). A real RAG layer grounds answers in data you ingest—either a local SQLite/LibSQL store with BM25 matching (default) or a Cognee knowledge graph if you bring your own instance. A bundled example shows tool-calling with Gmail and Calendar: two generic, read-only tools let the model build its own queries using real API syntax, and it honestly says when it's not connected rather than making something up.

Who it’s for

People who want a personal assistant on WhatsApp that remembers them, connects to their own accounts (like Gmail/Calendar), and answers from a private knowledge base—all without sending data to a third party. It's also for businesses that want a support, booking, or internal ops bot wired to their own systems; those aren't pre-built, but the agent's memory, context, and tool-calling are ready to extend. Requires you to bring your own WhatsApp Cloud API app and model API key, and Node.js 22+.

Highlights

  • Local-first: conversations, memory, and data stay in one file on your own machine.
  • One-command setup: npm create @wappy_ai/agent generates a working agent in under a minute.
  • Bring your own model: works with OpenAI, Anthropic, Gemini, or local Ollama (fully offline).
  • Real RAG layer: ingest your notes or docs and get grounded answers from that content, never a hallucinated guess.
  • Example tool-calling harness: shows how to connect Gmail/Calendar with generic, read-only tools.
  • Optional Cognee support: switch to a self-hosted or cloud knowledge graph for entity/relationship extraction.
  • MIT-licensed and not affiliated with WhatsApp or Meta.

Related

  • Project
  • Project
  • Project
  • Project