Inspiration

A few months ago, one of my clients reached out to me for help in creating an app that can check websites for regulatory updates. Keeping up with EU regulations, which are always changing, is challenging and feels like a full-time job. I thought, why not create an automated AI agent that can look for regulatory updates on websites and provide the latest information to users?

What it Does

RegRadar is an AI-powered regulatory compliance assistant that monitors global regulations, so you don't have to. It helps compliance professionals, legal teams, and businesses stay updated with the latest regulatory changes across various industries and regions.

How I Built It

I used Gradio for the user interface, Tavily Crawl for crawling regulatory websites, Mem0 for saving short-term memory for each session, Keyword AI for tracking LLM calls, and OpenAI for the AI models.

Challenges I Ran Into

Crawling is not an easy job. I had to figure out the API, and frameworks like Langraph were giving me a lot of headaches, so I opted to use LLM calls for decision-making instead of creating agents. I wanted response generations to be faster and went through hundreds of optimizations to reduce generation time to just a few seconds.

Accomplishments That I Am Proud Of

I learned about Mem0 and how it can be useful for user-based applications. Additionally, I built a proper application that is valuable for people who constantly have to deal with changes in EU and US regulations.

What I Learned

I discovered that it's beneficial to start small when building a complete project—beginning with code tests, probably in a Jupyter notebook, to ensure your logic works before moving on to building the UI and backend.

What's Next for RegRadar

I want to make the application more integrated and faster. I may consider using the Tavily Web Search API for quick searches for users who need rapid answers instead of generating lengthy regulatory reports.

Built With

  • gradio
  • huggingface
  • keywordai
  • mem0
  • openai
  • python
  • tavily
Share this project:

Updates

posted an update

1. Improved Regulatory Query Detection Logic (agents/reg_radar.py)

  • What changed:
    The is_regulatory_query method now only returns True for new regulatory/compliance/update questions. Follow-up regulatory questions and general questions are both treated as non-regulatory (False).
  • Why:
    To ensure only new regulatory queries trigger compliance workflows, making the assistant smarter and reducing unnecessary regulatory processing.

2. Parameter Extraction Determines and Displays User Intent (agents/reg_radar.py, README.md)

  • What changed:
    The parameter extraction step now determines the user’s intent (quick, summary, or full report) and this intent directly controls how the app responds:
    • Quick: Direct, brief answer for specific questions.
    • Summary: Short summary for summary requests.
    • Full: Comprehensive report for broad or vague queries. The detected intent is also shown to the user for transparency.
  • Why:
    To ensure the response style and detail level always match the user’s needs, and to make the decision process clear to the user.

Log in or sign up for Devpost to join the conversation.

posted an update

1. Regulatory Sources & Extraction Improvements

  • Expanded REGULATORY_SOURCES and SOURCE_FULL_NAMES:
    Added more regions (Africa, Middle East, Canada, Australia, China, India, Japan, Brazil, Russia, UK) and sector-specific sources (IT, AI, technology, telecom) for broader regulatory coverage.
  • Parameter Extraction Prompt:
    Now uses variable-driven lists for industries and regions, including IT, AI, and more, for better accuracy and easier updates.

2. Report Generation & UI/UX Enhancements

  • Report Prompt Structure:
    Improved the compliance report prompt for clarity, structure, and readability, with clear sections, bullet points, and actionable summaries.
  • Avatar Image:
    Changed the default avatar image path to a local file (./images/avatar.png) for reliability and customization.

3. Gradio UI & Tool Usage Display

  • Collapsible Accordions for Tool Usage:
    Adopted Gradio’s recommended approach for displaying tool usage and intermediate steps using the metadata["title"] field in ChatMessage.
    • Tool usage, parameter extraction, tool execution, raw data, and memory are now shown in collapsible sections.
    • The compliance report and completion message are standard chat messages (not collapsible).
  • Single Dropdown for Raw Data & Memories:
    Removed nested <details> blocks so only one dropdown is shown for "Raw Regulatory Data" and "Past Memories".
  • Default Collapsed State:
    Set the status: done in metadata for "Raw Regulatory Data" and "Past Memories" so they are collapsed by default.
  • Parameter Extraction & Memory Section Cleanliness:
    Removed duplicate headings/emojis from the content of parameter extraction and memory sections. Only the dropdown title contains the emoji/label; the content is a clean list or summary.
  • Section Renaming:
    • Changed "Raw Regulatory Data" dropdown emoji.
    • Changed "Related Past Queries" to "Past Memories".
  • Removed Results Summary:
    The "Results Summary" message (e.g., " Found X regulatory updates") was removed for a cleaner UI.
  • Completion Message:
    The elapsed time is now appended to the end of the compliance report, not as a separate message.

Log in or sign up for Devpost to join the conversation.

posted an update

Refactoring & Improvements Summary

Code Refactoring & Separation of Concerns

  • Moved Gradio UI construction from UIHandler to app.py, making UIHandler responsible only for chat and event logic. This improves maintainability and clarity by separating UI setup from business logic.
  • Split large methods (such as streaming_chatbot) into smaller, focused helper methods for better readability and easier testing.

Error Handling Improvements

  • Replaced all bare except: clauses with except Exception: to avoid catching unexpected exceptions and to follow best practices.
  • Added more informative error messages and logging for easier debugging and monitoring.

Deprecation Warning Suppression

  • Suppressed deprecation warnings at startup to provide a cleaner user and developer experience.

Memory Integration Enhancements

  • Improved the memory storage and retrieval logic for user queries and responses.
  • Ensured that memory operations are robust and do not crash the app on failure.
  • Made memory saving asynchronous to avoid blocking the UI.

Content & Display Improvements

  • Enhanced the formatting of regulatory data and memory results for better readability and user experience.
  • Updated UI elements (e.g., icons, section headers, and timing estimates) for clarity and a more modern look.
  • Improved the display of raw regulatory data and related past queries using collapsible sections and clear summaries.

Bug Fixes

  • Fixed issues related to duplicate results.
  • Addressed edge cases in user input and memory retrieval.

Dependency & API Updates

  • Updated all dependencies and API usage to ensure compatibility with the latest versions.
  • Verified that the app runs smoothly with the most recent APIs and package releases.

Log in or sign up for Devpost to join the conversation.