Intelligent query validation with context-aware pattern detection for Intent and B2B search.
- Context-Aware Detection: Intelligent pattern matching instead of keyword lists
- Smart Mode Separation: Understands context, not just keywords
- 7-Rule Validation System: Comprehensive query quality analysis
- Real-Time Feedback: Instant validation as you type
- No False Positives: Distinguishes between topics and filters
- Advanced Options: Context phrases, lens, and granularity controls
Instead of hard-coded keyword lists, Spark V2 uses intelligent pattern detection:
- β Allows: "interested in San Francisco culture" (topic of interest)
- β Blocks: "people in San Francisco" (location filter)
- Logic: Only flags when location is used to filter WHO people are
- β Detects: "software engineers", "product managers", "CEOs"
- β Handles: Plurals, compound titles, variations
- Logic: Regex patterns match job title structures
- β Detects: "interested in", "passion for", "care about"
- β Context: Distinguishes intent signals from forbidden terms
- Logic: Pattern-based behavioral signal detection
FORBIDDEN (context-aware detection):
- β Personas: Job titles, roles (e.g., "software engineers", "CEOs")
- β Demographics: Age, gender, income, education
- β Location Filters: "people in [Location]", "based in [Location]"
ALLOWED:
- β Location Topics: "interested in San Francisco culture"
- β Behavioral Intent: "interested in", "passion for", "care about"
REQUIRED:
- β Intent Signals: Must include behavioral language
Example Good Query:
people interested in sustainable living and environmental conservation
Example Bad Query:
software engineers in San Francisco interested in AI
Fails: persona "software engineers" + location filter "in San Francisco"
FORBIDDEN (pattern detection):
- β Intent Language: "interested in", "looking for", "want to"
- β Behavioral Signals: "recently", "about to", "planning to"
REQUIRED:
- β Company Attributes: "companies", "revenue", "employees", "industry"
Example Good Query:
SaaS companies with 50-200 employees generating $5M-$20M annual revenue
Example Bad Query:
companies interested in adopting AI technologies
Fails: intent language "interested in"
- Length Check (10% weight) - 10-500 characters optimal
- No Marketing Language (15% weight) - Forbid vague terms
- No Questions (15% weight) - Keywords only
- Mode Purity (30% weight) - MOST IMPORTANT - Context-aware separation
- Specificity (15% weight) - Concrete details
- No Keyword Stuffing (10% weight) - Avoid repetition
- Actionability (5% weight) - Clear and actionable
Mode Purity (30% weight) has the highest impact:
- 1 violation β 40/100 score (~18-point penalty)
- 2 violations β 20/100 score (~24-point penalty)
- 3+ violations β 0/100 score (~30-point penalty)
β Pass (97/100):
people interested in artificial intelligence and machine learning technologies
β Pass (97/100):
people interested in San Francisco culture and Bay Area lifestyle
Topic, not filter - correctly allowed
β Fail (79/100):
software engineers interested in AI
Persona detected: "software engineers"
β Fail (73/100):
people in San Francisco interested in technology
Location filter detected: "people in San Francisco"
β Pass (100/100):
SaaS companies with 50-200 employees generating $5M-$20M annual revenue
β Fail (79/100):
companies interested in cloud computing technologies
Intent language detected: "interested in"
# Install dependencies
pnpm install
# Start development server
pnpm run dev
# Build for production
pnpm run build
# Preview production build
pnpm run preview- Total (gzipped): 147.57 KB
- JavaScript: 143.23 KB
- CSS: 4.04 KB
- HTML: 0.34 KB
- Status: β Under 150KB target
- React 19.2.3 - UI framework
- TypeScript 5.9.3 - Type safety
- Vite 7.2.7 - Build tool
- Tailwind CSS 4.1.18 - Styling
- Radix UI - Accessible components
- Lucide React - Icons
- Wouter - Lightweight routing
src/
βββ components/ # UI components
β βββ ModeSelector.tsx # Intent vs B2B toggle
β βββ QueryInput.tsx # Query input with counts
β βββ ValidationDisplay.tsx # Score & rules display
β βββ AdvancedOptions.tsx # Collapsible options
βββ lib/
β βββ queryValidation.ts # Context-aware validation
β βββ utils.ts # Utility functions
βββ pages/
β βββ SparkPage.tsx # Main page
βββ App.tsx # Routing
βββ main.tsx # Entry point
βββ index.css # Global styles
- Context-Aware: Intelligent pattern detection
- Minimal Dependencies: Only 14 packages
- Simple Components: 4 focused components
- Performance First: Bundle under 150KB
- Accessible: Keyboard navigation, ARIA labels
- Responsive: Mobile-first design
MIT
Built with context-aware intelligence for maximum accuracy and minimal false positives.