Skip to main content

Add the ‘Update Knowledge’ Tool step to your Tool

You can add the ‘Update Knowledge’ Tool step to your Tool by:
  1. Creating a new Tool, then clicking + Add Step
  2. Searching for and adding the ‘Update Knowledge’ Tool step
  3. Clicking ‘Expand’ to see the full Tool step
  4. Selecting the knowledge table you would like to access
  5. Filter condition: “and” vs “or” when matching data to update:
    • Use and when all specified conditions must match for a row to be updated.
    • Use or when any of the conditions can match.
    Filter condition only applies if you include more than one object in the filter
  6. Filters: Accepts a JSON selection of objects, where each object corresponds to a row. Add more objects as outlined in the formatting examples below to match multiple rows at once.
  7. Update value: Provide an object with the new values to update. Each key should match a column name in your knowledge table, and its corresponding value will replace the current value in the matching row.
  8. Use the Sync on upload field to determine whether the data should be vectorized when added to the knowledge set. In most cases, you’ll want this enabled as it allows your agents to semantically search and retrieve relevant information from your knowledge table.
  9. Click Run step to test out the Tool

Common errors

This indicates that there is a formatting issue in the “New data to insert” input field. Make sure your object is formatted correctly. Expected property name or '}' in JSON at...
This means the data being inserted into the knowledge table is not a JSON. Invalid JSON

Formatting Examples

Example 1: Replace all poodles with bulldogs

// Filters
[
  {
    "breed": "poodle"
  }
]
// Update value
[
  {
    "breed": "bulldog"
  }
]

Example 2: Replace all small poodles with large bulldogs

// Filters
[
  {
    "breed": "poodle",
    "size": "small"
  }
]
// Update value
[
  {
    "breed": "bulldog",
    "size": "large"
  }
]

Example 3: Replace all poodles and bulldogs with cats

// Filters
[
  {
    "breed": "poodle"
  },
  {
    "breed": "bulldog"
  }
]
// Update value
[
  {
    "breed": "cat"
  }
]
Ensure to separate each object with a comma if filtering multiple rows.

Using Variables in JSON

You can use variables from Tool inputs and other Tool steps in the Filters and Update value fields. For detailed information on how to use variables in JSON for Knowledge Tool steps, including variable syntax and typing, see Using Variables in JSON. For Knowledge Tool steps, all variables should be wrapped in quotes in the JSON format: "{{variable_name}}". The type of the updated value is determined by the column type defined in your knowledge table, and values will be automatically converted to match the column type during the update.

Frequently asked questions (FAQs)

If “Sync on Upload” is disabled, the data will be stored but not vectorized. This means your agents won’t be able to semantically search or reference that data until you manually vectorize it.
You can update a field to be empty/blank by setting the value to empty quote marks "".
You can use text, numbers, booleans, or any JSON-serializable value. Just make sure each object in the array follows the correct formatting.