Table Number: 340
Inspiration
Politics is a black box. Most Americans today only know the 2 political parties, and not much else. We realized that this is an area in which we can have an impact. We want to use AI to create more informed civilians and connect them with an intuitive and politically focused social media platform. Billy gives everyone the ability to participate in the legislative process and develop a more politically inclined mindset.
What it does
Billy's goal is to create informed political engagement online by utilizing AI supplemented with an enormous database of American legislation to help users write their own bills. Once a bill is created with Billy, it is posted, allowing other users to interact with it. Users can explore legislation ideas, vote on issues they have opinions about, and leave comments and feedback. Billy enables the public to become more engaged in government by creating an environment where every user has a thoughtful dialogue with other users, developing new perspectives and sharing ideas. Through this, we hope to create a new, accessible environment for public political discussion.
How we built it
Billy starts with bill generation. We start by initiating a conversation with a user to understand what they’re looking for in a bill. The user is given guiding questions about their bill, and each response contributes to the creation of a general summary of their bill.
We’ve embedded thousands of real Senate bills into a Pinecone vector database to semantically search bills using cosine similarity. We find the closest possible bill that encapsulates what the user wants. Once found, we use the U.S. Congress API to get the full text of the bill. Billy uses that as context to create the user’s new bill, along with current information gathered about the relevant topics.
To get up-to-date information, we utilize the you.com Research API in parallel to find the 5 most relevant news articles related to the user's bill. This allows Billy to have a better understanding of current events, and ultimately create a more realistic bill.
After the bill is created, we use Anthopic’s claude-3-5-sonnet model to evaluate the political alignment of the bill, which we measure on a scale from -10 to 10, with -10 being very liberal and 10 being very conservative.
Billy's social side:
Billy is a web app powered by Next.js. We integrated several libraries, as well as a plethora of our own logic to create a clean interface. All of the data for the web app is stored in a PostgreSQL database. We use the Prisma ORM to easily map database tables to Typescript objects. NextAuth.js allows us to authenticate users with Google, while still storing all the data in our own database. For UI, we’ve pulled some components from shadcn-ui, tailoring them to our own purposes. To protect access to third-party services, we’ve built a REST API that stands between our frontend UI running on users’ browsers and the backend services running on our server. The site is hosted on Vercel, allowing for automatic continuous deployments from GitHub.
Challenges we ran into
Issues we encountered with the AI aspects were primarily in bill generation. Our initial hope was to use Amazon Bedrock and multiple bills as a reference for the generation, but due to token limitations and errors with using the Bedrock API, we pivoted to using OpenAI instead.
On the web development side, our main source of struggle was the integration of several libraries and technologies that we hadn’t used before, such as NextAuth.js, Prisma ORM, and the new Next.js App Router. We also faced issues in our API endpoints taking too long to process, leading to Vercel timing out our serverless functions.
Despite that, we were able to find solutions to all of our problems, and we created a successful first iteration of Billy.
Accomplishments that we're proud of
We’re proud of our bill generation pipeline, as we were able to effectively combine several different LLMs, resulting in a user-friendly interface to solve the complex task of writing legislation.
We are also proud of our UI as our product gives the user an intuitive and beautiful interface to increase their knowledge of government, and interact with their community to create a better future together.
Despite the aforementioned struggles, we effectively used new libraries with which we had no prior experience. We are very proud of our team for overcoming these challenges and learning about many tools, while building a tool that can be utilized in the real world.
What we learned
While building Billy, we learned different methods of building RAG tools and how to optimize the output of LLM responses for our use case. We also learned how to use unique APIs such as You.com to enable web searches within our bill generation pipeline.
We also learned several web development technologies with which we had little to no prior experience, such as Next.js 14, Prisma ORM, NextAuth.js, and PostgreSQL.
What's next for Billy
- Expanding the Vector Database to include all US bills in the ProPublica library
- Optimizing the AI layer to create better bills
- Experimenting with different tools such as RAFT instead of RAG, perhaps fine-tuning our model, or utilizing different prompts to create better responses.
- We also want to enhance user content
- Analysis of the bill’s ability to pass and be signed into law
- Ability to edit bills created by users
- Social media features
- Tags for bills to allow users to subscribe to issues they are interested in
- Sharing to other platforms
- Sub-forums
- Credit system for more engaged users
- Educational Features
- Resources to understand the political environment
- More engagement and interaction between the real government and Billy’s platform
- Intuitive methods for users to be updated on real-time legislation while still on the platform
- Implementing class codes so Billy can be used in classrooms around the US
This is a very small list of improvements to be made. Billy is full of potential and we are excited as we see incredible amounts of features that would enhance the user’s experience with the platform.
Built With
- anthropic
- claude
- javascript
- next.js
- nextauth.js
- openai
- pinecone
- postgresql
- prisma
- react
- typescript
- vercel
- you.com
Log in or sign up for Devpost to join the conversation.