RETIREMENT AMY — COMPLETE FILE TREE
Generated: 2026-08-17
================================================================================

ROOT DIRECTORY
==============

/gateway_server.py                  ★ PRIMARY BACKEND (87 KB, 1891 lines)
                                    Flask gateway server — the actual application
                                    entry point. Handles all API routes (/api/chat,
                                    /api/tts, /api/health, /widget, /), launches
                                    Streamlit as a subprocess, contains the full
                                    AI orchestration pipeline, knowledge retrieval,
                                    form search, video matching, TTS integration,
                                    voice-text preprocessing, and session tracking.

/amy_voice_widget.html              ★ PRIMARY FRONTEND (104 KB, 2742 lines)
                                    Self-contained single-page voice chat widget.
                                    Contains all HTML, CSS (responsive/mobile),
                                    and JavaScript for: floating FAB, chat window,
                                    Web Speech API (STT), ElevenLabs TTS playback
                                    via /api/tts, Web Audio API volume control,
                                    AudioContext management, Screen Wake Lock API,
                                    mobile vs. desktop speech recognition branches,
                                    inactivity timer, mute control, interruption
                                    handling, and welcome message on first open.
                                    This is the production UI served at /.

/main.py                            ★ STREAMLIT TEXT CHAT (46 KB, 1304 lines)
                                    Full Streamlit-based text chat interface.
                                    Served on port 5001 (external port 3001).
                                    Contains its own system prompt, knowledge base
                                    retrieval, OpenAI calls, and extensive custom
                                    CSS/JavaScript for mobile layout. This is the
                                    "text chat" mode accessible via /text redirect.

/amy_custom_voice_widget.html       ALTERNATE VOICE WIDGET (20 KB)
                                    An earlier or variant voice widget. Appears to
                                    be an older version of amy_voice_widget.html.
                                    Purpose unclear — may be unused/experimental.

/api_server.py                      LEGACY API SERVER (7 KB)
                                    Older Flask API server with simpler /api/chat
                                    endpoint and /widget route. Appears superseded
                                    by gateway_server.py. Not launched by current
                                    startup sequence. Likely unused in production.

/bcfpers_knowledge_base.json        ★ KNOWLEDGE BASE (1.97 MB, 17130 lines)
                                    2,447 Q&A pairs covering all F&P topics.
                                    Categories: Active Members, Benefit Estimators,
                                    Benefits, Contact Information, DROP Program,
                                    Death Benefits, Disability Retirement,
                                    Educational Resources, General Information,
                                    Retirees/Beneficiaries.
                                    Read-only at startup (no DB, flat JSON).
                                    Field permissions: 600 (-rw-------)

/bcfpers_video_mapping.json         ★ VIDEO LIBRARY (8 KB)
                                    YouTube video catalog with title, URL, duration,
                                    keywords, and description. Used by
                                    find_relevant_videos() for contextual video
                                    recommendations.
                                    File permissions: 600 (-rw-------)

/bcfpers_website_navigation.json    ★ FORMS & NAVIGATION (12 KB)
                                    Structured data for: active_member_forms,
                                    retiree_beneficiary_forms, main_navigation,
                                    tools_and_resources, important_pages.
                                    Each form entry has: form_name, purpose, url
                                    (direct PDF link), category, note, requirement.
                                    Used by search_forms() and search_website_pages().

/question_variations.json           Q&A VARIATION MAP (21 KB)
                                    Maps informal question phrasings to formal
                                    knowledge base queries. Used to improve intent
                                    recognition. File permissions: 600 (-rw-------)

/knowledge_base_export.txt          LEGACY KB EXPORT (1.96 MB)
                                    Plain-text export of knowledge base content.
                                    Appears to be an earlier format/export.
                                    File permissions: 600 (-rw-------)
                                    Likely unused in production.

/AMY_SPECIFICATIONS.md              PRODUCT SPEC DOCUMENT (6 KB)
                                    Human-readable specification document describing
                                    Amy's voice, personality, features, capabilities,
                                    and behavior. Used as reference documentation.

/AMY_VOICE_CHATBOT_PROMPT.txt       PROMPT DOCUMENT (10 KB)
                                    Earlier version of the system prompt. Contains
                                    sections on guardrails, video resources, forms,
                                    contact info, and knowledge base description.
                                    The actual system prompt is now embedded in
                                    gateway_server.py (SYSTEM_INSTRUCTIONS var).
                                    May be outdated relative to gateway_server.py.

/replit.md                          PROJECT README (3.5 KB)
                                    Documents architecture, stack, components,
                                    and design patterns. Maintained as project docs.

/start_servers.py                   LEGACY LAUNCHER (456 bytes)
                                    Early startup script that ran Streamlit + Flask
                                    concurrently via threading. Superseded by
                                    gateway_server.py (which does this itself).
                                    Not invoked in current startup.

/streamlit_config.toml              STREAMLIT CONFIG (top-level)
                                    Configuration for Streamlit server settings.

/vite-plugin-meta-images.ts         VITE PLUGIN (unused in production)
                                    Custom Vite plugin for meta image handling.
                                    Part of the unused Node.js/React layer.

/components.json                    SHADCN/UI CONFIG (unused in production)
                                    Configuration for shadcn/ui component library
                                    in the unused React frontend.

/package.json                       NODE.JS MANIFEST (3.5 KB)
                                    Defines npm scripts: dev (tsx server/index.ts),
                                    build (tsx script/build.ts), start (node dist/).
                                    Lists React/Vite/Express/Drizzle dependencies.
                                    The npm run dev command is the configured Replit
                                    workflow entry point.

/package-lock.json                  NPM LOCKFILE (293 KB)
                                    Locked npm dependency versions.

/tsconfig.json                      TYPESCRIPT CONFIG
                                    TypeScript compiler options for the Node.js layer.

/vite.config.ts                     VITE BUILD CONFIG
                                    Frontend build configuration (React + Tailwind).
                                    Unused in production since the voice widget is
                                    a plain HTML file, not a React SPA.

/uv.lock                            PYTHON UV LOCKFILE
                                    Python package lockfile for uv package manager.

/.replit                            REPLIT CONFIGURATION
                                    Defines: modules (nodejs-20, web, postgresql-16,
                                    python-3.11), run command (npm run dev), port
                                    mappings (5000→80, 5001→3001), deployment target
                                    (autoscale), build/run commands.

/.streamlit/config.toml             STREAMLIT SERVER CONFIG
                                    Streamlit server configuration.

/uv.lock                            UV LOCKFILE
                                    Python UV package manager lockfile.

================================================================================
/server/ DIRECTORY (Node.js/Express layer — thin wrapper only)
================================================================================

/server/index.ts                    NODE.JS ENTRY POINT (thin launcher)
                                    The file that npm run dev executes. Spawns
                                    gateway_server.py as a child process and exits
                                    when it does. Contains NO application logic.
                                    This is a pass-through to Python.

/server/routes.ts                   EXPRESS ROUTES (EMPTY / UNUSED)
                                    Boilerplate Express route file. Contains no
                                    actual routes — registerRoutes() returns the
                                    httpServer unchanged. UNUSED.

/server/storage.ts                  IN-MEMORY STORAGE (UNUSED)
                                    MemStorage class implementing IStorage with
                                    in-memory user Map. No database operations.
                                    UNUSED in production.

/server/static.ts                   STATIC FILE HANDLER (UNUSED)
                                    Likely Express static file serving setup.
                                    UNUSED since Python/Flask serves all assets.

/server/vite.ts                     VITE DEV SERVER MIDDLEWARE (UNUSED)
                                    Sets up Vite HMR middleware for development.
                                    UNUSED since there is no React SPA in production.

================================================================================
/shared/ DIRECTORY
================================================================================

/shared/schema.ts                   DATABASE SCHEMA (DEFINED BUT UNUSED)
                                    Drizzle ORM schema defining a `users` table
                                    (id, username, password). No PostgreSQL database
                                    is provisioned or connected. Schema exists but
                                    is never applied or queried.

================================================================================
/script/ DIRECTORY
================================================================================

/script/build.ts                    BUILD SCRIPT
                                    Builds client via Vite and server via esbuild.
                                    Used for production deployment bundle.
                                    Output: dist/public (frontend) + dist/index.cjs.

================================================================================
/client/ DIRECTORY (React SPA — unused in production)
================================================================================

NOTE: A /client/ directory with React source likely exists (referenced in
vite.config.ts and tsconfig.json) but was not found during this audit as a
top-level directory listing. The React SPA is built but NOT served in production
— the Flask gateway serves the voice widget HTML instead.

If /client/src/ exists, it would contain:
  /client/src/main.tsx              React application entry point
  /client/src/App.tsx               Root component
  /client/src/components/           UI components (shadcn/ui-based)
  /client/src/pages/                Page components (wouter routing)
  /client/src/hooks/                Custom React hooks
  /client/src/lib/                  Utilities

================================================================================
/attached_assets/ DIRECTORY (static assets)
================================================================================

/attached_assets/
  woman_headset_172x172_hq_(1)_1767596905803.png
                                    Amy's avatar image. Embedded as base64 in
                                    served HTML by gateway_server.py.
  enhanced_woman_with_headset_(1)_1767633849726.png
                                    FAB button image for voice widget.
  [other image files]               Additional static assets.

================================================================================
GENERATED / BUILD ARTIFACTS
================================================================================

/dist/                              BUILD OUTPUT (gitignored)
                                    Compiled server (dist/index.cjs) and client
                                    (dist/public/) for production deployment.
                                    Created by npm run build.

/node_modules/                      NPM PACKAGES (gitignored)
                                    Installed Node.js dependencies.

/.cache/                            BUN/NPM CACHE
                                    Package manager cache files.

/.pythonlibs/                       PYTHON VIRTUAL ENV
                                    Python packages (Flask, Streamlit, OpenAI, etc.)
                                    Managed by Replit's uv package manager.

================================================================================
RUNTIME-GENERATED FILES
================================================================================

/conversation_logs.json             CONVERSATION LOG (runtime-generated)
                                    JSON array of conversation exchanges with
                                    timestamps, questions, and truncated answers.
                                    Written by main.py's log_conversation() function
                                    (Streamlit text interface only). NOT written by
                                    gateway_server.py (voice widget has no logging).

================================================================================
CLASSIFICATION SUMMARY
================================================================================

★ CORE PRODUCTION FILES:
  gateway_server.py
  amy_voice_widget.html
  bcfpers_knowledge_base.json
  bcfpers_video_mapping.json
  bcfpers_website_navigation.json

★ SECONDARY INTERFACE:
  main.py (Streamlit text chat)

DOCUMENTATION:
  AMY_SPECIFICATIONS.md
  AMY_VOICE_CHATBOT_PROMPT.txt (may be outdated)
  replit.md

CONFIGURATION:
  .replit, package.json, package-lock.json, tsconfig.json
  vite.config.ts, .streamlit/config.toml, uv.lock

UNUSED / LEGACY IN PRODUCTION:
  api_server.py (superseded by gateway_server.py)
  start_servers.py (superseded)
  knowledge_base_export.txt (superseded by JSON)
  server/routes.ts (empty, unused)
  server/storage.ts (in-memory only, unused)
  server/static.ts (unused)
  server/vite.ts (unused)
  shared/schema.ts (DB schema never applied)
  amy_custom_voice_widget.html (variant, status unclear)
  client/ React SPA (built but not served)

POTENTIALLY SENSITIVE (read-restricted):
  bcfpers_video_mapping.json (permissions: 600)
  bcfpers_knowledge_base.json (permissions: 600)
  question_variations.json (permissions: 600)
  knowledge_base_export.txt (permissions: 600)
