HOW TO USE JSON KEY-VALUE PAIRS IN AI PROMPTS

Webmind is your JSON (JavaScript Object Notation) Knowledge Base. When you upload content to your Knowledge Base, such as your website page content, files, faqs, videos, or general text, Webmind will instantly convert your files to JSON, whether it's scraping your entire company Website, converting your PDF files to text, or transcribing Videos to text, Webmind will automatically organise your content into a JSON allowing you to logically instruct your AI Agent to retrieve the exact content that you wish and reduce conflict and hallucinations.

Webmind is more than a text-based Knowledge Base with a collection of text files, your content is instantly converted and organised into a JSON database, we call your JSON database "Webmind".

EXAMPLE

Your Knowledge Base might contain hundreds of instances of shoes, but you might specifically target "Brown Boots in Size 8" to provide your customer with an end-of-line discount code. Because your prompt is very specific to an exact variant of a product, an AI Language Model (LLM) could be prone to selecting the wrong product and applying a discount to another item. To solve this problem, we use JSON, which offers broad applications and great flexibility for prompting an AI Agent like a Chatbot.

Webmind is segmented into a series of smaller Knowledge Bases to allow structured targeting of very specific content.

These Knowledge Bases are:

  • FAQ
  • PAGE
  • PRODUCT
  • FILE
  • BLOG
  • VOICE

Each of your Knowledge Bases is stored in a separate JSON file:

  • yoursitename_page.json
  • yoursitename_product.json
  • yoursitename_product.json
  • yoursitename_faq.json
  • yoursitename_blog.json
  • yoursitename_voice.json

KNOWLEDGE BASE HIERARCHY

Your Webmind JSON Knowledge Base is organised with the following hierarchy:

  1. Knowledge Bases
  2. AI Tags
  3. JSON Key-Value Pair

What are AI Tags?
You may further segment your Knowledge Bases with AI Tags. AI Tags offer your AI Agent a clear method to segment content, with identifies that you can specifically target.

Imagine your Webmind Knowledge Base as a large spreadsheet. Think of your Knowledge Bases as separate sheets, and AI Tags as a Column Header that is used as a Unique Identifier for your AI Agent to target.

What are JSON Key-Value Pairs?
A spreadsheet is organised with Columns and Rows in a table structure. JSON is organised with Key-Value Pairs in a tree structure, where the "Key" is like the Column Header and "Value" is like the information in the cell within the Column.

SYNTAX EXAMPLE

"Product Size" : "Large"
  • Key: "Product Size" – Represents the attribute of the product.
  • Value: "Large" – The specific option selected for the attribute.

INSERTING A JSON KEY-VALUE PAIR

You can use JSON within your Chatbot Prompts to instruct your AI Agent the exact task to perform with Key-Value Pairs. Understanding how to insert and manipulate these pairs correctly in your prompts is crucial for effectively targeting specific Knowledge Base attributes.

To insert a JSON Key-Value Pair, follow these steps:

  1. Start by typing Double Quote (") into the Prompt text editor:

    • Key Names will appear via a dropdown inside the Text Editor.
    • Select the Key Name that you wish to use.

  2. Using Only the Key:
    Most prompts will use only the key name to apply actions to all values within a specific key without specifying a particular value.

    • Example: "Product Size"
    • Example Prompt: "Retrieve the Value from the "Product Size" key..."

  3. Using the Key Name and Value Pair
    Target and exact Value within a Key by using Colon (:) and another Double Quote ("): 
    • Target and exact Value within a Key by using Colon (:) and another Double Quote ("):
      For example: "Product" : "Large"
    • You might with to target exact Values
      For Example you might prompt:
      "If the customer says they are size large only retrieve items from the "Product Size" : "Large" variants..."

BEST PRACTICES

  • Consistent Quotation:
    Always use double quotes (") around both keys and values to maintain valid JSON syntax.
  • Case Sensitivity:
    Ensure that the Key Names match exactly as defined in your platform to avoid errors.
  • Valid Values:
    When replacing the value, make sure it corresponds to one of the predefined options available for that key.
  • Avoid Trailing Commas:
    In JSON objects, do not place a comma after the last Key-Value Pair.

COMMON USE CASES

  • Listing All Available Sizes:
    Example:

    "Product Size"

  • Referencing a Product Size:
    Example:

    "Product Size" : "Extra Large"

  • Using Multiple Keys:
    Example:

    Only retrieve products that match the exact Values for "Product Size" : "Large" and "Product Colour" : "Red" ...

SUMMARY

  • Key-Value Pair Usage:
    • Specific Targeting: Use both key and value to define or modify a particular product attribute.
      Example:

      "Product Size" : "Large"

    • General Targeting: Use only the key to reference all values associated with that attribute.
      Example:

      "Product Size"

  • Syntax Adherence:
    Maintain proper JSON syntax by using double quotes and avoiding unnecessary commas.
  • Customisation Flexibility:
    By understanding how to manipulate JSON key-value pairs, you can effectively customise various product options to enhance user experience and product management.

70 Award
Winning AI Themes

Start your AI Website now
Start your AI Agency now

GETTING AROUND

GET A QUOTE

A Web Builder for Design. A CMS for Business. We serve all businesses from SME's to Enterprise. Talk with us for AI development, custom website design, website development, ecommerce websites, directories, intranets and social networks.