Inspiration
Electra was inspired by the complexity of modern elections. Traditional polls and static models often fail to capture dynamic voter behavior, especially in battleground states where every news cycle can shift the race. By leveraging LLM agents and a custom framework, Electra brings a cutting-edge solution to predict elections way better than conventional methods.
What We Learned
Throughout this project, we gained valuable insights into the intricacies of building multi-agent systems and leveraging them for simulations. Specifically, we learned how to:
- Model voter behavior based on census data and AI agent backstories.
- Create an collaborative framework where agents can interact and chat with one another to accomplish any task
- Utilize modern AI/ML solutions like Cerebras and LLM's like Llama 3.1 for instantaneous inference
- Generate agents on-the-fly that are fully representative of the general populace, while ensuring the system remains explainable and accurate
How We Built Electra
Electra was built using a custom multi-agent framework designed from scratch. Our goal was to simulate election results in battleground states by creating agents that behave like real voters. Here's how the process unfolded:
- We began by using US census data to replicate voter districts.
- We developed agents with rich backstories, programming them to "think" like voters in various demographics.
- Agents were then embedded into conversational group chats to simulate how they would react to hypothetical scenarios (e.g., Donald Trump launching his own cryptocurrency).
- We visualized the results in real time using an interactive map and communication logs, ensuring full transparency of the agents' interactions and decision-making processes.
The entire backend was in Python. Node.js manages server-side logic to facilitate smooth communication between the front end and back end. For the user interface, we used React to create a responsive experience, while D3.js handles dynamic data visualizations that allow users to interpret sentiment trends easily. Geographic data is represented using GeoJSON, enabling users to visualize public sentiment across various regions effectively.
Challenges We Faced
Building a simulation that accurately captures the diversity of voters across different districts was one of our biggest challenges. Ensuring representativeness of voter behavior from census data while maintaining the system's performance required fine-tuning of agent interactions and balancing different political perspectives. Additionally, making the results both highly explainable and scalable to larger elections presented difficulties in data handling and system optimization.
Accomplishments & Learning
We successfully built our very own LLM python framework to quickly scale our eventual project. None of us have ever done anything of this scale before, so it was both super exciting and rewarding. We also had to do a lot of learning on-the-fly as well, from LLM inference to structured data extraction, this project significantly improved our ability to build accessible, fullstack projects, while giving us a ton of valuable experience integrating modern AI solutions into our techstack, from managing data flows to optimizing performance.
What's Next?
We plan to improve the tool by incorporating real-time data feeds from social media and news sources. This would enhance the accuracy of our analysis and provide even deeper insights into public opinion that we wouldn't need to simulate ourselves, but could instead have it continually running. Additionally, we hope to continue to iterate and refine upon the UI, thus making the tool accessible to an even broader audience.
Live Demo is added to the Canva
Log in or sign up for Devpost to join the conversation.