Context: IplanRioPeriod: 2025–2026
in production

Public service search and recommendations

Search that reads "I want to quit smoking" and finds the city's anti-smoking program.

My role

Main author of the discovery layer, with 73 of 106 commits. Before it, I maintained the previous Typesense-based search.

519
req/s peak in the load test
0%
errors across 238k requests
3
ranked lists fused with RRF
SPAN 01 // CONTEXT

Problem

People type the way they talk, while the catalog uses official service names, so plain full-text search missed. Services, courses and jobs also lived in separate stores.

SPAN 02 // IMPLEMENTATION

Solution

A Go discovery layer on PostgreSQL with pgvector, pg_trgm and unaccent. The query is expanded with synonyms and fires two calls in parallel, one embedding the question and one generating a HyDE document with Gemini and embedding that. Portuguese full-text, the question vector and the HyDE vector are fused with Reciprocal Rank Fusion, and the top 20 go through a cross-encoder reranker.

SPAN 03 // DETAILS

Highlights

  • Staged degradation. If Vertex AI doesn't answer within 4 s, search drops to two lists and, if needed, to plain full-text.
  • Profile-based recommendations across 6 dimensions (education, income, location, accessibility, age group and context).
  • CPFs (Brazilian taxpayer IDs) are never stored in clear text, only as salted hashes, in the database and in the cache.
  • On the previous Typesense version I added crawling and an LLM service for document ingestion.
SPAN 04 // OUTCOME [200 OK]

Result

The staging load test pushed 238k requests at a 519 req/s peak with zero errors. The analysis also traced the slow tail to retries against a deprecated embedding endpoint.

Quick actionsSwitch language to Português (PT-BR)
PT-BR
Quick actionsToggle light / dark theme
THEME
Quick actionsDownload résumé in Portuguese (PDF)
PDF · PT-BR
Quick actionsDownload résumé in English (PDF)
PDF · EN
Quick actionsCopy email address (fredzolio.dev@gmail.com)
COPY
NavigationProduction services and featured work
#servicos
NavigationAll projects
/en/projects/
NavigationCareer timeline
#carreira
NavigationTalks, hiring, documentation & open source
#atuacao
NavigationSkills & tooling
#stack
NavigationAcademic background, courses & languages
#formacao
NavigationContact & résumé
#contato
Projects & case studiesRio Queue
IplanRio · in production
Projects & case studiesPublic service search and recommendations
IplanRio · in production
Projects & case studiesCourses, jobs and employability API
IplanRio · in production
Projects & case studiesSuperApp load test
IplanRio · internal
Projects & case studiesNota Carioca data pipelines
IplanRio · in production
Projects & case studiesGCP cost investigation and Billing Guard
IplanRio · in production
Projects & case studiesEAí gateway and the city's MCP server
IplanRio · in production
Projects & case studiesCoding agent platform for developers
IplanRio · internal
Projects & case studiesAgents for infrastructure operations
IplanRio · internal
Projects & case studiesCity chatbot integrations
IplanRio · in production
Projects & case studiesGo email worker
IplanRio · in production
Projects & case studiesExecutive meeting room displays
IplanRio · in production
Projects & case studiesAlliomed
Vizo · in production
Projects & case studiesMaestro, a coding agent delivery pipeline
Vizo · internal
Projects & case studiesProventus
Vizo · in use by customers
Projects & case studiesSienge SaaS RPA
Vizo · sold
Projects & case studiesAWS infrastructure assessment
Vizo · client work
Projects & case studiesPLANEHAB Nosso Bairro
Freelance · live
Projects & case studiesConecta Solar
Freelance · live
Projects & case studiesVardis
Freelance · client work
Projects & case studiesLivinHub
Freelance · client work
Projects & case studiesNDC Nexus
New Data Company · prototype
Projects & case studiesWhatsApp group monitor
New Data Company · prototype
Projects & case studiesInternal ERP
New Data Company · internal
Projects & case studiesJungle Wallet
Personal · open source
Projects & case studiesZolioLab
Personal · internal
Projects & case studiesOSCE Cirurgia
Personal · prototype
Projects & case studiesENEM essay grading spike
Personal · experiment
Projects & case studiesGamePixzo
Personal · prototype
Projects & case studiesSurkai
Personal · open source