|
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:
- Find relevant documents even with inexact keywords (typos, spacing).
- Maintain context across multi-turn conversations (follow-up questions).
User Review Required
- Fuzzy Matching Dependency: Will add
thefuzz(andpython-Levenshteinfor speed) torequirements.txt. - Context Logic: We will modify the
keyword_extraction_promptsignificantly 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 strictif 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_dataandfilter_baymard_data. - Use
fuzz.partial_ratioorfuzz.token_set_ratioto check match score. Threshold > 70-80.
- Update
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_topicfrom 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
- Update
requirements.txtwiththefuzz. - Modify
search_engine.py:- Import
thefuzz. - Refactor
filter_...functions to use fuzzy matching. - Update
keyword_extraction_promptto handle history better.
- Import
- Deploy & Verify.