← All work
Product · 2025

AI WhatsApp Mental-Health Chatbot (Mastra Agent)

A mental-health / therapy chatbot

Overview

A build conversational AI agent that delivers a therapy/mental-health chat experience over WhatsApp. It connects an LLM-driven agent (built on the Mastra framework) to WhatsApp messaging with persistent per-user memory.

Why It Exists

Mental-health support benefits from meeting people where they already are, and WhatsApp is ubiquitous. The build explores whether a memory-backed AI agent can hold coherent, context-aware therapeutic conversations through WhatsApp without a custom client app, validating both the channel integration and the agent-memory approach.

What We Built

A TypeScript Node service that bridges WhatsApp (whatsapp-web.js, with qrcode-terminal for session pairing) to a Mastra agent. The agent stack uses @mastra/core for orchestration, @mastra/memory over @mastra/libsql for durable conversational memory, @mastra/loggers for observability, and the Vercel AI SDK’s OpenAI provider (@ai-sdk/openai) for the underlying model. An Express layer (with CORS) provides supporting HTTP endpoints, and Zod handles schema validation. The project was a short, focused build exploring the end-to-end flow.

Technologies & Approach

TypeScript with Mastra as the agent framework, chosen for its first-class memory and tooling abstractions, backed by libSQL for lightweight persistent memory and OpenAI via the AI SDK for generation. WhatsApp Web automation provides the messaging channel without app-store overhead.

Outcome / Impact

A working spike that proved a memory-backed AI agent can run a sustained, context-aware conversation over WhatsApp, validating both the Mastra agent architecture and the WhatsApp delivery channel for sensitive, ongoing-dialogue use cases.

Capabilities Demonstrated

  • Conversational AI agents with persistent, per-user memory (Mastra + libSQL)
  • WhatsApp as a delivery channel for AI assistants
  • LLM integration via the Vercel AI SDK
  • Rapid end-to-end agent building in TypeScript
More work See all →