Skip to content

Loading webinar...

27 Aug 2026

18:00 BST

Online

Webinar, with an on-demand replay

Martin Schaer

AI Solutions Engineer, SurrealDB

Text-to-SurQL: Prompt engineering for agentic retrieval

​Most text-to-SQL agents fail for the same boring reason: someone pasted a schema into a system prompt months ago, a field was renamed since, and the model has been confidently writing queries against a database that no longer exists. No runbook fixes that, because documentation always rots at exactly the speed your schema changes. This session takes a different approach. Instead of maintaining the prompt as a document, we generate it as a query. SurrealDB can describe its own live structure, carry notes written specifically for the model inside its DDL, and assemble the finished prompt server side.

In this session you'll learn

  1. How to generate a schema block for your prompt from live database state, so it can never drift
  2. Writing schema comments for a third audience: not the engine, not your colleagues, but the model
  3. Grounding low-cardinality values in real data to stop the most common class of hallucination
  4. Retrieving few-shot examples by meaning with vector search instead of hardcoding them
  5. Why graph traversals are an easier generation target than JOINs, and what that removes
  6. Enforcing safety with read-only roles, query plan checks, and timeouts rather than regex filters
  7. Closing the loop so accepted queries improve the next generation

THE PLATFORM

Everything an application and its agents know. Five surfaces, one engine.

IN PRODUCTION

Trusted at scale. Samsung, Nvidia, Verizon, Tencent, and Walmart run on SurrealDB.

14,000+

Developers building on SurrealDB Cloud

4M+

Developers building on SurrealDB worldwide

FROM THE TEAMS

SurrealDB gives us a foundation where we can unify semantic search, knowledge graphs, and AI-driven decision making without stitching together multiple systems. Collapsing responsibility into SurrealDB has become our default engineering posture.
Justin Foley

VP of Engineering, Later

GET STARTED

Start building with SurrealDB. One data layer for AI, from object storage to agent memory.

ISO 27001
AICPA SOC 2 Type 2
Cyber Essentials
GDPR
Cyber Essentials Plus