Portfolio · AI Engineer
All projects

AI / LLM / Agent · Live · invite only

Knowledge Base: paint-contracting quotation Q&A

An AI agent that answers quotation questions with figures from Postgres (synthetic data), through 10 read-only MCP tools.

A Postgres store (19 tables) of paint-contracting quotations and cost estimates, loaded from validated YAML files, plus a read-only MCP server that lets an AI agent compare unit prices and explain differences with concrete figures. A Gemini bot calls those 10 read-only MCP tools and answers in the language of the question (Vietnamese or English); the data itself is in Vietnamese. All data is fictional: the company "Sơn Việt Demo Co.", 24 projects and 126 work items; every company, project and brand name is invented.

Go to the demo
Group
AI / LLM / Agent
Demo
Live · invite only
Core stack
Python · FastAPI · PostgreSQL

Demo

Loading the demo…

Problem

Contractors keep having to answer questions like "is this quote expensive compared with past projects?" or "what share is labour, and is that unusual?". In spreadsheets the answers are scattered across several sheets (quotation, material norms, labour table) and have to be stitched together by hand.

Approach

Each YAML file describes one project; it is validated and written to Postgres in a single transaction (all or nothing). The MCP server is read-only: it connects with a read-only Postgres role, so an agent cannot write even if it tries. Each common question has a tool that answers with figures (unit-price comparison, estimate detail, labour cost, cost breakdown), plus one SELECT-only tool for everything else. The agent just picks a tool and explains the result in the language of the question; the Gemini bot shows every tool call so viewers can see where the numbers come from.

Highlights

  • 10 read-only MCP tools, including a SQL tool that accepts only SELECT/WITH and returns at most 200 rows.
  • Writing and reading are separate services; the MCP server uses a read-only Postgres role, so the database itself rejects any write.
  • Validated ingestion: errors point to the location in the YAML file, and writes happen in one transaction.
  • A Gemini bot calls the MCP tools and streams its answer over SSE, so viewers see each tool call before the answer.
  • Fictional sample data, generated deterministically by a script, with a test ensuring the data folder matches the generator output.