|
Download docs/implementation_plan.md from YGCXLab/ux-research-agent-slackbot: direct link, hf CLI and curl.
- Browser
- Download file 2.39 kB
-
https://huggingface.co/spaces/YGCXLab/ux-research-agent-slackbot/resolve/main/docs/implementation_plan.md
- Command line
-
hf download hf://spaces/YGCXLab/ux-research-agent-slackbot/docs/implementation_plan.md
-
curl -L -o implementation_plan.md https://huggingface.co/spaces/YGCXLab/ux-research-agent-slackbot/resolve/main/docs/implementation_plan.md
2.39 kB
| # Search Quality & Context Improvement Plan | |
| ## Goal | |
| Improve the Slackbot's ability to: | |
| 1. **Find relevant documents** even with inexact keywords (typos, spacing). | |
| 2. **Maintain context** across multi-turn conversations (follow-up questions). | |
| ## User Review Required | |
| - **Fuzzy Matching Dependency**: Will add `thefuzz` (and `python-Levenshtein` for speed) to `requirements.txt`. | |
| - **Context Logic**: We will modify the `keyword_extraction_prompt` significantly to explicitly ask for "Context" or "Inherited Keywords". | |
| ## Proposed Changes | |
| ### 1. Improve Search Quality (Fuzzy Search) | |
| **Files**: `requirements.txt`, `search_engine.py` | |
| - **Install `thefuzz`**: Use Levenshtein distance for metadata matching instead of strict `if keyword in text`. | |
| - **Exact Match Boost**: Give higher priority or explicit inclusion to exact ID/Title matches if the user mentions them. | |
| - **Code Change**: | |
| - Update `filter_internal_data` and `filter_baymard_data`. | |
| - Use `fuzz.partial_ratio` or `fuzz.token_set_ratio` to check match score. Threshold > 70-80. | |
| ### 2. Enhance Context Awareness | |
| **Files**: `search_engine.py` | |
| - **Prompt Engineering**: Update `keyword_extraction_prompt`. | |
| - New Instuction: "If the User Query is a follow-up (e.g., 'tell me more about that', 'what about the first one'), EXTRACT keywords from the *previous Assistant response* in Chat History." | |
| - Explicitly ask for `primary_topic` from history. | |
| - **Search Logic Update**: | |
| - If the extracted keywords imply a *specific* item (e.g., "RES-001" or a specific title found in history), force a direct ID lookup or high-priority search for that item. | |
| ### 3. Verification Plan | |
| - **Test Case 1 (Search)**: Query "์๋ฆฌํธ๋ฉค๋ฒ์ญ" (no space) or "์๋ฆฌํธ ๋งด๋ฒ์ญ" (typo) -> Should find "์๋ฆฌํธ ๋ฉค๋ฒ์ญ...". | |
| - **Test Case 2 (Context)**: | |
| - User: "Search for Membership" | |
| - Bot: "Here is [Elite Membership Survey]..." | |
| - User: "Tell me more about the low satisfaction group" | |
| - **Result**: Bot should know "Elite Membership Survey" is the context and answer using its content. | |
| ## Detailed Tasks | |
| 1. [ ] Update `requirements.txt` with `thefuzz`. | |
| 2. [ ] Modify `search_engine.py`: | |
| - Import `thefuzz`. | |
| - Refactor `filter_...` functions to use fuzzy matching. | |
| - Update `keyword_extraction_prompt` to handle history better. | |
| 3. [ ] Deploy & Verify. | |