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.