Introduction

Learn how to chat with your database in natural language by using DataLang's API or using a custom GPT.

  • Alexandro Martinez
    Author
    por Alexandro Martinez
    5 months ago
  • datalang-introduction.png

    1. Set up your Data Source

    Create a DataLang account (50% off 12 months for the first 100 customers) and set up your connection string.

    Database Source

    Select "Database" and add your connection string.

    Custom Server Source

    If you don’t want to share your password (although encrypted), download the DataLang Custom server to host it on your server (see the code).

    ⚠️ TIP: Only use database users with read-only access to the tables you want exposed, and never share your API Key.

    2. Create Database Views

    Write the SQL statement to retrieve the necessary information to facilitate chat interactions among your users, employees, or customers.

    By doing this, you’re also exposing your data through the API by calling:

    datalang.io/api/data-sources/{source-slug}/views/{view-slug}?sync=false

    3. Create an Assistant

    An Assistant acts as a bridge, grouping various data sources for chat interaction. For instance, you could create a ‘Sales Assistant’ that only has access to the New York and Chicago branches' data sources, each with 2–3 specialized sales data views.

    This is great by itself, but the Assistant’s API can’t do what ChatGPT can so let’s leverage the new GPT store.

    4. Create a Custom GPT

    Head over to the GPT store, and click Create. You’d need to fill in the following details:

    • Name: Sales Assistant

    • Description: New York and Chicago sales assistant.

    • Actions: What your assistant can access (TLDR: all data views from the selected data sources).

    Go to your DataLang assistant, click “Custom GPT”, and follow the details instructions.

    Now, publish it and share it with your users, employees, or customers!

    Become an Affiliate ✨

    If you know a company or two that could benefit from this, earn up to 30% for each payment in the first year. Click here to sign up as an affiliate.


    What’s next?

    I have many ideas:

    • Support more data sources: Files, API…

    • Support more data views: Stored procedures, spreadsheets…

    • Add data formats: Table, Chart, PDF…

    Follow me to stay tuned, or subscribe to DataLang’s newsletter.

    Respetamos tu privacidad.

    TLDR: Usamos cookies para la selección de idioma, tema y analíticas. Ver más.