""" Discovery Lens — Entry point """ from dotenv import load_dotenv load_dotenv() import streamlit as st from components.theme import apply_theme, LOGO_SVG st.set_page_config( page_title="Discovery Lens", page_icon="🔍", layout="wide", initial_sidebar_state="expanded", ) apply_theme() defaults = { "goal": "", "product_name": "", "goal_validated": False, "context_block": "", "chunks": [], "embeddings": None, "clusters": [], "scored_clusters": [], "ost": {}, "source_map": {}, } for key, value in defaults.items(): if key not in st.session_state: st.session_state[key] = value # ── Header ──────────────────────────────────────────────────────────────────── st.markdown( f'
' f'{LOGO_SVG}' f'
' f'

Discovery Lens

' f'

' f'Discovery data is everywhere. Insight isn\'t.

' f'
', unsafe_allow_html=True, ) st.markdown("
", unsafe_allow_html=True) # ── Pipeline steps ───────────────────────────────────────────────────────────── steps = ["Extract", "Chunk", "Embed", "Cluster", "Score", "OST"] cols = st.columns(len(steps) * 2 - 1) for i, step in enumerate(steps): with cols[i * 2]: st.markdown( f'
' f'{step}
', unsafe_allow_html=True, ) if i < len(steps) - 1: with cols[i * 2 + 1]: st.markdown( '
', unsafe_allow_html=True, ) st.markdown("
", unsafe_allow_html=True) # ── How it works ─────────────────────────────────────────────────────────────── st.markdown( '
' '

How it works

' '
' '' '
Set your goal' ' — Enter your product name and goal statement. ' 'An AI coach validates quality and suggests a rewrite if it\'s vague.
' '
' '' '
Upload your files' ' — Interviews, reviews, support tickets, usability notes ' '(PDF, DOCX, CSV, TXT). Tag each file with its source type.
' '
' '' '
Get your OST' ' — The tool clusters insights, frames opportunities in JTBD ' 'language, scores them with deterministic ODI signals, and shows exactly which quotes ' 'justify every decision.
' '
', unsafe_allow_html=True, ) st.markdown( '

' '👈 Use the sidebar to get started.

', unsafe_allow_html=True, ) if st.checkbox("Show session state (debug)", value=False): st.json({k: str(v)[:200] if v else v for k, v in st.session_state.items()})