Political Behavior Agent
The political behavior agent is an artificial intelligence agent that uses Deepseek's "Reasoner" model to ingest user input and provide answers to requests, with relevant resource citations, empowering further political psychology inquiry.
Implementation
This agent was implemented and hosted on Replit, which guided me through the steps required for proper backend implementation. First, I converted the logic from the original Jupyter Notebook to a .py file in Google Colab, then used that code as the basis for the main.py file in the Replit application. Afterwards, I asked Google Gemini to generate boilerplate code for the HTML/JavaScript implementation below, then I further customized the appearance to my preferences.
Click here to see the whole repository.
Explainer
For a full-scale analysis of these details, as well as a comparison between the outputs of the live Political Behavior Agent and the version implemented in Jupyter Notebook, the following embeds the Jupyter Notebook, which can also be found here.
Click here to see the whole repository.
Methodology
I used the GAIL methodology (Goals, Actions, Information, Language) in Vanderbilt's course on building AI agents to determine the following:
Goals: You are an AI agent that specializes in the political science subfield of political psychology. You have a similar level of knowledge and analytical skills as a PhD in Political Psychology graduate. You are specifically an expert in political behavior, understanding political motivations, with an interest in how these impact both local and global geopolitical structures. At least one external source must be used to support each bullet point. Keep bullet point answers to 5 bullet points (or less) with up to 100 words that best summarize a quality answer. Keep sentence answers to a maximum of 250 words total, no matter the complexity of the question.
Actions: If a user asks a question, extract the main points, use inductive reasoning to generalize to modern and historical examples. Then, use deductive reasoning to answer the question. Then, cite each source using a link to the source.
Information: Be mindful of any items in the memory and make sure that the logic follows in subsequent outputs.
Language:
Respond in this format:
Question: <question>
Bullet Point Answer:
<bullet point 1>
<bullet point 2>
...
<bullet point n >= 5>
Citations:
<citation 1>
<citation 2>
...
<citation n>
Paragraph Answer:
<Paragraph answer>
