Beyond the Hype: Real-World Lessons and Insights from Working with Large Language Models

Juan Eduardo Coba Puerto11 Jun 2024

Problem

Mercado Libre wanted a developer assistant that answers questions about its data stack (BigQuery, Tableau, Looker, in-house tools) and tells users which table and fields hold the data they need. A prototype built on retrieval-augmented generation (RAG) won people over at first. With wider use, it fell back on the model's general knowledge when the documentation had no answer, and sometimes hallucinated. Table descriptions were also too thin: of 4,000 productive tables, half lacked adequate documentation, so the model had to guess from table names.

Example from the article: a user asks for an expert in Tableau who is available "next thursday", and the booking system needs a calendar date, not a sentence.

Solution in brief

Test the assistant on questions it must and must not answer, and fix the documents where it fails. Generate the missing table documentation with an LLM from existing field and technical docs, using a prompt with a fixed output structure. Extract structured values from free text with function calling.

Questions this case answers
  • How to produce accurate, consistently structured descriptions for thousands of undocumented data assets with a language model, at acceptable cost and with owner approval
  • How to keep a retrieval-based question-answering assistant from inventing answers when the underlying knowledge base has gaps
  • How to convert ambiguous free-text user requests into machine-readable fields with a language model
  • How to generate usable documentation for thousands of undocumented data tables with an LLM?

Tools and methods

  • RAG (LlamaIndex) — builds the knowledge index, retrieves context and generates answers with links to sources
  • LLM-generated table documentation — drafts descriptions from existing field and technical documentation
  • Prompt template with output schema — fixes the sections of a good description and adapts to the inputs available
  • Function calling — returns dates and product quantities as structured fields instead of prose
Continue reading — it's free

Google or a one-time email code. No password.