Zing Forum

Reading

Review-Analyzer-Agent: A Multi-Agent Architecture-Based Sentiment Analysis System for Reviews

A multi-stage review analysis system built on the OpenAI Agents SDK. Through collaboration between routing agents, analysis agents, and a self-correction layer, it extracts structured sentiment insights, with special optimizations for Hebrew slang and sarcastic expressions.

LLMsentiment analysismulti-agentOpenAI Agents SDKABSAHebrew NLPsarcasm detectionJSON modeZod validation
Published 2026-05-26 16:15Recent activity 2026-05-26 16:24Estimated read 6 min
Review-Analyzer-Agent: A Multi-Agent Architecture-Based Sentiment Analysis System for Reviews
1

Section 01

[Introduction] Review-Analyzer-Agent: Core Introduction to the Multi-Agent-Based Sentiment Analysis System for Reviews

This article introduces Review-Analyzer-Agent, a multi-stage review sentiment analysis system built using the OpenAI Agents SDK. Through collaboration between routing agents, analysis agents, and a self-correction layer, it extracts structured sentiment insights, with special optimizations for Hebrew slang and sarcastic expressions. The project is maintained by ofirAvisror and published on GitHub (link: https://github.com/ofirAvisror/Review-Analyzer-Agent). It is a course project for an artificial intelligence systems course, released on May 26, 2026.

2

Section 02

Project Background and Overview

Review-Analyzer-Agent is developed using the OpenAI Agents SDK and TypeScript/Bun tech stack, aiming to convert unstructured free-text reviews into structured sentiment insights. Its core architecture consists of three main components: Dynamic Router Agent, Aspect-Based Sentiment Analysis Agent (Review Analyzer Agent), and Automated Self-Correction Layer.

3

Section 03

Core Architecture and Processing Flow

The system follows a three-stage processing pipeline:

  1. Router Agent: Receives review text, determines if it is a valid review, extracts core content, supports intent recognition for analyzeReview and notReview, and can strip meta-discourse (e.g., "Analyze this review:" or Hebrew "תנתח לי את הביקורת הבאה:").
  2. Analysis Agent: Uses strict JSON mode output, combines Zod validation to ensure structure, and outputs include summary, overall sentiment tendency, score, and multi-dimensional aspect analysis (topic, sentiment, details).
  3. Self-Correction Layer: Verifies result consistency (e.g., overall sentiment is Positive but score is only 2), triggers a secondary LLM call to generate corrected output.
4

Section 04

Multi-Language and Slang Support

The system's feature lies in its support for Hebrew and its slang, as well as sarcastic expressions:

  • Hebrew slang dictionary includes "אש" (excellent), "שחיטה" (rip-off), "איזה כיף" (sarcastic), etc.;
  • English slang support includes "a show" (sarcastic), "rip-off" (rip-off), etc.;
  • Can identify sarcastic reviews that are superficially positive but actually negative, adapting to real scenarios in the Israeli local market.
5

Section 05

Technical Implementation Details

Key technical points:

  1. JSON and Zod Validation: Fixed output structure (summary, overall_sentiment, score, aspects) to ensure parseability and correctness.
  2. Anti-Hallucination Mechanism: Aspect analysis must have original text support; post-processing of summaries fixes spaces; sarcasm/attitude annotations are clear.
  3. Code Organization: The agents directory contains implementations of the three agents; the review directory includes modules for pipelines, validation, etc.; prompts.ts manages prompt words; orchestrator.ts is responsible for coordination.
6

Section 06

Practical Application Example

Take a Hebrew restaurant review as an example: the review mixes positive ("The burger is great") and negative ("Price is a rip-off", "Waiter rolled his eyes") expressions. The system parses three aspects: Food (positive), Price (negative), Service (negative, marked with sarcasm/attitude). The overall sentiment is Mixed, with a score of 6/10, accurately capturing complex attitudes.

7

Section 07

Technical Value and Future Directions

Value: Demonstrates how to build a production-level sentiment analysis system, combining LLM capabilities with engineering practices (multi-agent, structured output, self-correction). Insights: The importance of prompt engineering, structured output, and domain optimization. Limitations: Only supports the analyzeReview intent. Future: Expand multi-language slang, complex aspect extraction, real-time learning, and more text analysis tasks.