Extract WhatsApp chat context for AI agents with RAG. Parse exports, extract decisions, tasks, and key information, then convert to embeddings for semantic search.
- Parse WhatsApp exports (.txt format)
- Classify messages: decision, task, info, question, other
- Extract key information: decisions, tasks, important links
- Create embeddings with Ollama or MiniMax
- Store in ChromaDB for semantic search
- CLI interface for easy usage
Unlike generic WhatsApp RAG solutions, this tool is designed for AI agent context:
- Selective extraction: Only important content (decisions, context, agreements)
- Rich metadata: Author, date, thread/chat ID
- Organized by project/topic: Index multiple chats by theme
- Incremental updates: Add new messages without reprocessing everything
- Direct context injection: Export to markdown for immediate AI agent use
git clone https://github.com/pepeneif/whatsapp-context-extractor.git
cd whatsapp-context-extractor
pip install -r requirements.txt# Parse a WhatsApp export
wce parse chat.txt --output chat.json
# Create embeddings and store in vector DB
wce embed chat.json --collection my_chat
# Search for context
wce search "what decisions were made" --collection my_chat
# Export to markdown for direct context injection
wce export --collection my_chat --format markdownCopy .env.example to .env and configure:
# Ollama (local, free)
EMBEDDER=ollama
OLLAMA_MODEL=nomic-embed-text
# Or MiniMax (API)
# EMBEDDER=minimax
# MINIMAX_API_KEY=your_keywhatsapp-context-extractor/
├── src/wce/
│ ├── __init__.py
│ ├── parser.py # Parse WhatsApp export
│ ├── extractor.py # Extract decisions, tasks, links
│ ├── chunker.py # Chunk with metadata
│ ├── embedder.py # Create embeddings
│ ├── vector_store.py # ChromaDB integration
│ └── cli.py # CLI interface
├── examples/
├── tests/
├── requirements.txt
└── README.md
- AI Agent Memory: Give your AI agents context from past conversations
- Project Documentation: Extract decisions and tasks from chat history
- Knowledge Base: Build searchable archive of important discussions
- Team Onboarding: Quick context for new team members
Contributions welcome! Please open an issue or PR on GitHub.
MIT