💡 inspiration
- With the elections just around the corner, it is imperative for the average voter to be educated on the public policies and bills that our politicians put forth.
- Poor literacy in American politics is a well-documented issue, with many citizens lacking a fundamental understanding of government structures, key political concepts, and how policies affect their lives. This lack of civic knowledge contributes to a disengaged electorate, misinformed opinions, and lower participation rates in democratic processes such as voting or local decision-making.
- As students seeking new, easy, creative ways to engage with our politicians, we built hamilton.
⚙️ what it does
hamilton is a multi-agent AI platform that simulates the dynamics of an actual senate committee hearing to lower the barrier to entry to the political sphere in an approachable manner. With real-time audio conversations between our senator agents, you can follow along with what bills and clauses senators are actively discussing and visualize the active changes they are making as they debate the outcomes and impacts of these bills. It enables you to learn about the process to go from a bill proposal to the final majority-approved outcome.
⛏️ how we built it: our process
Given the inherent complexity of our project, we spent a significant amount of our early time building a rock solid system infrastructure plan before touching any code. We narrowed down the sponsors that would best enable us to fulfill our vision, and laid out the data access objects, the communication channels between processes, and our tech stack. Below is a higher-level overview of our system design:

We then split up our project into sections that could be tested individually to then eventually integrate into the full system. In particular, we broke up the frontend UI and event handling, the REST and WebSocket-based backends for delivering bill outputs to the frontend, and an independent multi-agent system based on AutoGen. The latter required significant data collection for personalized Senator agents through various media sources. To parse and retrieve this data during runtime, we were able to set up a ChromaDB database for vectorized search quickly. This allowed us to provide the correct personality and historical context for each senator agent in relation to the user-submitted bill. For the Next.js frontend, we really loved using Cartesia’s fast and easy API for speech generation. Just using brief voice recordings of each senator, we were able to create expressive, emotional voice clones that we had a blast experimenting with. We envision adding more senators to our platform, which is easily possible with Cartesia’s voice cloning capabilities. To effectively track the evolving bills within Hamilton, we utilize Git version control. This approach enables us to maintain a comprehensive record of all changes, ensuring that each senator’s contributions are clearly documented. The version control system enhances transparency and provides deeper insights into this political process. This way, we can easily review the modifications made during discussions, allowing for a clearer understanding of the dynamics at play in the simulated senate committee hearings.
🛑 challenges we ran into
System Design: dealing with multiple asynchronous agents that we have to manage the communication between each other, the backend and the user interface. This was a very difficult task given both shared memory and concurrent communication we had to handle.
What helped was breaking it down into manageable and well defined functions, piecing together the broader system design from the ground up.
🏆 accomplishments that we're proud of
Conversational Multi-Agent Environment: Leveraging in-context learning with Autogen, we created a dynamic environment where multiple AI agents embody the unique views, behaviors, and mannerisms of real Senate members, bringing political debates to life.
Voice Simulation: With Cartesia’s cutting-edge, real-time inference technology, each senator is given a distinct voice, modeled after real-life voice data. This adds a new dimension of realism, enhancing user engagement and immersion.
Contextual Intelligence with Vector RAG: Using ChromaDB for advanced context retrieval, we ensured that each senator’s responses were hyper-contextualized to the bill at hand, delivering a more authentic and nuanced political dialogue.
Interactive and Gamified Frontend: Our intuitive, game-like interface replicates the Senate hearing process, making civic engagement accessible, engaging, and educational for the public.
code snippet
def choose_senators(self, clause: str, senator_data: dict[str, [dict[str, list[str]]]]) -> (Senator, Senator):
“”"Choose senators based on a probability distribution of most/least aligned with a clause.“”"
distribution = [0.35, 0.1, 0.05, 0.05, 0.1, 0.35]
alignments = []
for i, senator in enumerate(self.senators):
alignment = self.get_senator_alignment(clause, senator_data[senator.name])
alignments.append([i, alignment])
alignments = sorted(alignments, key=lambda x: x[1])
ids_only = [x[0] for x in alignments]
chosen_first = np.random.choice(ids_only, p=distribution)
print(“chosen first:“, chosen_first)
ids_only.pop(chosen_first)
removed_probability = distribution.pop(chosen_first)
distribution[-1] += removed_probability
chosen_second = np.random.choice(ids_only, p=distribution)
first_senator = self.senators[chosen_first]
second_senator = self.senators[chosen_second]
return first_senator, second_senator
🏫 what we learned
We learned a lot about web socket communication between the front end and back end. In addition, we learned about multi-agent frameworks and how to emulate personas to facilitate meaningful discussions about educational and political topics.
⏩ whats next for hamilton!
We envision hamilton as the next large platform for educational and political content. Because of the unique crossroads we find ourselves at —- with ML models able to engage in meaningful conversations—hamilton stands poised to revolutionize civic engagement and political literacy. Our platform will serve as an interactive space where users can immerse themselves in the legislative process without the intimidation often associated with politics. By simulating the dynamics of an actual Senate committee hearing, hamilton allows users to witness and participate in the decision-making process.
Built With
- autogen
- cartesia
- chromadb
- flask
- gitdiff
- groq
- next.js
- websockets
Log in or sign up for Devpost to join the conversation.