3.1 - Marketing Team Use Case
Overview
Let's explore a hypothetical scenario.
Our companys marketing team is tasked with streamlining content generation using AI. We will utilize a practical approach for leveraging AI to create social media posts through NeuralSeek’s mAIstro platform.
We’ll explore two methods for building a solution in mAIstro:
- Using NeuralSeek's built-in Auto-Builder feature in mAIstro.
- Building a fully customized mAIstro agent tailored to user queries.
Auto-Builder
NeuralSeek's Auto-Builder is the fastest way to get started with mAIstro. It allows you to create an agent using a natural language prompt. This is ideal for quickly generating useful content, such as social media posts.
- Navigate to the mAIstro tab.
- Click the Generate Agent icon at the botton of the screen.
- Add a natural language prompt to the Auto-Builder. For this use case, add:
Write a social media post about NeuralSeek features using documentation.neuralseek.com.
- Click Generate Agent.
An agent will auto-populate in the Agent Editor resembeling the agent below:
NTL
Write a social media post highlighting the features of NeuralSeek using the documentation from documentation.neuralseek.com. Include key points and benefits that would appeal to potential users.
{{ web | url: "https://documentation.neuralseek.com" }}=>{{ summarize | length: "1500" }}=>{{ LLM | prompt: "Create a social media post that highlights the key features and benefits of NeuralSeek based on this document. Make it engaging and appealing to potential users." | cache: "true" }}
{{ LLM | prompt: "" | cache: "true" }}
You can expand each node by clicking the gear icon in the top corner. Let's walk through each node:
- We start with a Text node outlining the usecase.
- Next, we will hit a Website Data node with our provided documentation website populated.
- This is chained to a Summarize node to summarize the results from the website data.
- Next we have a Send to LLM node chained with a prompt to create the social media post.
- Finally, our agent will send all of the above nodes and content to the LLM for generation in the final Send to LLM node.
- Click Run Agent to view the generated social media post.
This gives a strong starting point. From here, we will explore how we can build the agent to respond dynamically to user inputs and utilize the functionality in a chatbot experience.
Social Media Agent
To make our solution more interactive and personalized, we’ll build a custom mAIstro agent. Our agent will perform the following functions:
- Gather the user query and context.
- Search our KnowledgeBase for information based on the context of the user query.
- Create a bulleted list of details from the KnowledgeBase search.
- Generate a shareable social media post for our marketing team to share.
This is ideal for scenarios where users are asking specific product questions and we want to generate promotional or educational content around their interests.
Gather User Query
First, we will gather the user's question and intent to be stored as a variable for later processing. The condition added states that if the query variable is blank, then set it to the query enhanced with NeuralSeek context keeping.
- Add a Seek Input node.
- Drag and drop a Condition node to chain together. Click the gear icon and add this condition to evaluate:
'<< name: query, prompt: false >>' == ''
- Drag and drop a Set a Variable to chain together. Click the gear icon to set the variable name as
query
. Directly set the value to a new variable:<< name: seekIn.contextQuery, prompt: true >>
For multi-turn interactions, we will add a fallback that parses prior user input. The condition here states that if the query variable is blank, then set it to the chat history as an array of objects.
- Add a Condition node. Click the gear icon and add this condition to evaluate:
'<< name: query, prompt: false >>' == ''
- Drag and drop a Text node to chain together. Click the gear icon to add this variable as the prompt:
<< name: seekIn.lastTurn, prompt: false >>
- Drag and drop a JSON to Variables node to chain together. This will turn the chat history array into flattened variabled.
- Drag and drop a Set a Variable node to chain together. Click the gear icon to set the variable name as
query
. Directly set the value to a new variable:<< name: [0].input, prompt: false >>
Finally, add a third fallback. The condition here states that if the query variable is blank, then set it to the original user input.
- Add a Condition node. Click the gear icon and add this condition to evaluate:
'<< name: query, prompt: false >>' == ''
- Drag and drop a Set a Variable node to chain together. Click the gear icon to set the variable name as
query
. Directly set the value to a new variable:<< name: seekIn.originalQuery, prompt: false >>
Search the KnowledgeBase
Next, we will invoke a search of our KnowledgeBase containing our company documentation to fetch relevant documentation.
- Add a KB Search node. Click the gear icon to add the query variable as the KnowledgeBase search:
<< name: query, prompt: false >>
- Drag and drop a Summarize node to chain together. Set the desired summary length to
4500
- Drag and drop a Set a Variable node to chain together. Click the gear icon to set the variable name as
kb_data
Create a List of Features
Next, we process the KB summary into a concise, bulleted list to allow for user-friendly content generation downstream.
- Add a Send to LLM node. Click the gear icon to add the following prompt:
Create a bulleted list of features based on this document: << name: kb_data, prompt: false >>
. - Drag and drop a Set a Variable node to chain together. Click the gear icon to set the variable name as
list_data
Generate a Social Media Post
Finally, we can use the user’s query and the list of features to generate a dynamic, context-aware social media post.
- Add a Send to LLM node. Click the gear icon to add the following prompt:
Write a social media post using this data from the user: << name: seekIn.originalQuery, prompt: true >> Here is some data to help: << name: list_data, prompt: false >>
- Click the Save icon at the bottom of the screen to save the agent. Provide a unique name and description.
Social Media Agent NTL
{{ seekIn }}=>{{ condition | value: "'<< name: query, prompt: false >>' == ''" }}=>{{ variable | name: "query" | value: "<< name: seekIn.contextQuery, prompt: true >>" }}
{{ condition | value: "'<< name: query, prompt: false >>' == ''" }}=>
<< name: seekIn.lastTurn, prompt: false >>=>{{ jsonToVars }}=>{{ variable | name: "query" | value: "<< name: [0].input, prompt: false >>" }}
{{ condition | value: "'<< name: query, prompt: false >>' == ''" }}=>{{ variable | name: "query" | value: "<< name: seekIn.originalQuery, prompt: false >>" }}
{{ kb | query: "<< name: query, prompt: false >>" }}=>{{ summarize | length: "4500" }}=>{{ variable | name: "kb_data" }}
{{ LLM | prompt: "Create a bulleted list of features based on this document: << name: kb_data, prompt: false >>" | cache: "true" }}=>{{ variable | name: "list_data" }}
{{ LLM | prompt: "
Write a social media post using this data from the user: << name: seekIn.originalQuery, prompt: true >>
Here is some data to help:
<< name: list_data, prompt: false >>" | cache: "true" }}
Create a Social Media Category
To integrate the agent into chatbot routing logic, we’ll create a custom category that uses this agent when social media-related queries are detected.
- Navigate to the Configure tab. Ensure that Multi-Agent Routing is enabled in the bottom right corner.
- Click Add a Category.
- Name the new category
Social_Media
, add a brief description, set the Action to take on match tomAIstro-led
. Click Save Category. - Click on the Default Action and select your newly created mAIstro Agent from the drop-down list. Click save.
Test in Chat
Finally, test the complete experience within the chatbot interface to ensure it flows smoothly.
- Navigate to the Chat tab
- In the chat, type in the following question:
What is filtering in NeuralSeek?
. This is a new feature released that our marketing team is tasked to write about. First, we need to know what it is, so we will query our KnowledgeBase source. - Follow up with a second prompt:
Write a LinkedIn post about it.
. Even though we are not defining what "it" is, our mAIstro agent will utilize Seek's built-in context keeping to understand that we are referencing filtering in NeuralSeek. - View the newly generated social media post. You can validate it for tone, accuracy, and completeness.