Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Context Extractor

Extract WhatsApp chat context for AI agents with RAG. Parse exports, extract decisions, tasks, and key information, then convert to embeddings for semantic search.

Features

  • 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

What Makes It Unique

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

Installation

git clone https://github.com/pepeneif/whatsapp-context-extractor.git
cd whatsapp-context-extractor
pip install -r requirements.txt

Usage

# 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 markdown

Configuration

Copy .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_key

Project Structure

whatsapp-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

Use Cases

  • 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

Contributing

Contributions welcome! Please open an issue or PR on GitHub.

License

MIT

About

Extract WhatsApp chat context for AI agents with RAG

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages