Empowering the electorate: How I'm using AI, APIs and Python to create an informative election chatbot

Empowering the electorate: How I'm using AI, APIs and Python to create an informative election chatbot

As part of my endeavor to broaden my expertise in working with Large Language Models (LLMs), APIs, and Python, and to gain proficiency in tools like Botpress & Flowise, I have set out to build a comprehensive election-focused chatbot. This project is not only a step towards achieving my personal goal of enhancing my technical skills but also aims to address a significant societal need.

To kickstart this venture, I will develop a prototype using ChatGPT's custom GPTs. This initial phase will lay the groundwork for understanding the intricacies of AI-driven chatbot development before I transition to using Botpress for the final product. Previously, I created a custom GPT titled Congress Explorer using ProPublica's API that allowed the user to learn about bills that have been proposed or voted on in Congress.

Screenshot from my Congress Explorer Custom GPT

As I’m building this chatbot, I will leverage "Conversations with Things: UX Design for Chat and Voice" by Diana Deibel and Rebecca Evanhoe as a foundational guide to crafting more intuitive and user-friendly chatbots. This book, with its focus on practical, ethical, and human-centered design principles, will illuminate my path toward creating digital conversations that seamlessly blend into our lives. It emphasizes a user-centric approach, rigorous testing, and inclusivity, aligning perfectly with my aim to develop chatbots that not only mimic human interaction but are also accessible and respectful of user diversity. By applying the insights and methodologies outlined in this resource, I'm set to enhance the user experience, making digital interactions more natural and beneficial, thereby setting a new standard in human-computer communication.

The US Vote Foundation is sponsoring me to incorporate their API into the chatbot. The U.S. Vote Foundation (US Vote) is a private, nonprofit, nonpartisan public charity established in 2005. It is dedicated to the mission "Every Citizen is a Voter" and aims to facilitate voter participation and engagement in the United States. The foundation provides best-in-class voter services and election information to citizens, including those living domestically, overseas, or serving in the military. It offers a free, searchable database of accurate voting information and develops tools for third-party voter outreach organizations, voter apps and services developers, academics, and other researchers.

The U.S. Vote Foundation's Civic Data API Services provide access to comprehensive and trusted U.S. civic data. This data includes the Election Official Directory (EOD), which enables developers of voter or election services to access contact information for local election officials. The API also provides data on election dates and deadlines for U.S. domestic and overseas voters, including detailed deadline information for early and in-person absentee voting.

In addition, the API provides information on state voting requirements, which vary from state to state. The foundation's data maintenance services give developers and voter organizations the confidence needed to rely on the data provided.

The ultimate aim of this chatbot is to provide accessible and reliable election-related information, thereby enhancing democratic engagement and voter knowledge. This article outlines the systematic development process of this innovative AI-powered chatbot, set to revolutionize how voters access electoral information.

Mission and Vision

The mission of this project is to develop an AI chatbot on Botpress, utilizing various APIs and data sources to deliver extensive and current election-related information. The vision is to create a platform where voters can easily access a wealth of electoral information, fostering a more informed and engaged electorate, while simultaneously expanding my knowledge and proficiency in the realms of LLMs, APIs, and Python programming.

Core Functionalities and API Integrations

The chatbot will encompass several key modules, each integrated with specific APIs to ensure the provision of accurate and relevant information.

Voter Information Module

This module aims to provide personalized voter information. Key features include registration status, polling locations, and voter ID requirements. It will integrate the U.S. Vote Foundation's Civic Data API  for polling locations and for standardized election-related data. Voiceflow's conditional logic will be used for personalized responses.

Political Data Module

Focused on delivering extensive political data, this module will inform users about U.S. Congressional activities, including bills, votes, and committees and feature campaign donations, and voting records. Integrations include the ProPublica Congress and Campaign Finance APIs for political data and the OpenSecret API for campaign finance and lobbying. information. I will also use RSS API to bring in real-time stories and articles related to elections from sources like The Hill and Politico. This real-time data retrieval from political databases will ensure users receive the most current information.

Technical Specifications

The chatbot will be developed focusing on AI, using NLP for user interactions, multilingual support via Botpress, and OpenAI Assistant API for integration of the GPT4 model into the chatbot. The user interface will be designed for simplicity and accessibility, and database management will ensure secure and compliant data storage.

Cultural and Social Context

The chatbot is designed with inclusivity in mind, ensuring accessibility for diverse populations and addressing potential barriers related to digital literacy. It aims to bridge the information gap and make election data accessible to all voters, regardless of their technical proficiency.

Problem-Solution Framework

The chatbot addresses the problem of scattered and inaccessible election information, which often leads to voter disengagement. It aims to encourage informed participation in the electoral process by providing a centralized source of comprehensive election information.

Development and Implementation Plan

The development will follow a structured plan, starting with a research and feasibility study, followed by the design and development phases. Extensive testing will ensure functionality and accuracy. Post-deployment, the chatbot will be continuously improved based on user feedback.

Week-by-Week Roadmap (Tenatice

The following 10-week plan, allocating at least 8 hours per week to accommodate my full-time job, outlines the phases of research, development, testing, and deployment of the election-focused chatbot project.

Weeks 1-2: Research and Feasibility Study

  • Objective: Conduct a comprehensive analysis of the project requirements, including a study of the U.S. Vote Foundation's API, ProPublica's Congress API, and other relevant data sources.
  • Actions:
    • Review "Conversations with Things: UX Design for Chat and Voice" for design principles.
    • Explore the technical capabilities and limitations of Botpress, Flowise, and other tools.
    • Evaluate the feasibility of integrating multiple APIs for real-time data access.

Weeks 3-4: Design Phase

  • Objective: Develop a detailed design document outlining the chatbot's architecture, user interface, and interaction flows.
  • Actions:
    • Define core functionalities: Voter Information Module and Political Data Module.
    • Sketch out the chatbot's conversation flowcharts and user interface mockups.
    • Plan the integration strategy for APIs and external data sources.

Weeks 5-6: Development Phase (Part 1)

  • Objective: Begin coding the foundational elements of the chatbot, focusing on API integrations and basic interaction capabilities.
  • Actions:
    • Implement the Voter Information Module with U.S. Vote Foundation's Civic Data API.
    • Start the development of the Political Data Module, integrating ProPublica Congress and Campaign Finance APIs.

Weeks 7-8: Development Phase (Part 2)

  • Objective: Continue developing by enhancing the chatbot's functionalities and user interaction experience.
  • Actions:
    • Incorporate NLP capabilities for improved user interactions.
    • Integrate multilingual features using Botpress's AI functionalities.
    • Test the chatbot's API integrations and data retrieval processes.

Weeks 9: Testing and Refinement

  • Objective: Conduct extensive testing to ensure the chatbot's functionality, accuracy, and user experience meet the project standards.
  • Actions:
    • Perform unit, integration, and user acceptance testing (UAT).
    • Collect feedback from test users and refine the chatbot based on the feedback.
    • Ensure the chatbot's compliance with data protection and privacy regulations.

Week 10: Deployment and Feedback Integration

  • Objective: Deploy the chatbot and integrate initial user feedback for improvements.
  • Actions:
    • Launch the chatbot to a select user group for initial deployment.
    • Monitor the chatbot's performance and collect user feedback.
    • Make necessary adjustments and improvements based on user interactions and feedback.

Engagement with the Audience

The project will collaborate with various organizations to reach a wider audience and will provide educational materials to ensure effective chatbot usage. The aim is to make the chatbot an essential tool for voters seeking election-related information.

Conclusion

This AI election-focused chatbot project represents not only a solution to providing easy access to vital election information but also a journey in personal and professional growth in the fields of LLMs, APIs, and Python. By leveraging technology, we aim to ensure that every voter is well-informed and empowered to participate in the democratic process while advancing my technical skills and understanding.