Search Functionality Discussion & Improvements

#1
by AryanJh - opened

Current implementation has limitations when searching for faculty-specific or organization-related events. For example, Faculty of Mathematics and Sciences events aren't properly returned when specifically queried, even though they exist in the database.

Dynamic & Semantic Approach

  1. Dynamic Organization Learning
    Instead of hard-coding relationships, the system should learn about organizations and their relationships from the events themselves:

Extract organization names from event descriptions
Build relationship networks between organizations
Learn common event patterns
Understand location associations

  1. Semantic Understanding
    Use semantic similarity rather than exact matching:

Compare query intent with event context
Consider multiple aspects of events
Allow for fuzzy matching
Learn from user interactions

  1. Context-Aware Processing
    Consider multiple signals when processing events:

Location context
Historical patterns
Related events
Organization hierarchies
Event timing and frequency

RAG Chatbot Framework Design

Current Issues Identified

  1. Limited Search Functionality

    • Faculty-specific queries failing (e.g. "Faculty of Mathematics and Sciences" events not being returned)
    • Returning irrelevant events when specific filters requested
    • Basic keyword matching insufficient for semantic understanding
  2. Template-Based Responses

    • Rigid, mechanical responses
    • Same format regardless of query type
    • Limited ability to handle context

Implementation Steps

  1. Query Processing

    • Implement fuzzy matching for faculty names
    • Add category recognition
    • Handle temporal queries
  2. Event Processing

    • Structure RSS data consistently
    • Extract and normalize metadata
    • Create robust category mapping
  3. Matching System

    • Implement scoring algorithm
    • Add faculty-specific boosts
    • Support multiple filter criteria
  4. Response Generation

    • Create response templates for different query types
    • Add context-aware formatting
    • Improve readability of event information

Example Usage

class EventBot:
    def __init__(self):
        self.query_processor = QueryProcessor()
        self.event_processor = EventProcessor()
        self.event_matcher = EventMatcher()
        self.response_generator = ResponseGenerator()
        
    def handle_query(self, query: str, chat_history: list) -> str:
        # Process query
        query_info = self.query_processor.process_query(query)
        
        # Match events
        matched_events = self.event_matcher.match_events(
            self.events,
            query_info
        )
        
        # Generate response
        return self.response_generator.generate_response(
            matched_events,
            query_info,
            chat_history
        )

Next Steps

  1. Implement basic framework components
  2. Add faculty-specific matching
  3. Improve response formatting
  4. Add basic chat history tracking
  5. Test with sample queries
  6. Document usage patterns

Questions to Consider

  1. How to handle compound queries? (e.g., "math faculty events this week")
  2. Should we implement query relaxation for no-results cases?
  3. How to balance precision vs. recall in faculty matching?
  4. What response format works best for different query types?

Sign up or log in to comment