Skip to content
Release: Australia · Updated: 2026-04-30 · Official documentation · View source

AI Service Graph Connector for Hugging Face

The AI Service Graph Connector for Hugging Face enables you to discover and import AI assets from your Hugging Face environment into ServiceNow AI Control Tower.

The connector integrates with your Hugging Face account to catalog AI systems, agents, models, and prompts from Hugging Face Spaces. Usage data is automatically collected and populated into the AI Control Tower value dashboard, providing comprehensive visibility and governance of your AI operations.

Download apps from the Store

Visit the ServiceNow store website to download the AI Service Graph Connector for Hugging Face application.

Supported ServiceNow versions

ReleaseStatus
AustraliaSupported
ZurichSupported

User Roles

You must have one of the following roles assigned.

Required Roles
sn_ai_disc.discovery_admin
sn_cmdb_int_util.sgc_admin

ServiceNow Prerequisites

Complete the following setup steps once when configuring the connector for the first time.

Note: Updating data source access and clear cache is a prerequisite that needs to be completed only once, when setting up a new instance for the first time.

Update Data Source Access

The connector requires write permissions to the Data Source table to create data sources.

To enable data source creation:

  1. Select Global from the application picker
  2. Navigate to Application Access
  3. Select the Can create, Can update, and Can delete check boxes.
  4. Select Update
  5. Switch to the connector application scope

Clear cache

Clear the cached data for the Data Source and Tables.

To clear the cache:

  1. Navigate to System Definition > Background Scripts
  2. Paste the following script into the Run Script text box:

    GlideTableManager.invalidateTable('sys_data_source');
    GlideCacheManager.flushTable('sys_data_source');
    GlideTableManager.invalidateTable('sys_db_object');
    GlideCacheManager.flushTable('sys_db_object');
    
  3. Select Run Script.

    Note: The script may take several minutes to complete.

  4. After completion, switch to the connector application scope

Hugging Face Prerequisites

Complete the following steps in your Hugging Face environment before creating a connection.

  • Hugging Face account (If you don't have a Hugging Face account, create one at https://huggingface.co)
  • Generate API Tokens

Discovery Scope

The Hugging Face connector discovers AI components from Hugging Face Spaces by analyzing Python files using pattern matching. The following AI asset types are identified during discovery:

Asset TypeDescription
AI Agents/SystemsApplications and agent implementations identified in Space code.
AI ModelsLanguage models, embeddings, and other ML models referenced in code.
AI ToolsFunction definitions and tool implementations.
AI PromptsPrompt templates and configuration strings.

The discovery process follows these stages:

  • Space Discovery – Identifies Hugging Face Spaces based on organization membership or public visibility.
  • Code Analysis – Downloads and analyzes Python files from each Space.
  • Pattern Matching – Identifies these components:
    • Agent implementations (for example, LangChain agents, custom frameworks)
    • Model references (for example, model_id parameters, API calls)
    • Tool definitions (for example, function decorators, tool classes)
    • Prompt templates (for example, PromptTemplate, string templates)
  • Relationship Mapping – Links AI systems to their sub-components such as models, tools, and prompts.
  • Incremental Updates – Processes only Spaces modified since the last successful import.

Note: The connector performs incremental discovery, only processing spaces that have been modified since it's last successful import.

Data Mapping

The connector maps Hugging Face AI assets to ServiceNow staging tables and target CMDB tables for comprehensive asset management.

Data SourceStaging TableTarget TableDescription
SG-HuggingFace-Discoverysn_ai_hf_disc_ai_discovery_stagingParent data sourceDiscovers HuggingFace Spaces and feeds other staging tables
SG-HuggingFace-Systemsn_ai_hf_disc_ai_system_stagingalm_ai_system_digital_assetImports AI systems and applications
SG-HuggingFace-Modelsn_ai_hf_disc_ai_model_stagingalm_ai_model_digital_assetImports AI models and embeddings
SG-HuggingFace-Promptsn_ai_hf_disc_ai_prompt_stagingalm_ai_prompt_digital_assetImports prompt templates
SG-HuggingFace-Toolsn_ai_hf_disc_ai_tool_stagingsn_ent_ai_toolImports tool and function definitions
SG-HuggingFace-SubComponents M2Msn_ai_hf_disc_ai_m2m_stagingsn_ent_ai_system_subcomponent_m2mImports relationships between AI systems and their components

Target Tables

The Hugging Face connector populates the following target tables in ServiceNow.

Digital Asset Tables

  • alm_ai_system_digital_asset – Stores AI System digital assets discovered from Hugging Face Spaces.
  • alm_ai_model_digital_asset – Stores AI Model digital assets including language models and embeddings.
  • alm_ai_prompt_digital_asset – Stores AI Prompt digital assets including prompt templates and configurations.

Entity Tables

  • sn_ent_ai_tool: Stores AI Tools including function definitions and tool implementations
  • sn_ent_ai_system_subcomponent_m2m: Stores many-to-many relationships between AI systems and their subcomponents (models, tools, prompts)

Note: The Hugging Face connector currently focuses on discovery of AI assets. Usage and execution tracking capabilities may be added in future versions.

Data Flow Architecture

The Hugging Face connector follows this data flow:

StageDescription
Data SourceThe connector calls Hugging Face APIs to discover Spaces based on organization or public visibility settings.
Staging TablesRaw data is loaded into import set staging tables for processing.
Transform MapsData is transformed, validated, and mapped to target table schema.
Target TablesCleaned and structured data is inserted into the final destination tables in the ServiceNow CMDB.