"Vibe-Trading: Your Personal Trading Agent"
WhatsApp group summary bot for Docker and FastAPI
wa_llm is a deployable WhatsApp bot that monitors group chats, stores message history, and generates summaries or mention-based replies. It runs with Docker Compose, connects to a WhatsApp Web API, and uses PostgreSQL with pgvector for persistent context and knowledge base lookup.
Builders who want a WhatsApp bot to follow group chats and generate summaries or replies.
You can run a WhatsApp bot that tracks group conversations and posts AI summaries without building the whole service yourself.
What it does
Mention-based replies
Responds in group chats when the bot is mentioned.
LLM conversation summaries
Generates summaries from group message history.
Knowledge base lookup
Uses stored topic data to answer with more context.
Persistent message history
Stores conversations in PostgreSQL with pgvector.
Multi-message support
Handles text, media, and links.
Opt-out controls
Lets people DM the bot to avoid being tagged in generated messages.
REST API
Exposes endpoints for loading knowledge base topics and triggering summaries.
Docker Compose deployment
Includes development, local-run, and production Compose files.
How to get it
- 1Run
git clone https://github.com/YOUR_USER/wa_llm.git cd wa_llm
- 2Copy .env.example to .env and fill in required values.
cp .env.example .env
- 3Option A: Development (Build from source)
docker compose up -d
- 4Option B: Production (Use pre-built images)
docker compose -f docker-compose.prod.yml up -d
- 5run the following update statement
UPDATE public."group" SET managed = true WHERE group_name = 'Your Group Name'; - 6Install dependencies using uv
uv sync --all-extras --dev
README
๐ฑ WhatsApp Group Summary Bot
AI-powered WhatsApp bot that joins any group, tracks conversations, and generates intelligent summaries.
Features
- ๐ค Automated group chat responses (when mentioned)
- ๐ Smart LLM-based conversation summaries
- ๐ Knowledge base integration for context-aware answers
- ๐ Persistent message history with PostgreSQL +
pgvector - ๐ Support for multiple message types (text, media, links)
- ๐ฅ Group management & customizable settings
- ๐ Opt-out feature: Users can opt-out of being tagged in summaries/answers via DM.
- โก REST API with Swagger docs (
localhost:8000/docs)
๐ณ Docker Compose Configurations
This project includes multiple Docker Compose files for different environments:
| File | Purpose | Usage |
|---|---|---|
docker-compose.yml | Default/Development. Builds the application from source code. | docker compose up -d |
docker-compose.prod.yml | Production. Uses pre-built images from GHCR. Recommended for deployment. | docker compose -f docker-compose.prod.yml up -d |
docker-compose.local-run.yml | Local Execution. For running the app on host while services run in Docker. | docker compose -f docker-compose.local-run.yml up -d |
docker-compose.base.yml | Base Configuration. Contains shared service definitions. | โ Do not use directly |
๐ Prerequisites
- ๐ณ Docker and Docker Compose
- ๐ Python 3.13+
- ๐๏ธ PostgreSQL with
pgvectorextension - ๐ Voyage AI API key
- ๐ฒ WhatsApp account for the bot
Quick Start
1. Clone & Configure
git clone https://github.com/YOUR_USER/wa_llm.git cd wa_llm
2. Create .env file
- Copy
.env.exampleto.envand fill in required values.
cp .env.example .env
Environment Variables
| Variable | Description | Default |
|---|---|---|
WHATSAPP_HOST | WhatsApp Web API URL | http://localhost:3000 |
WHATSAPP_BASIC_AUTH_USER | WhatsApp API user | admin |
WHATSAPP_BASIC_AUTH_PASSWORD | WhatsApp API password | admin |
VOYAGE_API_KEY | Voyage AI key | โ |
DB_URI | PostgreSQL URI | postgresql+asyncpg://user:password@localhost:5432/postgres |
LOG_LEVEL | Log level (DEBUG, INFO, ERROR) | INFO |
ANTHROPIC_API_KEY | Anthropic API key. You need to have a real anthropic key here, starts with sk-.... | โ |
LOGFIRE_TOKEN | Logfire monitoring key, You need to have a real logfire key here | โ |
DM_AUTOREPLY_ENABLED | Enable auto-reply for direct messages | False |
DM_AUTOREPLY_MESSAGE | Message to send as auto-reply | Hello, I am not designed to answer to personal messages. |
3. Starting the Services
Option A: Development (Build from source)
docker compose up -d
Option B: Production (Use pre-built images)
docker compose -f docker-compose.prod.yml up -d
4. Connect your device
- Open http://localhost:3000
- Scan the QR code with your WhatsApp mobile app.
- Invite the bot device to any target groups you want to summarize.
- Restart service:
docker compose restart wa_llm-web-server
5. Activating the Bot for a Group
-
open pgAdmin or any other posgreSQL admin tool
-
connect using
Parameter Value Host localhost Port 5432 Database postgres Username user Password password -
run the following update statement:
UPDATE public."group" SET managed = true WHERE group_name = 'Your Group Name'; -
Restart the service:
docker compose restart wa_llm-web-server
6. API usage
Swagger docs available at: http://localhost:8000/docs
Key Endpoints
- /load_new_kbtopic (POST) Loads a new knowledge base topic, prepares content for summarization.
- /trigger_summarize_and_send_to_groups (POST) Generates & dispatches summaries, Sends summaries to all managed groups
7. Opt-Out Feature
Users can control whether they are tagged in bot-generated messages (summaries, answers) by sending Direct Messages (DMs) to the bot:
| Command | Description |
|---|---|
opt-out | Opt-out of being tagged. Your name will be displayed as text instead of a mention. |
opt-in | Opt-in to being tagged (default). |
status | Check your current opt-out status. |
Note: This only affects messages generated by the bot. It does not prevent other users from tagging you manually.
๐ Production Deployment
To deploy in a production environment using the optimized configuration:
-
Create Production Environment File: Copy
.env.exampleto.env.prodand configure your production secrets.cp .env.example .env.prod -
Start Services:
docker compose -f docker-compose.prod.yml up -d
This configuration includes:
- Automatic restart policies (
restart: always)
Developing
Setup
Install dependencies using uv:
uv sync --all-extras --dev
Development Commands
The project uses Poe the Poet for task automation with parallel execution:
# Run all checks (format, then parallel lint/typecheck/test)
uv run poe check
# Individual tasks
uv run poe format # Format code with ruff
uv run poe lint # Lint code with ruff
uv run poe typecheck # Type check with pyright
uv run poe test # Run tests with pytest
# List all available tasks
uv run poe
The check command runs formatting first, then executes linting, type checking, and testing in parallel for faster execution.
Key Files
- Main application:
app/main.py - WhatsApp client:
src/whatsapp/client.py - Message handler:
src/handler/__init__.py - Database models:
src/models/
Architecture
The project consists of several key components:
- FastAPI backend for webhook handling
- WhatsApp Web API client for message interaction
- PostgreSQL database with vector storage for knowledge base
- AI-powered message processing and response generation
Contributing
- Fork the repository
- Create a feature branch
- Submit a pull request
License
Files in the repo
- .cursor
- .github
- .vscode
- app
- migrations
- notebooks
- src
- .dockerignore
- .env.example
- .gitignore
- .python-version
- AGENTS.md
- alembic.ini
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- conftest.py
- docker-compose.base.yml
- docker-compose.local-run.yml
- docker-compose.prod.yml
- docker-compose.yml
- Dockerfile
- LICENSE
- pyproject.toml
- README.md
- uv.lock
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More other

Your Personal AI Assistant; easy to install, deploy on your own machine or on the cloud; supports multiple chat apps with easily extensible capabilities.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
macOS video editor built for AI
Open-source Claude Design alternative. One-click import your Claude Code / Codex API key. Prompt โ prototype / slides / PDF. Multi-model (Claude, GPT, Gemini, Kimi, GLM, Ollama). BYOK, local-first, MIT.
๐คฏ LobeHub is your Chief Agent Operator, organizing your agents into 7ร24 operations by hiring, scheduling, and reporting on your entire AI team.