Improvements to Company Research: finds more contact information, more accurately, and ensures reports are always generated in the selected language.

Merged Nguyễn Vũ Việt Anh requested to merge fix/language-unify into main

More complete and reliable contact discovery

  • Increased the character limit when reading company homepage / about page / team page content (previously cut off too early, missing leadership names near the bottom of the page)
  • Added the ability to read "author bio" pages on WordPress sites — where many small companies post CEO/founder bios instead of having a dedicated "Team" page
  • Added a company-level LinkedIn search step (site:linkedin.com/in) during retrieval, plus a new step that searches per person name once names are known (new contact_linkedin_node)
  • Fix: normalize regional LinkedIn URLs (vn.linkedin.com...) to the canonical www.linkedin.com — many of these links previously didn't work because the regional subdomain doesn't carry LinkedIn's redirect logic
  • Fix a tool-binding bug when calling Gemini's grounded search (googleSearchgoogle_search), which caused the Gemini search fallback to always return empty results

Consistent report language

  • Added locale_instruction to the extraction/consolidation/timeline steps to ensure the report is always generated in a single selected language, without mixing languages between sections

Formatting & data fixes

  • Fix: the report sometimes rendered as raw code ([{'type': 'text', ...}]) instead of text, when the AI model returned content as a list of blocks instead of a plain string (happens with some Gemini models) — added a shared extract_text_content() helper to handle this
  • Fix: validate email before saving a contact to the DB — a malformed email could previously crash the GET /api/v1/leads/ endpoint
  • Fix: the default "Unknown" role value was blocking a more accurate role from being saved on a later research run
  • Fix: case-sensitive role matching was causing valid roles to incorrectly fall back to "Unknown"

Merge request reports