Skip to content

Phase 5d: Council Member Profiling #26

@kpeatt

Description

@kpeatt

Overview

Generate rich, AI-synthesized council member profiles from transcripts, votes, and motions — surfacing policy positions, legislative effectiveness, speaking patterns, voting alignment by topic, and notable moments.

Tasks

  • Schema: Create person_profiles table, agenda_item_topics table. Add pronouns and short_bio to people.
  • Topic taxonomy: Define MUNICIPAL_TOPICS (housing, transportation, environment, budget, etc.). Implement agenda item topic classifier. Backfill for all existing items.
  • Deterministic stats: compute_legislative_stats() (motion success, dissent rate, co-sponsorship), compute_speaking_stats() (segments/meeting, HHI, question rate), compute_alignment_by_topic(), detect_key_votes() (score 0-5).
  • AI profile generation: generate_position_summaries() (top 5 topics), detect_notable_moments(), generate_summary() (2-3 sentences), generate_short_bio() (one-liner).
  • Pipeline integration: Add --regenerate-profiles flag. Hook into post-ingestion. Incremental updates only for councillors with new data.
  • Profile page redesign: At-a-glance stat cards, AI summary, expandable policy position cards with stance indicators, key votes highlight reel, topic-scoped alignment selector, speaking profile charts.
  • RAG integration: Wire get_person_activity tool to read from person_profiles for quick stats.

Profile Page Layout (top to bottom)

  1. Header: Name, role, photo, short_bio, tenure
  2. At a Glance: Attendance rate (trend), voting record pie, motion success rate, dissent rate, speaking rank
  3. AI Summary: 2-3 sentence overview with timestamp and meeting count
  4. Policy Positions: Expandable cards per topic with stance indicator, summary, key quotes, key votes
  5. Key Votes: Top 5-10 most noteworthy votes with context
  6. Voting Alignment: Overall + topic-specific + time-series sparklines + bloc detection
  7. Speaking Profile: Topic distribution chart, role breakdown, debate engagement
  8. Electoral History (existing, moved lower)
  9. Full Records (moved to subpages)

Key Vote Detection Criteria (algorithmic, not AI)

  1. Councillor was in the minority
  2. Motion was close (passed/failed by 1-2 votes)
  3. Councillor broke from usual allies
  4. Councillor moved or seconded the motion
  5. Motion was on one of their top topics

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions