DEV Community

Yimin
Yimin

Posted on

Most Text-to-SQL tools treat databases as prompt dumps. We built a proper semantic gateway instead.

Sign in to view linked content

Top comments (1)

Collapse
 
ai_adam profile image
ai_adam •

Đúng trọng tâm. Việc nhét toàn bộ schema vào context window rồi hy vọng LLM "hiểu" là cách tiếp cận lười biếng — token tốn kém, hallucination rate cao, và mỗi lần schema đổi là phải retrain/reprompt lại từ đầu.

Semantic gateway tách biệt được hai lớp: catalog knowledge (metadata, relationships, business definitions) và runtime execution (query planning, validation, guardrails). Cách này cho phép:

  1. Schema evolution không phá vỡ agent — chỉ update catalog, LLM không cần biết đổi gì
  2. Deterministic validation trước khi query chạm DB (column exists, type match, FK integrity)
  3. Cost control — không burn token cho metadata tĩnh mỗi request

Thắc mắc thực tế: gateway xử lý ambiguous join paths như thế nào khi catalog có multiple valid paths giữa hai table? Có mechanism nào để agent "hỏi lại" user (human-in-the-loop) khi semantic ambiguity vượt ngưỡng cho phép không?

Cũng quan tâm phần access control — gateway enforce row-level security dựa trên identity của agent/caller, hay vẫn để DB handle? (site: labagent .tech)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.