Core Concepts
Before diving into code, understand the mental models that shape how Pathfinder matches people to benefits.Pathfinder transforms the chaotic landscape of government benefits into a structured discovery experience. To work effectively with the codebase, internalize these five core concepts.
1. Programs Are Structured Data
Every benefit program—from federal SNAP to local utility assistance—is stored as a structured record with consistent fields. This enables searching, filtering, and automated eligibility checking.- Programs live in the
programstable with a consistent schema - Adding new fields doesn’t require code changes—just database columns
- The
search_vectorcolumn enables fast full-text search with ranking - Geographic filtering uses FIPS codes for precision
2. Eligibility Is Rule-Based
Each program has eligibility rules stored as JSON. The screener collects household data, then evaluates these rules to determine potential eligibility. Rules follow a composable structure:- Rules are data, not code—you can update eligibility without deploys
- The engine handles FPL calculations based on household size
- “Maybe eligible” is a valid result when data is incomplete
- Programs without explicit rules are assumed “possibly eligible”
3. Screening Is Progressive
Users don’t answer all questions upfront. The screener progressively refines matches as more information is provided. Each step:- Collects one piece of information
- Immediately updates the match count
- Shows progress toward personalized results
- The screener state tracks partial answers
- Match queries run after each step (debounced)
- Empty fields don’t disqualify—they reduce confidence
- Users can skip steps and return later
4. Geography Is Hierarchical
Benefits exist at multiple levels: federal, state, county, city. A user in Austin, Texas might qualify for:- Federal programs (SNAP, Medicaid)
- Texas state programs (CHIP, TWC)
- Travis County programs (housing assistance)
- City of Austin programs (utility assistance)
- ZIP to Coordinates: Geocode via Nominatim
- Coordinates to FIPS: Point-in-polygon to county FIPS code
- FIPS to Programs: Filter programs by coverage area
- Always store FIPS codes, not just city/state names
- Use the
geocoding.tsutilities for ZIP resolution - Some programs serve multiple counties—use array containment
- Federal programs use
coverage_states = ['*']for “all states”
5. Trust Is Earned Through Stories
Government benefits carry stigma. Many people won’t apply because they feel ashamed or assume “those programs aren’t for people like me.” Success stories counter this by showing real people—with faces and names—who benefited. Story data model:- Stories require moderation before publishing
- Anonymous stories show “Anonymous” but we track
author_idfor editing - The
quotefield enables compact display in carousels helpfulCountuses deduplicated voting (one per user/session)
How These Concepts Connect
A typical user flow:- User arrives at Pathfinder, browses programs by category
- Starts screener, enters ZIP code
- Engine matches programs by geography
- User provides income/household data
- Engine applies eligibility rules
- User sees personalized recommendations
- User saves programs to dashboard
- Calendar reminders for application deadlines
- After receiving benefits, shares success story