Automation Action – Embedded Knowledge Store | ThinkAutomation

Automation Action: Embedded Knowledge Store

Save and search for knowledge base articles using the embedded DB. Add relevant articles to an AI conversation to provide context.

Update, Get, Search and Delete from a knowledge base store using embedded document database. This action enables you to store knowledge base articles against a Collection Name. Articles can later be retrieved by their title, and you can perform semantic searches to retrieve the top x most relevant articles for any search text.

This action is useful when used with the Ask AI action. When a user asks a question, you can search the knowledge base to provide context to the asked question. The AI will then be able to answer organization specific questions based on private data.

The Embedded Knowledge Store performs searches in memory. The maximum number of articles is therefore limited depending on the memory capacity of the host computer. As a general rule, the total number of articles should be less than 25,000. If you need to perform semantic searches against any number of items, you can use the Embedded Vector Database action.

Collection Name

Articles are contained within a Collection. Multiple collections can be used. Collection names can contain letters or numbers only. Article collections are global to the ThinkAutomation instance (IE: The same collection can be used on all Solutions/Automations). A collection can contain any number of articles – however it is recommended to keep articles per collection below 10,000.

Operations:

Update

Add or update a knowledge base article within the Collection. Specify the Article Title, Tag and Article Text (these can contain %variable% replacements). If the title already exists then it’s article text will be updated, otherwise a new article will be created. The Tag is optional.

The Assign To variable will receive the number of articles updated (or blank if an error occurred). You can use the Update Now button to manually add/update articles.

Update: Importing Document Files

You can optionally specify a Import Document File for the Update operation. This is a path to a document file (Word, PDF, HTML, Markdown, RTF, Email EML,Outlook MSG, Text or Excel files). If a file is specified the contents will be read, converted to plain text and added to the article text. When importing a document, the file name will be used as the Article Title if no title is specified.

Note: Imported documents will be split into pages and a separate article will be added for each page.

Update: Special Handling Of Markdown Files

When importing Markdown files (.md extension), the Markdown text will be split into articles based on # Headings (up to 4 levels) and the title of each article will be the full heading for all levels (eg: Main Heading, Heading Level 2, Heading Level 3).

Note: This operation may take several minutes when importing large documents with many pages, or large Markdown files. You can use the Knowledge Store Browser option to manually import documents into your Knowledge Store.

Update: Add Embeddings

This option is used to include embeddings with the article record. Embeddings are a list of numbers (a ‘vector’) that are used to measure the relatedness of text strings. This enables a much more accurate list of relevant articles when doing a search. If you are using the Embedded Knowledge Store action in conjunction with an AI then you should enable this option. Enter your AI Provider Settings in the Server SettingsAI Providers section).

When using OpenAI, adding embeddings is not expensive (you could add embeddings for 1000 articles for less than $0.25).

If you do not add embeddings then the Search operation will only do a keyword match based search rather than a semantic .

Delete

Delete an existing article. Specify the Article Title to delete. The Assign To variable will receive the title value – or blank if the title does not exist. You can use the Delete Now button to manually delete articles.

Search

Search the Knowledge Base for relevant articles based on the Search For text. You can return the Top x most relevant articles – in relevance order. The Relevancy Threshold setting controls the relevancy level. Articles below the relevancy % will not be included. This value defaults to 30%.

Enable the Add Embeddings option if you added embeddings when the article was created. When this option is enabled then embeddings are obtained for the Search For text and then used to perform a semantic search of stored articles. This will provide a much more accurate list of relevant articles.

When using with AI you can specify the Max Tokens and Max Characters that should be returned in the search. This will prevent your requests from going over the token limit.

In the Return As list select either Text or Json. Specify Json if you are searching for articles to add as context for the Ask AI action. The Assign To variable will be set to the returned articles.

You can optionally assign the top (most relevant) title and tag to variables, select from the Assign Top Title and Assign Top Tag to lists.

You can also perform a Knowledge Base search on the Ask AI action itself when adding context to a conversation.

Get

Retrieve an existing article. Specify the Article Title. The Assign To variable will receive the article text – or be set to blank if article does not exist. You can use this option to lookup a specific article. In the Return As list select either Text or Json. Specify Json if you are looking up an article to add as context for the Ask AI action. The Assign To variable will be set to the returned article.

List

Get a list of all article titles in the specified Collection Name. The Assign To variable will receive the returned titles (one per line). You can use the returned data in a For Each.. Line In loop if you need to perform actions on each value returned.

Drop

Removes all articles from the specified Collection Name. The Assign To variable will receive the collection name – or blank if the collection does not exist. You can use the Drop Now button to manually drop the collection (all articles in the collection will be deleted).

<h5id=”manual-import-and-editing”>Manual Import And Editing

Click the Browse Knowledge Store button to open the Knowledge Store Browser. Here you can view articles for each collection. You can edit, add & delete articles. You can also test Searches and import multiple files & documents. You can also access the Knowledge Store Browser from the Studio – File menu.

You can also use the Web Spider action if you want to import an entire web site into your Knowledge Store.

<h5id=”tips-for-using-with-ai”>Tips For Using With AI

Ensure the Add Embeddings option is enabled when adding articles to the Knowledge Store.

If you are building a Knowledge Store in order to provide context to an AI conversation you should ensure each article text is less than approximately 25,000 characters. It is better to have lots of specific knowledge store articles than a few long ones (when importing files & documents into your Knowledge Store, these will be split into pages automatically where required).

If you have thousands of articles it is better to split them in to separate Collections based on some category. This will provide better performance during searches. For example, suppose you want to have a Chatbot that provides product information. You could ask for the product name at the start of the chat (using the Subject field). Then use this to lookup from the relevant Knowledge Base collection during the chat.

The Embedded Knowledge Store search is performed in memory, so there is a limit to the number of articles (it is recommended not to exceed 10,000). If you want to use external data sources for AI context, you can also use the Embedded Vector Database action. This enables embeddings to be stored and searched that link to external data. The vector database is stored and searched on disk, so has no upper limit.

If you are adding product support type articles, or frequently asked questions, each article should be a question and answer, for example:

I have forgotten my password, what can I do? Answer: Click the forgot password link in the control panel 'Account' menu. This will ask for an email address. Provided the email address is registered on our system, a reset password email will be sent. Click the link in the email to reset your password.

There may be occasions where you need to ensure a specific article is added to the context instead of relying on a search. For, example: If a specific keyword or combination of keywords exist in the incoming message. You can use the Get operation to lookup a specific article via it’s title, and add this as context after adding context using a search. The context wont be added twice if the article was already included in the search.

If you want to add data related context for AI (for example, customer accounts/order information) – and the data is available via a Database/CRM etc, then you don’t need to add this to the Knowledge Store. Instead, lookup the customer information via their email address from your database and add the context directly.

<h5id=”using-the-tag-value”>Using The Tag Value

The Tag is an optional text string you can add to articles. You can return the top tag when performing a Knowledge Store search. This can be useful if you want to perform specific actions within your Automation based on the tag value.

For example: Suppose you have several articles relating to ‘service status’. You could add the tag ‘service status’ to each of these. When a search is performed, if the top tag returned is ‘service status’ your Automation could lookup your service status and add this as context.

General Tips For Building A Knowledge Store

You can use separate Automations to update the Knowledge Store. For example: You could use an Email message source to read emails from a specific ‘knowledgebase’ mailbox. Any emails coming into this mailbox could update the Knowledge Store – using the %Msg_Subject% as the title and the %Msg_Body% as the article text. You can then simply send/forward emails to that email address to add/update the Knowledge Store. Or you could use the File Pickup message source to monitor a folder – and simply add files/documents to the folder that you want adding to the knowledge store.

This is one action from over 180 actions included with ThinkAutomation. The ThinkAutomation business process automation (BPA) solution is designed to automate on-premises and cloud-based business processes that are triggered from incoming messages. Automate messages received by email, database updates, webhooks, web forms, web chat, SMS messages, Twitter, Teams messages, documents, local files and other messages sources. Create any number of workflow automations using the drag-and-drop low-code designer. Simple fixed pricing, with unlimited message processing reduces overall costs compared to hosted automation solutions.

You can also extend ThinkAutomation by creating your own custom automation actions using the built-in designer and C#/VB.net code editor.

Download Free 30 Day Trial

Back To Automation Actions List

ThinkAutomation Home