Inspiration
A couple things:
My friends and I often debate about things like free will, morals, religion, etc. Often times, we'll get sidetracked or get too deep into the rabbit hole that we lose track of things, so a tool like this helps us focus.
Also, this is something I've always wanted throughout my Ethics class and during prior essays in high school, a tool that can easily extract the abstract argument structure out of a dense text.
Lastly, I was distantly inspired by recent developments in formal mathematical reasoning in AI and the advent of languages like Lean.
What it does
Core Feature
Takes a dense text, like an essay you wrote, and constructs a tree representing your argument - complete with your thesis, subclaims, counterclaims, evidence, and axioms.
The strength of each claim is recursively calculated based on its children and on its own merit. Fallacious or false arguments are marked as such, and their weak strength is denoted by their weak arrow connecting to their parent node. Conversely, strong well-supported claims are denoted by their strong arrow to their parent node. Changes in the lower levels of the tree result in strength recalculations that propagate up the tree. Moral of the story: your argument must be watertight!
The tree can be modified and extended by adding counterclaims or further support. Each node can be clicked on to reveal details, including suggested counterclaims or further support, and the option to make your own. Continue extending the tree as you wish.
Attack / Defense Mode
Attack mode will sequentially target strong subclaims that support your thesis and add counterclaims, thus weakening them.
Defense mode will sequentially target unaddressed counterclaims and then add extra supports to your subclaims, thus strengthening your argument.
Use these to automatically simulate debates and identify weak points of your argument.
Extra
Tree state can be saved as a JSON file and be uploaded again in the future to return to.
How we built it
I spent ~3 hours brainstorming before arriving to this idea.
I quickly generated a frontend and backend, and leveraged Google's Gemini API (gemini-2.5-pro) for its reasoning capabilities. Carefully crafted prompts are stored in the backend to be used to either parse a large text, analyze a claim, or search for suggested claims/counterclaims.
The frontend uses React Flow for the flow chart.
Challenges we ran into
Getting Gemini to properly output in JSON format following my specified node/edge schemas. This turned out to be a mistake, because Gemini is not great at guaranteeing flawless JSON. The solution was to specify an easier output syntax for Gemini (with less brackets and punctuation), and then manually parse that into JSON in the Python backend.
Accomplishments that we're proud of
Strength calculation and propagation: there were lots of hidden bugs that I eventually ironed out. There are 5 argument strengths [True, Strong, Weak, Fallacious, False], and every node's strength is dependent on its own merit and its children nodes. Editing a node recalculates its own strength and recursively updates its parent, like a tree traversal.
... and making something that I knew I would actually use rather than being a throwaway project that uses AI for the sake of using AI. I've been obsessed with something like this for years.
What we learned
Don't rely on LLMs to generate perfect JSON. Source my own experiences for inspirations when it comes to projects. Context prompts should tell the LLM what to do, not just what NOT to do. Add mandatory checks and courses of correction to ensure good output.
What's next for phacks
1. Retrieval-augmented generation (RAG): allows for larger projects the user may be working on, such as research papers synthesizing many different sources. I want to allow the user to upload reference documents to better inform Gemini's reasoning related to the specific topic and address specific claims/counterclaims mentioned. 2. Text references: nodes should hold pointers to the exact quotes in the text that it references. Clicking on a node with a subclaim should take you to the place in the text that presents that subclaim and highlights it. 3. Formal mathematical reasoning: study Lean and current models that succeed in mathematical reasoning. Should be able to handle rigorous mathematical proofs.
Built With
- fastapi
- geminiai
- next.js
- python
- typescript
Log in or sign up for Devpost to join the conversation.