Inspiration
"It's 2025, where do I move!" This is a question we've been asking ourselves as we graduate to an uncertain political climate with this new presidential administration. And with recent executive orders and legislation that have challenged the rights of marginalized groups in the U.S. (women, POC, queer people, etc.), we noticed that a tool didn't exist so they can easily find spaces that are safe for them.
What it does
Virgil uses state legislation and county census information to inform users about places in the United States that may align with their preferences. Users can enter tag queries for important legislative issues (e.g. abortion, gun control, LGBTQ rights) and the map will recolor itself according to which states align most with those rights. By zooming in, users can get a more granular view of specific census data for each local county, e.g. income level & minority percentage to more closely tailor to their needs. These qualities make Virgil ideal for empowerment as well as educative for perspectives on issues in the U.S. as a whole.
How we built it
- Frontend: Svelte & Tailwind
- Data: LegiScan Bulk Pull API / PostgreSQL for state legislature, US Census for county data
- Backend: GPT-4o with retrieval-augmented generation (LangChain), uses recent legislation to stay up-to-date and accurate
- Redis for query caching
Challenges we ran into
- County-level legislation data isn't standardized, so we had to adapt
- US Census site wouldn’t provide an API key, so we manually pulled and transformed US census data
- Setting up LegiScan database
- Several issues trying to make the map elegant
Accomplishments that we're proud of
- Creating a very simple and easy-to-use GUI that is both elegant and easy to use
- Getting legislation info from every single state
- Accurate US Census data for each county
What we learned
- API fetches
- Svelte API setup
- Dynamic APIs using RAG and OpenAI
What's next for Virgil
- Create a pipeline so the state legislature can be ingested in real-time. Fairly simple, you just need to query LegiScan’s list of bills at regular intervals.
- Fetch local government legislation passed. Create more enhanced models capable of providing insight into the region including pending bills and most pressing issues.
- Ranking preferences
Disclosure
This project utilized Copilot and adjacent products to assist with code completion, however, all ideation/work is original and done during the duration of the hackathon in accordance with MLH rules.
Built With
- css
- csv
- faiss
- legiscan
- llm
- python
- rag
- redis
- svelte
- tailwind.js
- typescript
Log in or sign up for Devpost to join the conversation.