Privacy-aware activity tracking system that maintains awareness across applications and time, automatically surfacing relevant context when needed.
- Activity Monitoring: Tracks window focus, file access, and application usage
- Semantic Search: ChromaDB + SentenceTransformers for finding related contexts
- Temporal Graph: NetworkX-based knowledge graph with relationship decay
- Context Prediction: ML-based engine for predictive context delivery
- Privacy Controls: Blacklist apps, URLs, and directories
- Cross-Device Sync: API server for multi-device context sharing (optional)
context_engine/
├── storage/ # SQLite database for activities
├── vector_db/ # ChromaDB embeddings for semantic search
├── graph/ # Temporal knowledge graph
├── prediction/ # Context prediction engine
├── privacy/ # Privacy filtering
└── monitors/ # Activity monitoring (X11, filesystem)
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt./context_daemon.py# Show recent activities
./context_cli.py recent --hours 24
# Search for similar contexts
./context_cli.py search "working on Python project"
# Show statistics
./context_cli.py stats
# List contexts
./context_cli.py contexts
# Clean up old data
./context_cli.py cleanup --days 90Edit config/default_config.yaml to customize:
- Privacy settings (blacklists)
- Monitoring behavior
- Vector database settings
- Graph parameters
- Prediction thresholds
The engine is privacy-first:
- All data stored locally (no cloud)
- Configurable blacklists for apps, URLs, directories
- Sensitive data filtering (passwords, tokens, etc.)
- File type exclusions (
.key,.pem, etc.) - Can be disabled entirely per component
Default blacklists:
- Password managers (KeePassXC, Bitwarden)
- Login/password pages
- Private directories (
~/.ssh,~/.gnupg)
SQLite storage for all tracked activities, contexts, files, and applications.
ChromaDB vector database for semantic similarity search using SentenceTransformers.
NetworkX graph tracking temporal relationships between activities with decay over time.
Predicts relevant context using:
- Semantic similarity
- Temporal patterns
- Graph-based predictions
- Recent context continuation
Filters and sanitizes activity data based on privacy rules.
Monitors system activity:
- X11 window focus tracking
- Filesystem events (watchdog)
- Browser URL extraction (limited)
- Python 3.8+
- OpenSUSE Linux (or any Linux with X11)
- ~500MB disk space for embeddings model
- ~100MB for local data storage
Project tracked with Outcome Backcasting MCP.
View progress:
cd ~/Documents/PythonScripts/OutcomeBackcasting
./run_backcast.sh
# Load: context_continuity_engine.jsonMIT License - See LICENSE file
Derek M D Chan