Customize Context
How to customize the LLM context in Bag of words
Context in Bag of words is associated with a data source. When connecting a data source, Bag of words will set the data source summary, its schema, and the set AI context and rules to the db and eventually to the LLM. When writing prompts, Bag of words will automatically add the right context (with prioritization) to the LLM request, to ensure the LLM will generate the best results.
When connecting a data source, Bag of words will use the data source summary and the set AI rules to generate the right data model and code to get the data. You can adjust the context and rules to tailor the data source to your needs and get the best results.
Data Source Summary
Bag of words will automatically generate a summary of the data source. You can adjust the summary to tailor the data source to your needs. A good summary will be concise, and include the most important information about the data source. For example, if you are connecting a product usage data source, a good summary would be:
AI Context
In addition to the data source summary, you can also set AI context. This is a set of rules that Bag of words will use to generate the data model and code. This is a place where you can be more specific and granular. Content can be sample queries, metrics, tables, relationships, rules, and more.
For example, you can set the following rules:
Data Source Schema
The data source schema will be automatically added to the user prompt as part of the context. Schema is formatted as a DDL
query. For example: