Documentation
HomeAPISign In
  • Getting Started
    • Overview
      • Core Concepts
      • Building your First Workflow
    • API Reference
  • Your Data
    • Brand Kits
    • Knowledge Bases
      • Add Data
        • Upload Files
        • Web Scrape
        • Import from Google Drive
        • Import from SQL Database
        • Import from Shopify
      • Knowledge Base Search
      • Knowledge Base Metadata
      • Knowledge Base API
  • Building Workflows
    • Workflow Concepts
      • Workflow Inputs
        • Input Types
      • Workflow Outputs
      • Variable Referencing
      • Liquid Templating
    • Workflow Steps
      • AI
        • Prompt LLM
          • Model Selection Guide
          • Prompting Guide
        • Transcribe Audio File
      • Web Research
        • Google Search
        • Web Page Scrape
      • Code
        • Run Code
        • Call API
        • Format JSON
        • Run SQL Query
        • Write Liquid Text
      • Flow
        • Condition
        • Iteration
        • Human Review
        • Content Comparison
        • Error
      • Data
        • Read from Grid
        • Write to Grid
        • Search Knowledge Base
        • Write to Knowledge Base
        • Get Knowledge Base File
      • AirOps
        • Workflow
        • Agent
      • Image & Video
        • Generate Image with API
        • Search Stock Images
        • Fetch Stock Image with ID
        • Resize Image
        • Screenshot from URL
        • Create OpenGraph Image
        • Create Video Avatar
      • SEO Research
        • Semrush
        • Data4SEO
      • Content Quality
        • Detect AI Content
        • Scan Content for Plagiarism
      • Content Processing
        • Convert Markdown to HTML
        • Convert PDF URL to Text
        • Group Keywords into Clusters
      • B2B Enrichment
        • Hunter.io
        • People Data Labs
      • CMS Integrations
        • Webflow
        • WordPress
        • Shopify
        • Contentful
        • Sanity
        • Strapi
      • Analytics Integrations
        • Google Search Console
      • Collaboration Integrations
        • Gmail
        • Google Docs
        • Google Sheets
        • Notion
        • Slack
    • Testing and Iteration
    • Publishing and Versioning
  • Running Workflows
    • Run Once
    • Run in Bulk (Grid)
    • Run via API
    • Run via Trigger
      • Incoming Webhook Trigger
      • Zapier
    • Run on a Schedule
    • Error Handling
  • Grids
    • Create a Grid
      • Import from Webflow
      • Import from Wordpress
      • Import from Semrush
      • Import from Google Search Console
    • Add Columns in the Grid
    • Run Workflows in the Grid
      • Add Workflow Column
      • Run Workflow Column
      • Map Workflow Outputs
      • Review Workflow Run Metadata
    • Review Content in the Grid
      • Review Markdown Content
      • Review HTML Content
      • Compare Content Difference
    • Publish to CMS from Grid
    • Pull Analytics in the Grid
    • Export as CSV
  • Copilot
    • Chat with Copilot
    • Edit Workflows with Copilot
    • Fix Errors with Copilot
  • Monitoring
    • Task Usage
    • Analytics
    • Alerts
    • Execution History
  • Your Workspace
    • Create a Workspace
    • Folders
    • Settings
    • Billing
    • Use your own LLM API Keys
    • Secrets
    • Team and Permissions
  • Chat Agents (Legacy)
    • Agent Quick Start
    • Chat Agents
    • Integrate Agents
      • Widget
      • Client Web SDK
  • About
    • Ethical AI and IP Production
    • Principles
    • Security and Compliance
Powered by GitBook
On this page
  • What is Knowledge Base Metadata?
  • How to Add Metadata to a Knowledge Base
  • Adding Metadata Columns from a .csv or Sheet
  • Filtering Knowledge Bases with Metadata
  • Filtering on Metadata in a Workflow
  • Filtering on Metadata in the API

Was this helpful?

  1. Your Data
  2. Knowledge Bases

Knowledge Base Metadata

Filter when searching a Knowledge Base

Last updated 2 months ago

Was this helpful?

What is Knowledge Base Metadata?

Metadata is additional information you can add to a document that you can filter on when searching a Knowledge Base, similar to filtering the columns of a spreadsheet.

For example, you may want to:

  • Only return information specific to a client

  • Only return results that have a relevant classification

  • Only return results in a specific location

How to Add Metadata to a Knowledge Base

There are 3 different ways to add metadata to a knowledge base document:

  1. While adding your .csv or Google Sheets as content into the Knowledge Base

    • All columns in your .csv or Google sheet will be stored as metadata by default

  2. Via the endpoint

  3. Via the AirOps

Adding Metadata Columns from a .csv or Sheet

When uploading a .csv or connecting a Google Sheet, you will have the option to manually pick or choose which columns will be searchable. The remaining columns will still be returned as results, but the searchable columns can be utilized for filtering.

As an example, we can build a Knowledge Base that will help answer questions around shipments. While our database may contain information about the origin city and state of our shipments, we can add a .csv into the Knowledge Base that also includes geolocation. That way, we can filter on the individual state names later, but still utilize the lat/lon coordinates:

Filtering Knowledge Bases with Metadata

If you are dealing with an extensive amount of data, you can scope your search using metadata filters. When uploading a CSV or Google Sheet, additional columns will be added to your Knowledge Base chunk as metadata and you can scope your search to just those.

The code editor uses MongoDB's query and projection operators. While we support a comprehensive range of these operators, here are some of the most commonly used ones:

$eq - Equal to (for numbers, strings, booleans) $ne - Not equal to (for numbers, strings, booleans) $gt - Greater than (for numbers) $gte - Greater than or equal to (for numbers) $lt - Less than (for numbers) $lte - Less than or equal to (for numbers) $in - In array (for strings or numbers) $nin - Not in array (for strings or numbers)

When your metadata involves a list of strings, such as:

"genres": ["thriller", "mystery"]

the Knowledge Base accepts both genres as valid matches during the search.

Filtering on Metadata in a Workflow

If you need help setting up your Knowledge Base or metadata filters, please don't hesitate to reach out to us for help!

Filtering on Metadata in the API

For more information on configuring and filtering on Metadata, please see our .

For an example on how to use the Knowledge Base Search Step to filter on Metadata in a Workflow, please see our .

Once you're confident that your uploaded documents in the Knowledge Base have reliable metadata, you can utilize the to start filtering.

Knowledge Bases Metadata documentation page
"Knowledge Base Write" Step
Knowledge Bases API "Search" endpoint
Knowledge Bases API "Update"
Knowledge Base Search Step documentation page