
I developed "Narrative Doomer," a web-based LLM proxy designed to perform critical discourse analysis on user-provided text. The system leverages the dspy library to orchestrate a chain of LLM calls that identify and annotate foundational assumptions, rhetorical tactics, and strategic omissions within a text. The final implementation provides an interactive tool for deconstructing narratives and enhancing critical awareness of textual manipulation.
In the contemporary information ecosystem, texts are frequently engineered to persuade, frame, and direct audience perception. While tools for analyzing sentiment are common, I found a lack of accessible systems for performing deeper structural critiques of a text's rhetorical construction. I created the "Narrative Doomer" project to address this gap, providing an interactive tool that exposes the hidden mechanics of persuasive writing.
My primary objective was not merely to classify text, but to deconstruct it. By leveraging a multi-step analytical framework executed by a Large Language Model, the system reveals the underlying ideological assumptions, specific rhetorical devices (e.g., "Loaded Language," "False Dichotomy"), and significant content omissions. This allows users to move beyond surface-level reading and engage with a text's structural and persuasive architecture.
I designed the application with a focus on simplicity and modularity, ensuring the analytical core could be developed independently of the user interface.
The system is comprised of two main components:
The core of the project is the AnalyzerService, which uses the dspy library to programmatically prompt an LLM. I designed a three-step analysis chain to ensure a comprehensive and structured critique. Each step is defined by a specific dspy signature:
FoundationalAssumptions signature): The first step prompts the LLM to identify the core, unstated beliefs and assumptions the author holds. This provides the foundational context for the rest of the analysis.SentenceAnalysis signature): The system then dissects the text sentence by sentence. For each sentence, it identifies specific rhetorical tactics, assigns a bias score, and provides a justification.OmissionAnalysis signature): Finally, I prompt the model to consider what has been strategically omitted—what perspectives, data, or counterarguments are missing that might alter a reader's perception.To ensure structured and reliable data exchange between the analysis engine and the frontend, I used Pydantic models. The final output is encapsulated in a SynthesisResult model, which aggregates the findings from the three analytical steps into a clean JSON object, ready for rendering.
I configured the system to be straightforward to set up and deploy.
BaseSettings, control key parameters. This includes a USE_DUMMY_DATA flag to toggle between a live LLM and pre-canned demo results, which is useful for development and testing.main_narrativedoomer.yml) that automates the deployment process to an Azure Web App, facilitating continuous integration.For detailed instructions on using the API or hosting the application, please refer to the project's GitHub repository. The README.md provides a complete guide for local setup and interaction.
In this project, I engineered a novel application of LLMs for the purpose of critical discourse analysis. By developing a structured, multi-step analytical chain using dspy, "Narrative Doomer" moves beyond simple text classification to provide a framework for deconstructing texts and revealing their underlying persuasive architecture. The system demonstrates the potential for using LLMs not just for content generation, but as a powerful tool for fostering critical thinking and media literacy. The complete, documented source code is available for review.