Overview
TheidentifyLogicalFallacies flow is an AI-powered analysis tool that examines argument text to identify logical fallacies and provide detailed explanations for each identified fallacy.
Function Signature
Input Schema
The text of the argument to analyze for logical fallacies.
Input Type
Zod Schema
Output Schema
An array of logical fallacies identified in the argument.
A detailed explanation of each identified logical fallacy.
Output Type
Zod Schema
Usage Example
Example with Political Argument
Example with Scientific Claim
Example with No Fallacies
AI Flow Process
The flow executes the following steps:- Receives Argument Text: Accepts the argument text as input
- AI Analysis: Sends the text to the AI prompt with fallacy detection instructions
- Fallacy Identification: AI identifies any logical fallacies present
- Explanation Generation: AI generates detailed explanations for each fallacy
- Returns Results: Returns structured output with fallacy list and explanations
Prompt Template
Common Logical Fallacies Detected
The AI is trained to identify various types of logical fallacies, including but not limited to:- Ad Hominem: Attacking the person making the argument rather than the argument itself
- Straw Man: Misrepresenting an opponent’s argument to make it easier to attack
- Appeal to Authority: Assuming something is true because an authority figure says so
- False Dilemma: Presenting only two options when more exist
- Slippery Slope: Arguing that one event will inevitably lead to a chain of events
- Circular Reasoning: Using the conclusion as a premise
- Hasty Generalization: Drawing conclusions from insufficient evidence
- Appeal to Emotion: Manipulating emotions rather than using logic
- Red Herring: Introducing irrelevant information to distract from the main point
- Bandwagon Fallacy: Arguing something is true because many people believe it
- Post Hoc: Assuming causation from correlation
- Appeal to Tradition: Arguing something is right because it’s always been done that way
- Tu Quoque: Deflecting criticism by pointing out hypocrisy
Response Format
The response always includes:- Array of Fallacies: List of specific fallacy names identified
- Detailed Explanation: Comprehensive explanation covering:
- What each fallacy is
- Where it appears in the argument
- Why it undermines the argument’s logic
- How the argument could be improved
Error Handling
The flow uses Genkit’s AI flow error handling. If the AI fails to generate a response or returns invalid JSON, the underlying Genkit framework will throw an appropriate error.Potential Errors
- AI Generation Error: If the AI model fails to respond
- Schema Validation Error: If the AI response doesn’t match the expected output schema
- Empty Input Error: If
argumentTextis empty or invalid
Integration with Other Flows
This flow is used internally by thegenerateArgumentBlueprint flow to analyze individual argument nodes for fallacies. It can also be called independently for standalone fallacy analysis.
Used in Blueprint Generation
Notes
- The AI is configured to provide objective, educational analysis
- Explanations are detailed and include examples from the provided text
- If no fallacies are found, the
fallaciesarray will be empty and the explanation will indicate that the argument is logically sound - The flow is optimized for analyzing single arguments; for batch processing, call the function multiple times