Spaces:
Running
Running
| title: v5 · AI Ethics HOT — Socratic FRAME | |
| emoji: 🧠 | |
| colorFrom: indigo | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: 6.11.0 | |
| python_version: "3.11" | |
| app_file: app.py | |
| pinned: false | |
| short_description: "v5 · Socratic AI · FRAME variant" | |
| # v5 · AI Ethics HOT — Socratic AI Discussion | |
| Research-instrument chatbot for an RCT on critical-thinking transfer. | |
| The participant: | |
| 1. Reads an AI ethics case. | |
| 2. Writes an initial 150-250 word argument. | |
| 3. Discusses with a Socratic AI for ~20 minutes. | |
| 4. Ends the session. | |
| The Socratic AI runs on a two-agent architecture: a Discussion Manager (small fast classifier) decides what kind of move the bot should make each turn, and the Main Bot (the Socratic discussion partner) executes that move. Both agents read their prompts from markdown files in `prompts/`, so behaviour can be edited without touching code. | |
| ## Configuration | |
| Runtime is controlled by Space Secrets: | |
| | Secret | Purpose | | |
| |---|---| | |
| | `API_KEY` | OpenAI API key (used by manager + main bot + per-session essay generator) | | |
| | `HF_access` | HF token with write scope (logger uploads to `AE-Talk-bot/log`) | | |
| | `RUN_MODE` | `test` / `pilot` / `prod` (picks the dataset bucket: `v5-HOT/socratic/<RUN_MODE>/`) | | |
| ## Logs | |
| Schema 1.1: every session writes one JSON to `AE-Talk-bot/log/v5-HOT/socratic/<RUN_MODE>/<session_id>.json` containing the participant's submitted argument, the per-session generated essay + discussion plan, the manager's cumulative verdict history, and per-turn records (user message, manager verdict + directive, plan-control text injected, bot reply, scratch fields, latencies). | |
| ## Architecture | |
| - `app.py`: Gradio UI (single page, 2x2 layout) plus the two-agent orchestrator wiring. | |
| - `prompts/manager_prompt.md`: prompt for the Discussion Manager agent. | |
| - `prompts/main_prompt.md`: prompt for the main Socratic bot. | |
| - `prompts/perfect_answer_prompt.md`: prompt for the per-session essay + discussion plan generator. | |
| - `core/orchestrator.py`: `turn_exchange` helpers that compose manager + main bot. | |
| - `core/manager_agent.py`: manager LLM call, JSON verdict output. | |
| - `core/main_agent.py`: main bot streaming, scratch parsing. | |
| - `core/plan_parsing.py`: parses the 4-field discussion plan schema (id / probe / rationale / anchor). | |
| - `core/perfect_answer.py`: per-session essay + discussion plan generator. | |
| - `core/logger.py`: Schema 1.1 HF dataset logger. | |
| - `data/case_analysis.md`, `data/ethics-frameworks.md`: generator inputs (case material). | |
| - `content/case_1.md`: the case prompt shown to the participant. | |