Conceptual Overview

The Semantic Model in Lyzr is a system designed to enable intelligent understanding, documentation, and utilization of structured tabular data (such as database tables) in AI workflows. It acts as a bridge between raw relational data and human-readable, AI-consumable knowledge by semantically enriching tables with detailed context.

What is a Semantic Model?

A Semantic Model adds meaning and context to structured data by attaching:
  • Table-level descriptions: High-level summaries that describe what a table represents.
  • Column-level metadata: Detailed natural language explanations for each column’s purpose and data type.
  • Data previews: Sample rows that provide real-world context to help AI systems and humans better understand usage.
By embedding this enriched information into a vector store, the Semantic Model enables more powerful:
  • Retrieval-Augmented Generation (RAG) flows,
  • Search and documentation agents, and
  • Natural language interfaces over data.

Why Use Semantic Modeling?

Traditional databases lack human-centric explanations, making it hard for:
  • Developers to understand schemas quickly,
  • AI models to answer data-related questions accurately,
  • Non-technical users to interact with structured data.
The Semantic Model solves this by:
  1. Generating semantic documentation automatically using LLMs.
  2. Structuring the output for both human consumption and AI workflows.
  3. Saving the enhanced information in a vectorized format for fast and relevant retrieval.

Core Workflow

  1. Input Source: A database table with rows and schema is provided as input.
  2. LLM-Powered Inference: A language model reviews table structure and sample data to generate descriptions.
  3. Semantic Description Output:
    • What the table is about
    • What each column represents
    • How the table connects to business or analytical use cases
  4. Storage & Retrieval:
    • These semantic blocks are embedded and stored in a vector database.
    • Future retrievals (like question answering or agent planning) can now pull contextually rich, accurate descriptions.

Components of the Semantic Model

ComponentDescription
Table NameThe identifier of the dataset
Table DescriptionA high-level explanation of the table’s content and intent
ColumnsA list of column names, each paired with a natural language description and data type
Preview RecordsOptional rows from the table used for contextual grounding
RAG ConfigConfiguration used to generate or retrieve this semantic documentation
Task HandlingFor large datasets, semantic documentation can be generated asynchronously

Benefits

  • Improved Discoverability: Semantic metadata makes it easier to search and explore datasets.
  • Agent Integration: Documentation agents and RAG models can use this metadata to answer user queries with high precision.
  • Auto-Documentation: Automatically generated explanations save time for data engineers and analysts.
  • Natural Language Access: Even non-technical users can query data through AI using the semantic layer as a knowledge base.

AI Readiness with Structure

The Semantic Model ensures that your structured data is not just readable, but meaningful and navigable by both humans and machines. It turns flat schemas into rich knowledge representations that power the future of AI-driven data interfaces. Lyzr Studio’s Semantic Model enables intelligent querying of structured data like databases or CSVs using natural language. It enriches your data tables with semantic metadata, making them easier to understand, document, and interact with — both for humans and AI agents.

1. Choose Knowledge Base Type

When creating a new Knowledge Base, select Semantic Model from the list of KB types. This type is specifically designed for structured data sources like PostgreSQL, MySQL, and CSV files. It activates Text-to-SQL capabilities and schema-based reasoning.

2. Connect a Structured Data Source

To use the Semantic Model, you must link a database or upload structured files.
  • Navigate to Data Connectors in Studio.
  • Click Create New to register a data source.
  • Provide:
    • Database Type (e.g., PostgreSQL, MySQL)
    • Host, Port, Username, Password
    • Database Name
Once configured, Lyzr will retrieve metadata such as tables, columns, and preview records.

3. Generate Semantic Documentation

Lyzr automatically infers rich metadata from the table schema and sample rows using LLMs.
  • Table Descriptions: What each table represents in plain English.
  • Column Metadata: Natural language explanations for column names and data types.
  • Sample Records: A few representative rows to provide grounding.
This semantic layer transforms raw data into AI-readable knowledge.

4. Query Structured Data via AI

Once your Semantic Model is configured, it can power AI agents that understand your schema and generate accurate SQL queries in real time.
  • Agents use the semantic documentation to infer context.
  • Natural language prompts (e.g., “Get top 10 customers by revenue”) are converted into executable SQL.
  • Agents retrieve actual rows from your database or uploaded CSVs.

5. Schema Documentation Agent

For deeper schema context, create a Schema Documentation Agent.
  • Choose your preferred LLM (GPT-4, Claude, etc.).
  • The agent will enhance descriptions at both table and column levels.
This boosts both human readability and AI accuracy.

Summary

FeatureDescription
Structured Data SupportConnect live databases or structured CSVs.
AI-Powered DocumentationAuto-generate table/column descriptions using LLMs.
Text-to-SQL EnabledAgents can query data using natural language.
Schema Agent IntegrationDeepens understanding of data context.
Ideal Use CaseFor analytics, operations, sales, or any SQL-accessible business data.

With the Semantic Model, Lyzr bridges the gap between raw relational databases and intuitive, natural language interfaces — letting teams unlock insights from structured data with ease.