Human: Build me a conversational judgement analysis chat robot that identifies covert or subtle abuse from powerful people in books, or messages or their public statements. Tell me what prompts it should use, and what prompts it should use to look for source examples. For example, Steve Jobs could be an abusive CEO. Another powerful abusive CEO is Ray Dalio, as mentioned in the book: The unauthorized, unvarnished story of famed Wall Street hedge-fund manager Ray Dalio.
I created a conversational judgment analysis chat robot that identifies subtle forms of abuse from powerful figures in various texts. The system includes:
- Backend API (
power-abuse-analyzer.ts
): Analyzes text for subtle abuse patterns using OpenAI's GPT-4o model - Frontend Interface (
frontend/index.html
): A user-friendly chat interface for interacting with the analyzer - Static File Server (
static-file-server.ts
): Serves the frontend files
- Text Analysis: Identifies 14 different patterns of subtle abuse in any text
- Conversational Interface: Users can chat with the system, ask questions, or submit text for analysis
- Pre-configured Examples: Includes analysis capabilities for known figures like Steve Jobs and Ray Dalio
- Pattern Education: Explains common patterns of subtle abuse from powerful figures
- Severity Rating: Classifies identified patterns as subtle, moderate, or overt
- Confidence Scoring: Provides confidence levels for each identified pattern
- Response Suggestions: Offers constructive ways to address problematic language
The system uses two main prompts:
-
Analysis Prompt: Guides the AI in identifying subtle forms of abuse in text:
- Focuses on 14 specific patterns of subtle abuse
- Requests severity ratings, confidence levels, and specific examples
- Asks for overall assessment and suggested responses
-
Question-Handling Prompt: Helps the AI answer questions about power abuse:
- Provides educational information about abuse patterns
- Offers concrete examples when appropriate
- Gives balanced analysis of specific powerful figures
The system identifies 14 patterns of subtle abuse, including:
- Gaslighting or reality distortion
- Subtle threats or intimidation
- Minimization of harm
- Shifting blame to victims
- Appeals to authority to silence criticism
- False equivalencies
- Dehumanizing language
- Plausible deniability tactics
- Coded language
- Misuse of institutional power
- Intellectual intimidation
- Benevolent authoritarianism
- Selective meritocracy
- Institutional shield
Human: Create a backend that allows a user to save their chat into SQLite - allow them to ask questions of specific patterns -- that is, if a pattern is identified, such as "reality distortion", allow them to say, hey, I have more examples of this, then add examples, and have it continue on that thread. You can use SQLite recursive query statements for this.
I enhanced the Power Abuse Analyzer with SQLite storage for chat history and pattern examples, and implemented the ability to continue conversations about specific patterns.
-
Database Module (
database.ts
):- Manages SQLite operations
- Implements tables for sessions, messages, patterns, and examples
- Provides functions for CRUD operations
- Uses recursive CTEs for threaded conversations
-
Chat API (
chat-api.ts
):- Handles chat sessions and messages
- Processes pattern follow-up questions
- Manages user-provided examples
- Formats responses for the frontend
-
Updated Frontend:
- Adds session management
- Supports pattern follow-up conversations
- Allows adding examples to patterns
- Provides export functionality
The application uses SQLite with the following tables:
- Sessions: Stores chat sessions with titles and timestamps
- Messages: Stores messages within sessions, with support for threaded conversations
- Patterns: Stores identified abuse patterns with severity and confidence ratings
- Examples: Stores examples of patterns, including user-provided examples
-
Persistent Sessions:
- Create and name analysis sessions
- Save all messages and identified patterns
- Load and continue previous sessions
-
Pattern Examples:
- Add your own examples to identified patterns
- View all examples for a pattern, including user-provided ones
- Use examples to improve pattern recognition
-
Threaded Conversations:
- Continue conversations about specific patterns
- Ask follow-up questions about patterns
- Get detailed explanations of pattern characteristics
-
Export Functionality:
- Export analysis results as JSON
- Share or archive analysis sessions
For handling follow-up questions about specific patterns:
You are an expert in identifying and explaining patterns of subtle abuse, manipulation, and problematic language from powerful people.
A user has previously identified the following pattern in some text:
Pattern: [pattern_type]
Explanation: [explanation]
Severity: [severity]
Confidence: [confidence]
Examples of this pattern:
[examples]
The user is now asking a follow-up question or providing additional information about this pattern.
If they are providing a new example, acknowledge it and explain how it fits the pattern.
If they are asking a question, provide a detailed, educational response about this specific pattern.
Focus on being helpful, informative, and sensitive to the nuances of power dynamics.
This enhancement allows users to build a knowledge base of abuse patterns over time, adding their own examples and exploring patterns in depth through continued conversation.