use brevity and shorten req list ### Detailed Requirements List for Relationship…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
use brevity and shorten req list ### Detailed Requirements List for Relationship Mediator LLM App
1.1 Mediation Interface
1.2 Message Display
<div> elements with inline CSS for bubble effects (padding, rounded corners, alignment).1.3 Context Management & Summarization
mediation_history).session_<timestamp>.json (e.g., session_20231001_153000.json).1.4 Text-to-Speech (TTS)
kokoro-onnx to convert the mediator’s text response to speech.1.5 Speech-to-Text (STT)
speech_recognition library for Google Web Speech API integration.1.6 Status Feedback
1.7 Handout Generation
2.1 LLM Integration
llama3.2:1b for chat and summarization.SYSTEM_PROMPT.2.3 UI Components
2.4 Session Management
2.5 Error Handling
3.1 Input Modes
3.2 Responsive Design
Enter key sends text messages.ollama, kokoro-onnx, speech_recognition, gradio.This is a greenfield project. The new team will build the application from the ground up based on these specifications.
Epic 1: Core Chat Interface & Interaction Epic 2: LLM-Powered Mediation & Context Management Epic 3: Voice-to-Text & Text-to-Speech Integration Epic 4: Session History & Data Persistence Epic 5: Session Review & Handout Generation 4. Detailed Functional Requirements (FR) Epic 1: Core Chat Interface & Interaction FR-1.1: Dual User Input: The UI must provide two separate and clearly labeled input areas, one for "User A" and one for "User B". Each user must have their own "Send" button. FR-1.2: Message Bubble Styling: The chat display area must render messages in a "bubble" style to visually distinguish between speakers. User A's messages: Right-aligned, distinct color (e.g., blue background, white text). User B's messages: Left-aligned, distinct color (e.g., green background, white text). Mediator's messages: Center-aligned, neutral color (e.g., light grey background, dark text). System messages/Summaries: Center-aligned, styled distinctly to indicate a non-conversational event (e.g., italicized or in a different container). FR-1.3: Asynchronous UI: The user interface must remain responsive at all times. LLM processing, TTS, and STT must run in background threads to prevent the UI from freezing. FR-1.4: Real-time Status Indicator: A status bar or text element must provide real-time feedback to the users about the application's state. Required statuses include: Ready Listening... (during STT) Processing audio... Mediator is thinking... / Generating response... History length threshold reached, summarizing... Mediator is speaking... Error: [Error message] FR-1.5: UI Framework: The application shall be built using Gradio, as it provides a robust framework for ML application demos and web deployment. Epic 2: LLM-Powered Mediation & Context Management FR-2.1: LLM Integration: The application must integrate with a local Ollama instance. The specific model (e.g., llama3.2:1b) shall be configurable. FR-2.2: Mediator Persona Prompt: On initialization, the LLM's context must be primed with a system prompt to define its role and behavior. The prompt is: "You are a neutral relationship mediator helping two people, User A and User B, communicate better. Listen carefully to their messages. After each message, provide a balanced, empathetic, and constructive response that helps them understand each other, reflect on their perspective, or find common ground. Avoid taking sides. Summarize feelings and needs you hear. Assist in resolving tension by offering understanding, reframing, and kind suggestions. Only respond after a user has sent their message."
FR-2.3: Context Window Management via Summarization: To manage context length and cost, the application will automatically summarize the conversation history. Trigger Condition: Summarization shall occur when the number of message pairs (user message + mediator response) reaches a threshold of 10 (SUMMARY_THRESHOLD). Summarization Prompt: The summarization call to the LLM will use the full current history appended with the following user prompt: "You are a skilled mediator and counselor. Analyze the above conversation history and note any emotional states expressed by User A and by User B, key issues in their relationship, any previous suggestions you, the mediator, have made, and concisely summarize key points. Your summary will replace the older conversation history to help you recall the context for future mediation. Provide ONLY the summary text, do not add any other conversational text or act as the mediator in this specific response."
Context Reconstruction: After
Okay, here's a shortened requirements list:
Relationship Mediator LLM App - Shortened Requirements
1. Core Functionality:
* Dual User Input: Text & STT (via button) for User A & B; Send buttons.
* Chat Display: Styled bubbles (A: right/blue, B: left/green, Mediator: center/gray); Timestamps.
* LLM Mediation: Ollama llama3.2:1b with neutral/empathetic system prompt.
* Context Summarization: Auto-LLM summary every 10 message pairs; keep 4 recent messages.
* History Persistence: Save chat/summaries to session_<timestamp>.json.
* Mediator TTS: kokoro-onnx auto-plays mediator response; adjustable rate (default 180 WPM).
* STT: speech_recognition (Google Web Speech API).
* Status Feedback: Indicators (e.g., "Mediator thinking..."); input blocked during processing.
* Handout Generation: Button for downloadable text summary (key points, advice, issues).
2. Technical & UI:
* GUI: Gradio; scrollable chat; Tabs ("Chat", "Notes & Handout").
* Processing: Async LLM, TTS, STT (thread-safe).
* Session: Auto-save history on close/send.
* Error Handling: Messages & retry for LLM/TTS/STT failures.
* Input: Enter key sends text.
3. Key Libraries:
* ollama, kokoro-onnx, speech_recognition, gradio.
1.1 Chat Interface
1.2 Context Management
session_<timestamp>.json)1.3 Voice Features
kokoro-onnx for mediator responses (180 wpm)1.4 Status Indicators
1.5 Handout Generation
2.1 Core
llama3.2:1b)2.2 Libraries
ollama, kokoro-onnx, speech_recognition, gradio2.3 Data
Okay, here's a much-improved, concise requirements list with an overview and necessary technical details, based on the good parts of your initial detailed list and the subsequent attempt:
Relationship Mediator LLM App - Concise Requirements
Overview:
The "Relationship Mediator LLM App" is a desktop/web application designed to act as a neutral, AI-driven third party to facilitate constructive communication between two users (User A & User B). It leverages a local LLM (Ollama llama3.2:1b) for mediation, provides speech-to-text (STT) and text-to-speech (TTS) capabilities, manages session history, and generates a take-home summary handout.
1. Core Functional Requirements:
llama3.2:1b with a predefined neutral, empathetic SYSTEM_PROMPT.kokoro-onnx for mediator's text response; auto-plays; adjustable rate (default 180 WPM).speech_recognition (Google Web Speech API) via "Listen" button per user.session_<timestamp>.json on send/close.2. Technical & UI Requirements:
ollamakokoro-onnxspeech_recognitiongradio3. User Experience (UX) Highlights:
Enter key sends.