Skip to content

Latest commit

 

History

History
119 lines (87 loc) · 2.77 KB

File metadata and controls

119 lines (87 loc) · 2.77 KB

Quick Setup Guide

Issue: PyTorch DLL Error on Windows

The error you're seeing is a known Windows issue with PyTorch in virtual environments.

Solution: Use Docker (Recommended)

Docker provides a Linux environment that avoids Windows DLL issues:

1. Setup Environment File

# Copy template and edit with your keys
copy .env.template .env
notepad .env

Add your keys (both optional):

2. Start Services

docker-compose up -d

This creates:

  • PostgreSQL 15 with pgvector (port 5432)
  • FastAPI application (port 8000)

No pgAdmin setup needed - Docker manages everything!

3. Run Tests (in Docker)

# Run all tests
docker-compose exec api pytest tests/ -v

# Run specific test file
docker-compose exec api pytest tests/unit/test_models.py -v

# Run without clustering tests (if still issues)
docker-compose exec api pytest tests/ -v --ignore=tests/unit/test_clustering.py

4. Generate Demo Data

docker-compose exec api python scripts/generate_demo_data.py --count 100

5. Run Weekly Analysis

# Dry run (no Slack notification)
docker-compose exec api python scripts/weekly_run.py --dry-run

# Full run (requires Slack webhook)
docker-compose exec api python scripts/weekly_run.py

6. View Output

# Check logs
docker-compose logs -f api

# View generated files (on host)
dir logs\

Alternative: Fix Windows Environment (Advanced)

If you prefer running tests locally:

Option A: Install Visual C++ Redistributables

Download and install: https://aka.ms/vs/17/release/vc_redist.x64.exe

Option B: Skip Clustering Tests

.venv\Scripts\activate
pytest tests/ -v --ignore=tests/unit/test_clustering.py

The API and other tests will still run.

API Keys Summary

Required

  • None! System works with zero API keys (rules-only mode)

Optional (Enables Features)

  • GEMINI_API_KEY: Adds LLM-enhanced insights (free tier available)
  • SLACK_WEBHOOK_URL: Enables Slack delivery (free)

Database

  • Managed by Docker - no manual setup needed
  • PostgreSQL 15 with pgvector extension
  • Auto-initialized on first start
  • Data persists in postgres_data volume

Verify Installation

# Check services are running
docker-compose ps

# Test API
curl http://localhost:8000/health

# Check database
docker-compose exec db psql -U insightflow -d insightflow -c "\dt"

Next Steps

  1. ✅ Start Docker services
  2. ✅ Generate demo data
  3. ✅ Run analysis (dry-run)
  4. 🔧 Add Slack webhook (optional)
  5. 🔧 Add Gemini key (optional)
  6. 🚀 Set up n8n workflows (see n8n/workflows/README.md)