Your personal AI memory assistant via WhatsApp - Store, search, and retrieve memories using natural language through text and voice.
MemVault is a multi-tenant digital memory system that integrates with WhatsApp to provide seamless memory storage and retrieval. Send text or voice messages to store memories, and query them using natural languageβall encrypted and secure.
- π Multi-Tenant Authentication - Per-user isolation with WhatsApp phone verification
- π€ Voice-to-Memory - Automatic speech-to-text conversion using OpenAI Whisper
- π§ Intelligent Intent Detection - LLM-powered classification of store vs. query intents
- π Hybrid Search - BM25 + Vector search for optimal retrieval accuracy
- π Encryption at Rest - AES-256-GCM encryption for all stored memories
- β‘ Scalable Architecture - Designed for 1000s of concurrent users
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MEMVAULT ARCHITECTURE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββ βββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β WhatsApp ββββββΆβ Twilio API ββββββΆβ FastAPI Backend β β
β β Client βββββββ (Webhook) βββββββ β β
β βββββββββββββββ βββββββββββββββββββ β ββββββββββββββββββββββ β β
β β β Authentication β β β
β β β (Phone-based) β β β
β β ββββββββββββββββββββββ β β
β β β β β
β β βΌ β β
β β ββββββββββββββββββββββ β β
β β β LangGraph Flow β β β
β βββββββββββββββββββββββββββββββββββββββ β β β β β
β β LANGGRAPH WORKFLOW β β β ββββββββββββββββ β β β
β β β β β β VoiceβText β β β β
β β βββββββββββ βββββββββββββββ β β β β (Whisper) β β β β
β β β Input βββββΆβ Intent β β β β ββββββββ¬ββββββββ β β β
β β β Process β β Classifier β β β β β β β β
β β βββββββββββ β (LLM) β β β β βΌ β β β
β β ββββββββ¬βββββββ β β β ββββββββββββββββ β β β
β β β β β β β Intent β β β β
β β ββββββββββββββ΄ββββββββ β β β β Classifier β β β β
β β β β β β β β (LLM) β β β β
β β βΌ βΌ β β β ββββββββ¬ββββββββ β β β
β β ββββββββββββ ββββββββββββ β β β β β β
β β β STORE β β QUERY ββ β β ββββββ΄βββββ β β β
β β β Memory β β Search ββ β β β β β β β
β β ββββββ¬ββββββ ββββββ¬ββββββ β β βΌ βΌ β β β
β β β β β β β Store Search β β β
β β ββββββββββ¬ββββββββββββ β β β Memory Memory β β β
β β βΌ β β ββββββββββββββββββββββ β β
β β βββββββββββββββ β ββββββββββββββββββββββββββββ β
β β β Response β β β
β β β Generator β β β
β β βββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β DATA LAYER β β
β β β β
β β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ β β
β β β PostgreSQL β β Qdrant β β β
β β β β β β β β
β β β β’ User accounts β β β’ Vector embeddings (encrypted) β β β
β β β β’ Auth tokens β β β’ BM25 sparse vectors β β β
β β β β’ Audit logs β β β’ Multi-tenant collections β β β
β β β β’ Usage metrics β β β’ Hybrid search indexes β β β
β β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ β β
β β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
memvault/
βββ backend/
β βββ app/
β β βββ api/ # FastAPI routes & webhooks
β β β βββ __init__.py
β β β βββ routes.py # API endpoints
β β β βββ webhooks.py # WhatsApp/Twilio webhooks
β β βββ core/ # Core configuration
β β β βββ __init__.py
β β β βββ config.py # Settings & environment
β β β βββ security.py # Encryption & auth
β β β βββ exceptions.py # Custom exceptions
β β βββ db/ # Database layer
β β β βββ __init__.py
β β β βββ postgres.py # PostgreSQL models & queries
β β β βββ qdrant.py # Qdrant vector DB operations
β β βββ llm/ # LangGraph & AI components
β β β βββ __init__.py
β β β βββ graph.py # LangGraph workflow
β β β βββ embeddings.py # Text embeddings
β β β βββ whisper.py # Speech-to-text
β β βββ services/ # Business logic
β β β βββ __init__.py
β β β βββ memory.py # Memory CRUD operations
β β β βββ search.py # Hybrid search implementation
β β βββ main.py # FastAPI application entry
β βββ tests/ # Test suite
β β βββ __init__.py
β β βββ conftest.py # Pytest fixtures
β β βββ test_api.py # API endpoint tests
β β βββ test_graph.py # LangGraph workflow tests
β β βββ test_search.py # Search functionality tests
β β βββ test_security.py # Encryption tests
β βββ Dockerfile
β βββ requirements.txt
β βββ pyproject.toml # Kubernetes manifests
βββ docs/ # Documentation
β βββ api.md # API documentation
β βββ deployment.md # Deployment guide
β βββ architecture.png # Architecture diagram
βββ scripts/ # Utility scripts
β βββ setup.sh # Development setup
β βββ migrate.py # Database migrations
βββ .env.example # Environment template
βββ .gitignore
βββ LICENSE
βββ README.md
- Python 3.11+
- Docker & Docker Compose
- Twilio account with WhatsApp sandbox
- OpenAI API key
- Qdrant Cloud or local instance
git clone https://github.com/yourusername/memvault.git
cd memvault
# Copy environment template
cp .env.example .envEdit .env with your credentials:
# API Keys
OPENAI_API_KEY=sk-...
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
TWILIO_WHATSAPP_NUMBER=
# Database
POSTGRES_URL=postgresql://user:pass@localhost:5432/memvault
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=your-qdrant-key
# Security
ENCRYPTION_KEY=your-32-byte-base64-key
JWT_SECRET=your-jwt-secret
# Observability
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
PROMETHEUS_PORT=9090# Start all services (dev mode)
docker-compose up -d
# Check logs
docker-compose logs -f backend- Go to Twilio Console
- Set webhook URL:
https://your-domain.com/api/v1/webhook/whatsapp - Join the sandbox: Send "join " to the WhatsApp number
Send a message to your WhatsApp bot:
- Store a memory: "Remember that my favorite restaurant is Sushi Ko on Main Street"
- Query memories: "What's my favorite restaurant?"
- Voice notes: Send a voice message and it will be transcribed and processed
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key for embeddings & LLM | β |
TWILIO_ACCOUNT_SID |
Twilio account SID | β |
TWILIO_AUTH_TOKEN |
Twilio auth token | β |
TWILIO_WHATSAPP_NUMBER |
WhatsApp-enabled number | β |
POSTGRES_URL |
PostgreSQL connection string | β |
QDRANT_URL |
Qdrant server URL | β |
QDRANT_API_KEY |
Qdrant API key | β |
ENCRYPTION_KEY |
32-byte base64 key for AES-256 | β |
JWT_SECRET |
Secret for JWT tokens | β |
LOG_LEVEL |
Logging level (DEBUG/INFO/WARNING) | β |
MAX_MEMORIES_PER_USER |
Memory limit per user | β |
OTEL_EXPORTER_OTLP_ENDPOINT |
OpenTelemetry endpoint | β |
python -c "import secrets; import base64; print(base64.b64encode(secrets.token_bytes(32)).decode())"# Run all tests
pytest
# Run with coverage
pytest --cov=app --cov-report=html
# Run specific test file
pytest tests/test_api.py -v
# Run integration tests
pytest tests/ -m integration# Build production image
docker build -t memvault:latest ./backend
# Run with production compose
docker-compose -f infra/docker-compose.prod.yml up -d| Environment | Config File | Notes |
|---|---|---|
| Development | docker-compose.yml |
Hot reload, debug logging |
| Staging | docker-compose.staging.yml |
Test webhooks, sandbox |
| Production | docker-compose.prod.yml |
Full HA, autoscaling |
- At Rest: AES-256-GCM encryption for all memory content
- In Transit: TLS 1.3 for all connections
- Keys: Environment-based key management (use Vault in production)
- Phone number verification via Twilio
- JWT tokens with configurable expiry
- Rate limiting per user
- Complete data isolation per user
- Separate Qdrant collections per tenant
- Row-level security in PostgreSQL
- PostgreSQL: Connection pooling with PgBouncer
- Qdrant: Distributed mode with sharding
- Stateless FastAPI workers behind load balancer
- Redis for session state (if needed)
- Kubernetes HPA for auto-scaling
- Fork the repository
- Create a feature branch (
git checkout -b feature/great-feature) - Commit changes (
git commit -m 'Add great feature') - Push to branch (
git push origin feature/great-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file.
- LangGraph - Workflow orchestration
- Qdrant - Vector database
- FastAPI - Web framework
- Twilio - WhatsApp integration
vibe coded with β€οΈ for the future of personal memory