AI Prompts & Intelligence Layer
Relevant source files
The following files were used as context for generating this wiki page:
The AI Prompts & Intelligence Layer serves as the cognitive core of KudosWall, providing advanced capabilities for content analysis, sentiment detection, and automated marketing strategy generation. It is designed to process both text and video testimonial transcripts to extract actionable insights for the dashboard and generate high-conversion marketing assets.
This layer leverages localized "prompt-engineering" and structured data validation via Zod to ensure high-fidelity outputs. Key functions include spam filtering, sentiment-rating mismatch detection, and generative engine optimization (GEO) to enhance the visibility of social proof in AI-driven search engines.
Sources: apps/web/src/lib/ai/prompts.ts:7-24, README.md:16-30
Core Persona & System Context
The AI is established with a specific operational persona: the "AI Core of KudosWall." Its primary role is that of a premium SaaS assistant specialized in social proof management and marketing strategy.
Operational Guidelines
- Objectivity: AI must maintain an analytical tone and identify discrepancies, such as mismatches between star ratings and written text.
- Voice Preservation: The system is instructed to maintain the original customer "voice" without over-sanitization.
- Structured Outputs: Unless specified otherwise, the layer always provides JSON output to maintain type safety across the monorepo.
Sources: apps/web/src/lib/ai/prompts.ts:25-45
AI Processing Pipeline
The intelligence layer processes incoming feedback through a multi-stage pipeline, from initial ingestion to final marketing asset generation.
This diagram illustrates the flow of raw data through the AI Core into specialized analysis and marketing modules.
Sources: apps/web/src/lib/ai/prompts.ts:133-250, README.md:31-45
Structured Data Schemas
KudosWall uses Zod-validated schemas to ensure the AI's JSON responses match the application's internal data structures. This is critical for maintaining strict type boundaries within the Turborepo architecture.
| Schema Name | Key Fields | Purpose |
|---|---|---|
analysis | sentiment, enthusiasm_score, themes, is_mismatch | Core dashboard filtering and sorting logic. |
spam | is_legit, confidence, reason | Automated abuse and bot prevention. |
feature_suggestion | feature_name, customer_need, frequency_signal | Informing product roadmap from customer feedback. |
case_study | title, problem, solution, result, key_stat | Converting testimonials into marketing assets. |
translation | translated_text, cultural_notes | Multilingual localization while preserving emotional intensity. |
Sources: apps/web/src/lib/ai/prompts.ts:51-105, AGENTS.md:17-25
Advanced Prompt Modules
Testimonial Analysis (Few-Shot + CoT)
The analysis engine uses Chain-of-Thought (CoT) reasoning to detect "mismatches." For example, if a user provides 5 stars but describes a "crash," the AI flags is_mismatch: true.
Sources: apps/web/src/lib/ai/prompts.ts:117-155
Programmatic SEO (PSEO) & GEO
This module generates high-value landing page content designed for search intent and Generative Engine Optimization.
- Comparison Pages: Generates "Us vs Them" content highlighting unique features like glassmorphism UI.
- GEO Enrichment: Refines testimonials to be "extricable" and "citable" by AI engines like Perplexity or ChatGPT.
Sources: apps/web/src/lib/ai/prompts.ts:203-255, apps/web/src/lib/comparisons.tsx:1-50
Intelligence Engine
Automates customer success workflows by generating "Smart Replies" for thank-you emails and identifying recurring feature requests through bulk analysis.
Sources: apps/web/src/lib/ai/prompts.ts:257-285
Implementation Patterns
As per the monorepo standards, the AI logic is centralized in the web library, but its outputs influence the tRPC procedures and database states.
Sequence of testimonial ingestion and AI-driven enrichment before database persistence.
Sources: apps/web/src/lib/ai/prompts.ts:187-200, AGENTS.md:65-75, apps/web/src/app/collect/[slug]/page.tsx:180-220
SEO and Metadata Injection
The intelligence layer extends to the server-side rendering of public pages. It generates structured JSON-LD (Schema.org) for reviews and products, ensuring that AI-analyzed testimonials are indexed with accurate aggregate ratings.
Sources: apps/web/src/app/wall/[slug]/page.tsx:112-160, apps/web/src/app/collect/[slug]/page.tsx:216-255
The AI Prompts & Intelligence Layer is a critical component that transforms raw customer feedback into a strategic asset, enabling automated moderation, product insight, and enhanced search visibility for KudosWall users.