- ✅ PostgreSQL 15 + pgvector database (running in Docker)
- ✅ SQLAlchemy models (CoreEvent, CoreTopic, CoreEventTopic, OutWeeklyBrief)
- ✅ FastAPI ingestion endpoints (
/ingest/email,/ingest/meeting) - ✅ Metrics computation engine (windows, deltas, trends)
- ✅ n8n workflow templates (Gmail + Read.ai)
- ✅ Sentence-transformers embeddings (all-MiniLM-L6-v2, 384 dimensions)
- ✅ HDBSCAN clustering (euclidean metric, CPU-optimized)
- ✅ Topic detection and persistence
- ✅ 4 deterministic rules engine:
- Emerging Risk
- Avoided Decision
- Attention Sink (✓ detected 2 findings!)
- Scope Creep
- ✅ Gemini LLM integration (optional enhancement)
- ✅ Markdown renderer (brief, watchlist, audit)
- ✅ Slack notifier (Block Kit formatted)
- ✅ Weekly orchestration script
- ✅ Docker deployment (2GB image, CPU-only)
Week Analyzed: Dec 30, 2025 - Jan 6, 2026
Events Processed: 15 events
Clusters Found: 2 topics
Findings Generated: 2 (both attention sink detections)
- 📉 Event volume dropped 81.5% (-66 events)
⚠️ alice@company.com handling 33% of inbound⚠️ diana@company.com handling 33% of inbound- 📋 5 decisions pending, 5 require follow-up
Status: ✅ System successfully generated first weekly brief!
# Start services
docker-compose up -d
# Check status
docker-compose ps
# Run weekly analysis (saves to database)
docker-compose exec api python scripts/weekly_run.py --skip-slack
# Export brief from database
docker-compose exec api python -c "from src.insight.db import SessionLocal; from src.insight.models import OutWeeklyBrief; db = SessionLocal(); brief = db.query(OutWeeklyBrief).first(); print(brief.markdown)" > weekly_brief.md
# View logs
docker-compose logs -f api
# Stop services
docker-compose down# All tests
docker-compose exec api pytest tests/ -v
# Specific tests
docker-compose exec api pytest tests/unit/test_models.py -v
docker-compose exec api pytest tests/api/test_ingest.py -v# Clear old data and generate fresh events
docker-compose exec db psql -U postgres -d postgres -c "DROP DATABASE IF EXISTS insightflow; CREATE DATABASE insightflow;"
docker-compose restart api
timeout /t 10
docker-compose exec api python scripts/generate_demo_data.py --count 100 --init-db- ✅
GEMINI_API_KEY- Configured (LLM enhancement - optional) - ✅
SLACK_WEBHOOK_URL- Configured for#strategic-insights - ✅
DATABASE_URL- Auto-configured by Docker
- Embedding Model:
all-MiniLM-L6-v2(CPU) - LLM Model:
gemini-1.5-pro - Clustering: HDBSCAN with
min_cluster_size=3 - Database: PostgreSQL 15 + pgvector
Error: Unknown field for GenerationConfig: response_mime_type
Cause: google-generativeai library version mismatch
Impact: Brief still generates using rules-only (deterministic insights work fine!)
Fix (Optional):
docker-compose exec api pip install --upgrade google-generativeai
docker-compose restart apiCause: PowerShell encoding
Impact: Visual only - files are correct
Fix: Open files in VS Code: code weekly_brief_2026-01-06.md
- Weekly briefs stored in
out_weekly_briefstable - Access via:
docker-compose exec api python -c "..."
weekly_brief_2026-01-06.md- Main strategic insights ✅
# Update to latest google-generativeai
docker-compose exec api pip install --upgrade google-generativeai
docker-compose restart api
# Test LLM
docker-compose exec api python scripts/weekly_run.py --skip-slack- Import n8n workflows from
n8n/workflows/ - Configure Gmail OAuth or Read.ai webhook
- Point to your API:
http://localhost:8000/ingest/email
Windows Task Scheduler:
# Create scheduled task to run weekly_run.bat every Monday at 9 AM
schtasks /create /tn "InsightFlow Weekly" /tr "C:\Users\testing\Documents\InsightFlow\run_analysis.bat" /sc weekly /d MON /st 09:00- Update
.envwith production credentials - Set up HTTPS reverse proxy (nginx/Caddy)
- Configure proper database backups
- Set up monitoring (Prometheus + Grafana)
- PROJECT_DOCUMENTATION.md - Complete architecture
- SETUP_GUIDE.md - Detailed setup instructions
- DOCKER_GUIDE.md - Docker command reference
- n8n/workflows/README.md - Integration guide
| Metric | Status |
|---|---|
| Database Setup | ✅ PostgreSQL + pgvector |
| API Endpoints | ✅ 2 ingestion endpoints |
| Embedding Generation | ✅ 15 events embedded |
| Topic Clustering | ✅ 2 clusters detected |
| Rules Engine | ✅ 2 findings generated |
| Brief Generation | ✅ Markdown created |
| Docker Deployment | ✅ 2GB image, CPU-only |
| Tests Coverage | ✅ Unit + API tests |
- Run in Docker - Avoids Windows PyTorch DLL issues
- Use
--skip-slack- Test without sending to Slack - Check logs -
docker-compose logs -f apifor debugging - Export briefs - Database stores all historical briefs
- Generate fresh data - Use
generate_demo_data.pyfor testing
🎉 Congratulations! Your InsightFlow system is fully operational and generating strategic insights from event data!