Project Info
💡 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 🏫 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.
Analysis
View
Metric
- 18
- 15
- 13
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- Next.jsIn code
- PythonIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
- FlaskClaimed
6 of 7 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
184 KB
Source files
22
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
tejasprabhune/hamilton
64 files · 18.5 MB · @ 5135d1d
Structure
Interface
11 files · 17%Screens, components and styles rendered to the user.
Application logic
19 files · 30%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- YAML59%
- Python15%
- CSS15%
- TypeScript10%
- Markdown1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi · 42- aiohappyeyeballs
- aiohttp
- aiosignal
- annotated-types
- apispec
- attrs
- bech32
- black
- certifi
- charset-normalizer
- click
- cosmpy
- ecdsa
- frozenlist
- googleapis-common-protos
- grpcio
- h11
- idna
- +24 more
frontend/package.json
npm · 16- @cartesia/cartesia-js
- buffer
- difflib
- dotenv
- fast-base64
- next
- react
- react-dom
- +8 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
Bill parsing into clausesVerified
Follow along with what bills and clauses senators are actively discussing
Claimed on Devposthigh confidencebackend/simulation.py:20— open_bill() reads agriculture_bill.txt and splits it into clauses by SECTION markersbackend/server.py:19— /start_sim endpoint returns parsed clauses to the frontend
Cartesia voice cloning / text-to-speech for senatorsVerified
Real-time audio conversations between senator agents using Cartesia voice cloning for distinct senator voices
Claimed on Devposthigh confidencefrontend/src/app/bill.tsx:88— voiceToKeyMap maps each senator name to a distinct Cartesia voice id, and handlePlay calls tts.buffer/tts.play with the matched voice and dialoguefrontend/src/components/CartesiaTTS.tsx:5— useTTS from @cartesia/cartesia-js/react is used to buffer and play speech
ChromaDB vector RAG for senator context retrievalVerified
ChromaDB used for advanced vector context retrieval so senator responses are hyper-contextualized to the bill
Claimed on Devposthigh confidencebackend/senator.py:38— create_db() builds a chromadb.PersistentClient with collections per data label (tweet/website/voting), and query() runs a vector query against thembackend/simulation.py:106— Simulation.get_data calls senator.query() with an LLM-generated search string to retrieve relevant senator context per clause
Flask REST backend serving bill/clause dataVerified
REST-based backend for delivering bill outputs to the frontend (Flask)
Claimed on Devposthigh confidencebackend/server.py:7— Flask app defined with CORS, exposing /start_sim GET endpoint that returns parsed bill clauses; /debate and /vote routes are stubbed with only 'pass'
Interactive/gamified Senate hearing frontendVerified
Interactive and gamified frontend replicating the Senate hearing process for civic engagement
Claimed on Devpostmedium confidencefrontend/src/components/SenateRoom.tsx:6— SenateRoom renders senator avatars and animates the active speaker (zoom-in class) based on activeSpeaker propfrontend/src/app/bill.tsx:186— StartSim provides a 'start the senate' button and clickable bill clauses that trigger TTS playback
Multi-agent senator debate simulation (AutoGen)Verified
Multi-agent AI platform simulating senate committee hearing debates using AutoGen agents
Claimed on Devposthigh confidencebackend/senator_debate.py:44— Uses autogen.AssistantAgent, UserProxyAgent, GroupChat and GroupChatManager to run a debate between two senator personas over a bill clausebackend/simulation.py:206— Simulation.start_simulation instantiates SenatorDebate per clause and runs it as an asyncio task
Real-time WebSocket delivery of debate/clause updates to frontendVerified
Real-time audio conversations and visualized active changes as senators debate, delivered via WebSocket backend
Claimed on Devposthigh confidencebackend/simulation.py:229— create_websocket serves the simulation over a websockets server on localhost:8765backend/senator_debate.py:111— state_transition sends updated clause/dialogue/senator JSON over the socket after each debate turnfrontend/src/app/page.tsx:10— StartWebSocket connects to ws://localhost:8765 and updates clause state from incoming messages
Senator persona data via personalized tweets/website/voting recordVerified
Personalized Senator agents built from various media sources with data collection per senator
Claimed on Devposthigh confidencebackend/senator.py:18— Senator loads tweet_data, website_data and voting_data files per senator namesenator_data/tweet_data/booker.txt— Actual per-senator tweet/website/voting data files exist in senator_data/
Senator selection weighted by alignment with clause (probabilistic debate pairing)Verified
Simulates senate committee dynamics as senators debate outcomes based on their alignment with bill content
Claimed on Devposthigh confidencebackend/simulation.py:146— get_senator_alignment asks the LLM to score a senator's alignment with a clause from their databackend/simulation.py:166— choose_senators picks two senators via np.random.choice weighted by a probability distribution over sorted alignment scores
README setup instructions (venv, pip install, run server.py)Code-supported
Create a Python virtual environment, pip install -r requirements.txt, run backend via python3 server.py
Claimed on readmemedium confidencebackend/server.py:51— server.py exists and is runnable as described, but root requirements.txt does not include flask, autogen, chromadb, groq, or websockets which server.py and its imports depend on, so pip install -r requirements.txt alone would not satisfy the app's actual imports
Visualize bill clause changes / diff as senators debateCode-supported
Visualize the active changes senators are making as they debate outcomes and impacts of bills
Claimed on Devpostmedium confidencefrontend/src/app/page.tsx:32— generateDiffHtml (using difflib) is called on incoming websocket clause updates to build a diff, but the returned htmlDiff is only logged to console, not rendered into clause UI statefrontend/src/app/bill.tsx:11— generateDiffHtml builds colored insertion/deletion spans from difflib.Differ, but this diff-rendering path is not confirmed to reach the displayed clause div (dangerouslySetInnerHTML uses htmlContent state, not the diff output)
Git version control used to track evolving bill changes across senator contributionsClaimed only
Utilizes Git version control to track evolving bills, maintaining a record of all changes and each senator's contributions
Claimed on Devposthigh confidenceMajority vote outcome on bill / final majority-approved outcomeClaimed only
Learn about the process to go from a bill proposal to the final majority-approved outcome
Claimed on Devposthigh confidence
An AI agent derived these features from the project’s Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.