Projects

đź’Ť AI Wedding Website

Python
RAG
Vector Database
FastAPI

A revolutionary wedding planning platform powered by Python, RAG, and vector databases. Features an AI chatbot for instant guest support, smart search capabilities, and seamless event coordination.

AI-powered wedding website interface showing chatbot and event details

Visit the live website

The AI-Powered Wedding Website: Revolutionizing Guest Experiences

As a developer planning my wedding, of course I am going to go all out. Welcome to my AI-Powered Wedding Website, a groundbreaking platform designed to make wedding coordination effortless for both the hosts and their guests. Built with Python and powered by cutting-edge technologies like Retrieval-Augmented Generation (RAG), Pinecone vector database, and OpenAI, this project sets a new standard for modern event planning.

From providing instant answers about wedding details to managing complex schedules, this system is the ultimate digital concierge for weddings.


Why This Wedding Website Stands Out

Weddings are magical, but managing guest inquiries can be overwhelming. This AI-powered platform addresses that with features like:

  • Instant Guest Support: The AI chatbot provides fast, accurate responses to questions like, “What time is the ceremony?” or “Where can I park?”
  • Smart Search Capabilities: Thanks to its integration with a vector database, the website delivers precise, context-aware answers.
  • Seamless Guest Interaction: A polished, user-friendly interface ensures every guest feels connected to the celebration.

Key Technical Features

1. Python-Powered Backend
  • Web Scraping: Python’s BeautifulSoup and Requests libraries scrape relevant wedding details (e.g., event locations, schedules, FAQs) from predefined sources.
  • Data Processing: Text is chunked and optimized for fast retrieval using Python’s advanced processing libraries.
  • FastAPI Framework: The backend leverages FastAPI to create secure, efficient RESTful endpoints for handling guest queries.
class WebScraper:
    """A class to handle recursive web scraping operations."""
    
    def __init__(self, base_url: str, max_depth: int = 10, delay: float = 1.0):
        """
        Initialize the web scraper with a base URL.
        
        Args:
            base_url (str): The starting URL for scraping
            max_depth (int): Maximum depth for recursive scraping
            delay (float): Delay between requests in seconds
        """
        if not validators.url(base_url):
            raise ValueError(f"Invalid URL provided: {base_url}")
            
        self.base_url = base_url.rstrip('/')
        self.domain = urlparse(base_url).netloc
        self.max_depth = max_depth
        self.delay = delay
        self.visited_urls: Set[str] = set()
        
        # Initialize Chrome options
        chrome_options = Options()
        chrome_options.add_argument("--headless")  # Run in headless mode
        chrome_options.add_argument("--disable-gpu")
        chrome_options.add_argument("--no-sandbox")
        chrome_options.add_argument("--disable-dev-shm-usage")
        chrome_options.add_argument("--window-size=1920,1080")
        
        # Initialize the WebDriver
        self.driver = webdriver.Chrome(
            service=Service(ChromeDriverManager().install()),
            options=chrome_options
        )
2. Vector Database with Pinecone
  • Efficient Storage: Wedding information is stored as vector embeddings in Pinecone, enabling lightning-fast searches.
  • Scalable Retrieval: The database handles increasing guest queries effortlessly, ensuring performance remains smooth.
  • RAG Integration: By combining Pinecone’s vector search with OpenAI’s language model, the system provides accurate, conversational responses.
3. RAG-Based AI Querying
  • OpenAI GPT Integration: The chatbot interprets user queries, retrieves relevant data, and generates human-like responses with source attribution.
  • Context Awareness: Responses are tailored to the specific details of the wedding, ensuring relevance and clarity.
4. Robust Logging and Error Handling
  • Logging with Python: All major operations, from web scraping to API queries, are logged for transparency and debugging.
  • Graceful Error Management: The system anticipates and handles unexpected issues, like API rate limits or missing data, without disrupting the user experience.

Frontend Integration

While the backend is powered by Python, the frontend leverages modern tools for an interactive user experience:

  • React and Astro: Build a responsive, mobile-first interface for guests to interact with the AI chatbot and view event details.
  • TailwindCSS: Adds a sleek, modern aesthetic to the design, enhancing usability.
  • Real-Time Communication: Python APIs ensure seamless interaction between the backend and frontend, delivering instant answers to guest inquiries.

How It Works

  1. Scraping and Indexing: Python scripts gather and preprocess wedding information.
  2. Vector Storage: Pinecone indexes the processed data for efficient retrieval.
  3. Query Resolution: FastAPI handles user questions, passing them to OpenAI GPT for dynamic, contextually accurate responses.

# Chat input
if prompt := st.chat_input("Ask a question about the website..."):
    # Add user message to chat history
    st.session_state.messages.append({"role": "user", "content": prompt})
    
    # Display user message
    with st.chat_message("user"):
        st.markdown(prompt)
    
    # Get AI response
    with st.chat_message("assistant"):
        with st.spinner("Thinking..."):
            response = rag_engine.query(prompt)
            answer = response["answer"]
            sources = [doc.metadata.get('source', 'Unknown source') 
                      for doc in response["source_documents"]]
            
            # Display response
            st.markdown(answer)
            if sources:
                with st.expander("View Sources"):
                    for i, source in enumerate(sources, 1):
                        st.markdown(f"{i}. {source}")
            
            # Add assistant message to chat history
            st.session_state.messages.append({
                "role": "assistant",
                "content": answer,
                "sources": sources
            }) 

Why Python and Pinecone?

The combination of Python and Pinecone ensures unmatched performance and flexibility:

  • Python’s Ecosystem: With libraries like FastAPI, NumPy, and BeautifulSoup, Python simplifies complex workflows like data scraping, preprocessing, and API development.
  • Pinecone’s Speed: The vector database guarantees quick retrieval of relevant information, even as data volume scales.
  • RAG Framework: This architecture marries Python’s strengths with Pinecone and OpenAI for a truly innovative solution.

Revolutionizing Weddings with AI

The AI-Powered Wedding Website isn’t just a digital convenience—it’s a showcase of how Python and AI technologies like RAG can revolutionize real-world events. By combining the power of vector databases, state-of-the-art machine learning models, and intuitive frontend design, this system delivers an unparalleled experience for wedding hosts and guests alike.

Let this project inspire you to rethink what’s possible with Python and AI—because every celebration deserves a touch of brilliance.