DEV Community

Onur Ceyhan for Mantis Stajyer Blogu

Posted on

Tagwise: Technical Review of AI-Powered Bookmark Categorization Project

Introduction

Tagwise is a straightforward and effective AI-powered web application developed as an internship project to automatically categorize bookmarked links.

You can checkout project at Mantis Intern's Github.

This article clearly discusses the project's technical infrastructure, methodologies, and developed solutions.

Tagwise Overview

Project Objective

Modern internet users frequently bookmark hundreds of links, but manually organizing these links is often time-consuming. Tagwise aims to automate this task, quickly and accurately categorizing bookmarks from a single URL input.

Technologies Used

  • Backend Framework: Django, Django REST Framework
  • Database: PostgreSQL (psycopg2)
  • HTTP Requests: httpx
  • HTML Parsing: BeautifulSoup4
  • Web Automation: Selenium, webdriver_manager
  • Artificial Intelligence: OpenAI GPT-4o, Google Gemini API
  • YouTube Integration: yt-dlp, youtube-transcript-api
  • Vector Store & Chatbot: LangChain, FAISS (used only for chatbot functionality)

System Workflow and Process

  1. URL Processing
    Users enter only the URL. The content from the URL is retrieved in HTML format using httpx. HTML content is parsed into the title, description, and main content using BeautifulSoup4.

  2. Special Process for YouTube Links
    For YouTube links, video titles and descriptions are fetched using yt-dlp. If available, transcripts (subtitles) are retrieved using youtube-transcript-api. The gathered content is then sent to the AI for categorization.

  3. Alternative Content Capture (Selenium)
    For sites where HTML content cannot be fetched or parsed, a screenshot of the page is captured using Selenium. This screenshot is sent as visual data to the AI model for category determination. Additionally, if the site lacks a thumbnail (og:image), the Selenium screenshot is automatically used as a thumbnail.

System Workflow

Category Assignment Approach

The categorization process is entirely performed through large language models (LLMs). Prompt engineering methods send content directly to OpenAI GPT-4o or Google Gemini API, automatically determining the category. Technologies such as vector store, RAG, or embeddings are not used in the category determination process.

Chatbot Feature and Vector Store Usage

Chatbot Functionality

The project also includes a chatbot feature allowing users to query their bookmark archives in natural language. This chatbot operates by converting bookmark content into embeddings via LangChain, which are then stored in a FAISS vector store. When a user query is received, relevant content is retrieved using the Retrieval-Augmented Generation (RAG) methodology, and presented to the user. These vector store and embedding operations are exclusively for chatbot functionality and are not involved in the categorization process.

Challenges Encountered and Solutions

  • Fetching HTML Content: Selenium screenshot solutions were employed for content that could not be directly fetched with httpx and BeautifulSoup4.
  • YouTube Transcript Absence: Categorization was conducted solely based on video titles and descriptions when transcripts were unavailable.
  • Thumbnail Absence: Selenium screenshots were utilized as thumbnails when og:image or similar visuals were missing.

Conclusion

Tagwise offers a simple yet efficient solution for automatically categorizing bookmarks quickly. The project was developed as part of an internship. No further development is planned for the time being.

Feel free to reach out with your questions and comments!

Top comments (0)