# UX/Research Chatbot PoC Walkthrough This document outlines how to set up and run the Proof of Concept (PoC) for the UX/Research Chatbot. This agent searches internal research reports and Baymard guidelines using metadata filtering and LLM generation. ## Features - **Multimodal (Image/Video) Analysis**: Analyze UI designs for usability issues or search for similar references using uploaded files. - **Unified Search**: Searches both `research_report.json` and `baymard_unified_database_v2.json`. - **Agentic Retriever (RAG)**: LLM이 직접 Fuzzy 검색→문서 읽기→판단 루프를 실행하는 에이전트 기반 검색. - **Source Routing**: detect intent (e.g., "사내 리서치만", "베이마드만") to filter data sources. - **Context Awareness**: Remembers previous conversation turns to handle follow-up questions (e.g., "그 중에서 사내 리서치만 보여줘"). - **Smart Filtering**: Extracts keywords from natural language queries to filter documents before generation. - **LLM**: Powered by Google Gemini 3 Flash (`gemini-3-flash-preview`). ## Setup ### 1. Prerequisites - Python 3.8+ - Google API Key ### 2. Installation 1. Navigate to the project directory: ```bash cd /Users/johan/.gemini/antigravity/brain/e4e4053f-3b95-42ed-b913-7720b36a4303 ``` 2. Install dependencies (if not already done): ```bash pip install -r requirements.txt ``` 3. Set up API Key: - Ensure `.env` file exists and contains `GOOGLE_API_KEY=your_key_here`. ## Deployment The project is deployed on Hugging Face Spaces as two separate services: ### 1. Web Application (Streamlit) * **URL**: [https://huggingface.co/spaces/YGCXLab/ux-research-agent-poc](https://huggingface.co/spaces/YGCXLab/ux-research-agent-poc) * **Purpose**: User-friendly web interface for research and file analysis. * **Deployment**: `python deploy_web.py` ### 2. Slackbot * **Space**: [https://huggingface.co/spaces/YGCXLab/ux-research-agent-slackbot](https://huggingface.co/spaces/YGCXLab/ux-research-agent-slackbot) (No UI) * **Purpose**: Dedicated bot for Slack integration (Socket Mode). * **Deployment**: `python deploy_slack.py` ### Slackbot Integration & Deployment (2026-01-14) - **Separate Deployment**: Deployed Slackbot to a dedicated Hugging Face Space (`ux-research-agent-slackbot`) to ensure stability and independent scaling. - **Full RAG Support**: - Implemented `indexer.py` improvements to extract text from **original PDF files** (Baymard) and **Markdown files** (Internal Research). - Configured server-side indexing: The bot automatically builds a fresh Vector DB from the uploaded `data` folder on startup, ensuring compatibility and data freshness. - **Multimodal & Interactive**: - Supports image/video inputs for UX analysis. - Added emoji reactions (🤔, ✅, ⚠️) for better user feedback during processing. - Enabled "Socket Mode" for reliable communication without public URL exposure. ## Web Interface (Streamlit) Local Run To run the web app locally: ```bash venv/bin/streamlit run app.py ``` This will open a browser window at `http://localhost:8501`. - Enter your question in the chat input. - Clear chat history using the button in the sidebar. ## Usage Examples ### Scenario 1: General Research Ask for materials across all sources. > **User**: "리뷰 관련 자료 찾아줘" > > **Bot**: > - [Internal Research] [IDI] 리뷰 탐색 경험 개선 선행... > - [Baymard Guideline] Allow Users to Sort Reviews #837... > > (Summary and links are provided for both sources) ### Scenario 2: Source-Specific Search Ask specifically for internal or external data. > **User**: "리뷰 관련 **사내리서치** 내용 찾아줘" > > **Bot**: > - [Internal Research] [IDI] 리뷰 탐색 경험 개선 선행... > - [Internal Research] 추천 이니셔티브... > > (Only internal research items are returned) ### Scenario 3: Context-Aware Follow-up Refine your search using previous context. > **User**: "리뷰 관련 자료 찾아줘" > **Bot**: (Returns mixed results) > **User**: "**그 중에서** 사내 리서치만 보여줘" > **Bot**: (Filters previous topic for internal research only) ### Scenario 4: Design Critique (Multimodal) Get feedback on a UI design. > **Input**: (Uploads screenshot of a checkout page) > **User**: "이 화면의 문제점이 뭐야?" > **Bot**: > "해당 화면에서 다음과 같은 UX 문제점이 발견됩니다: > 1. '결제하기' 버튼이 스크롤 아래에 있어 발견하기 어렵습니다 (Baymard Guideline #124 참조). > 2. ..." ### Scenario 5: Visual Reference Search (Multimodal) Find guidelines relevant to a specific UI pattern. > **Input**: (Uploads screenshot of a date picker) > **User**: "이런 UI와 관련된 가이드라인 찾아줘" > **Bot**: > "이미지에서 'Date Picker', 'Calendar' 요소가 식별되었습니다. 관련 가이드라인은 다음과 같습니다: > - [Baymard] Date Picker Design Best Practices..." - `search_engine.py`: Main entry point and logic (CLI, LLM Chain). - `requirements.txt`: Python package dependencies.