The repo ships a single source of truth for all Typesense collections in config/typesense-schema.js. This guide summarises each schema, its key fields, and the features that depend on them.
Purpose: describe government programs/benefits and link them back to authoritative fragments.
Field clusters:
- Identity:
id,service_name, optionalservice_code. - Provider metadata:
provider,governance,department(all facet-enabled). - Taxonomy:
life_events,categoriesfor surfacing in UI filters and MCP tools. - Eligibility: numeric bounds (
min_age,max_income, etc.),eligibility_statuses,residency_requirements,citizenship_requirements, document lists, andeligibility_rulesblobs for OpenFisca alignment. - Service logistics:
service_type,delivery_method, optional payment frequency/amount, incompatible/related services, andgateway_servicepointers. - Content linkage:
fragment_ids,primary_url,urls, pluskeywords/common_namesfor search synonyms. - Operations: timestamps (
last_updated,review_date),popularity_score, booleanis_active.
Used by: ProfileMatcher, journey builder, future service-centric APIs.
Purpose: atomic pieces of content tied to specific headings/anchors and enriched for retrieval.
Field clusters:
- Versioning:
crawl_version,last_seen_atensure dedupe + stale pruning. - Core content:
url,page_url,anchor,title,content_text, optionalcontent_html. - Hierarchy:
site_hierarchy,page_hierarchy,hierarchy_lvl0-3used by graph explorer and Typesense facets. - Taxonomy + provenance:
categories,states,provider,governance,component_type,has_form,has_checklist,reading_level. - Presentation: non-indexed
classesandstyles_raw(inline + computed) so the UI can recreate styling when embedding snippets. - Relationships:
parent_id,child_ids,related_idsfor nestable tasks, plusservice_idbridging toservices. - Eligibility: numerical thresholds,
required_*arrays,children_age_ranges,typical_duration_days,urgency_score,completion_likelihood. - Search helpers:
search_keywords,task_order,embedding(768-dim),popularity_sort,srrs_score.
Used by: /api/fragments/*, MCP search tools, journey builder (eligibility filters), fragment visualiser, overlap comparisons.
Purpose: aggregated per-URL documents derived from fragments for overlap analysis, CSV exports, and similarity calculations.
Field clusters:
- Identity:
crawl_version,last_seen_at,url,host, optionaltitle/content_text. - Primary tagging: authoritative
life_events,primary_life_event,stage,stage_variant(UI lifecycles depend on these facets). - Aggregated taxonomy: union of fragment
categories,states,provider,governance. - Eligibility roll-ups:
eligibility_statuses,typical_age_range,typical_duration_days. - Relationships:
fragment_ids,fragment_countused for coverage metrics. - Similarity signals:
keywords, 256-dimembedding,out_links,out_link_tokenspowering/api/pages/similarityand graph views.
Purpose: persist structured user inputs for journey generation and service matching.
Fields capture demographics, finances, status, caring responsibilities, children metadata, life events, disasters, and timestamps.
Purpose: express transitions between life events and supply 2D/3D co-ordinates for the journey visualiser.
Key fields: event_name, event_type, adjacency lists (prerequisites, next_states, concurrent_allowed, mutually_exclusive), demographics, typical_duration_days, cluster, optional position_z.
scraper/scraper.jscallscollections().update({ fields })to backfill any missing definition so you can add new fields directly toconfig/typesense-schema.jsand rerun the scraper.- Keep field additions backward-compatible (mark optional where possible) to avoid breaking existing docs.
- Collections referenced by the API (
content_fragments,content_pages,life_event_graph,services) must retain the exact names defined here; update both the schema file and the consuming routes if you rename them.