Cortex Analyst and LLMs
AI and Honeydew
An AI capable of translating business questions like “What is our monthly profit in Seattle?” into accurate data can significantly help business users save time.
As a semantic layer, Honeydew can provide an API that helps AI understand your data model.
The core advantages of including a semantic layer as part of an AI on data solution:
- Consistency: Honeydew provides AI with well-defined metrics and business entities. By leveraging a definition managed by Honeydew, AI can’t hallucinate a metric definition or create wrong SQL.
- Time to value: Honeydew can operate on top of a complex data schema, with multiple fact tables and snowflake schemas. By providing an abstraction that AI understands, it is possible to use Honeydew to run AI on your data without transformations.
- Complex Metrics: Many business metrics can be complex, with derivative calculations, time intelligence, dynamic levels of details, and multi-step calculations. As Honeydew manages the calculation of the metric, AI can use those metrics without making mistakes.
Honeydew can integrate with your own LLM and prompt (such as Meta LLama or OpenAI GPT-4o), or with Snowflake Cortex Analyst.
Our LLM integration requires the installation of Honeydew Snowflake Native Application.
Generic LLM + Honeydew
An application that integrates an LLM with Honeydew is typically:
- Capable of accepting a user input (a question) and showing response (data)
- Uses Honeydew API calls to get an approved semantic schema (typically, a Honeydew domain) that has curated metrics and entities.
- Uses a trained LLM that can accept as input the schema and the user question and generate a Honeydew API call such as:
- Runs the SQL statement received from Honeydew in Snowflake to get data that answers the user question.
A sample application and LLM prompts can be provided by contacting support@honeydew for common LLMs including Cortex LLM, Mistral, Llama and OpenAI GPT-4.
Cortex Analyst + Honeydew
Cortex Analyst support is in Private Preview. Please reach out to support@honeydew.ai to enable.
Cortex Analyst is Snowflake conversational API for Data. It is possible to use Analyst with Honeydew.
Honeydew automatically creates a Cortex Semantic Model from a Honeydew domain that has curated metrics and entities.
Cortex Analyst queries on the Honeydew domain are translated by Honeydew to the correct Snowflake SQL.
Best Practices
There are many best practices around teaching AI to understand your business. Our solution team can help.
Some common core practices:
- Create a domain that only includes approved metrics and attributes for AI.
- Use Honeydew metadata such as metric and attribute descriptions to teach AI about meaning.
- Include in descriptions common synonyms for metrics, or build multiple derived metrics with appropriate names that all reference the same one.
- Avoid having multiple similarly named attributes and metrics without providing a clear explanation what each means.
- Provide to AI in the domain a time spine and do not provide any other date fields. Honeydew will take care of correctly connecting the dates to specific metrics.
- Use time metrics to control how metrics relate to time correctly.
- Do not provide foreign keys, or any other internal attributes to AI. Only provide metrics and attributes a business user will directly reference. When building the query, Honeydew will automatically use its lineage to add required dependencies, even if they are not part of the domain.
Was this page helpful?