AI Service Graph Connector for Hugging Face
Summarize
Summary of AI Service Graph Connector for Hugging Face
The AI Service Graph Connector for Hugging Face enables ServiceNow customers to discover, import, and manage AI assets from their Hugging Face environment directly into the ServiceNow AI Control Tower. By integrating with your Hugging Face account, the connector catalogs AI systems, models, prompts, and tools from Hugging Face Spaces, and automatically collects usage data to populate the AI Control Tower value dashboard. This integration enhances visibility and governance over your AI operations.
Show less
Key Features
- AI Asset Discovery: Automatically discovers AI agents, models, tools, and prompt templates by analyzing Python code within Hugging Face Spaces using pattern matching techniques.
- Incremental Updates: Processes only Spaces modified since the last import, optimizing discovery efficiency.
- Comprehensive Data Mapping: Maps discovered AI assets to ServiceNow staging tables and final Configuration Management Database (CMDB) tables, supporting detailed asset management.
- Data Flow Architecture: Utilizes Hugging Face APIs to discover Spaces, imports raw data into staging tables, applies transformation and validation, and populates structured data into ServiceNow AI digital asset and entity tables.
- Role and Version Support: Supports ServiceNow Australia and Zurich releases and requires specific admin roles for setup and operation.
Prerequisites and Setup
- ServiceNow Setup: Requires updating Data Source table permissions (create, update, delete) and clearing related caches via system background scripts for initial configuration.
- Hugging Face Setup: Requires a Hugging Face account with generated API tokens to enable connector access.
Discovered AI Asset Types
- AI Agents/Systems: Applications and agent implementations found in Space code.
- AI Models: Language models, embeddings, and other machine learning models referenced in code.
- AI Tools: Function definitions and tool implementations.
- AI Prompts: Prompt templates and configuration strings.
Data Management and Tables
The connector imports AI assets into the following key ServiceNow CMDB tables, enabling centralized AI asset management:
- AI Systems: almaisystemdigitalasset
- AI Models: almaimodeldigitalasset
- AI Prompts: almaipromptdigitalasset
- AI Tools: snentaitool
- Relationships: snentaisystemsubcomponentm2m stores relationships between AI systems and their subcomponents
Practical Benefits for ServiceNow Customers
By deploying this connector, customers gain automated, continuous discovery of Hugging Face AI assets, ensuring up-to-date inventory within ServiceNow’s AI Control Tower. This supports enhanced governance, transparency, and operational insight into AI components spanning models, agents, tools, and prompts. The connector’s incremental update mechanism reduces overhead, while seamless integration with ServiceNow’s CMDB enables effective AI asset lifecycle management.
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
| Release | Status |
|---|---|
| Australia | Supported |
| Zurich | Supported |
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.
The connector requires write permissions to the Data Source table to create data sources.
- Select Global from the application picker.
- Navigate to Application Access.
- Select the Can create, Can update, and Can delete check boxes.
- Select Update.
- Switch to the connector application scope.
Clear the cached data for the Data Source and Tables.
- Navigate to .
- Enter the following script in 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'); - Select Run Script.Note:The script might take several minutes to complete. After completion, switch to the connector application scope.
- 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 Type | Description |
| AI Agents/Systems | Applications and agent implementations identified in Space code. |
| AI Models | Language models, embeddings, and other ML models referenced in code. |
| AI Tools | Function definitions and tool implementations. |
| AI Prompts | Prompt 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.
Data Mapping
The connector maps Hugging Face AI assets to ServiceNow staging tables and target CMDB tables for comprehensive asset management.
| Data Source | Staging Table | Target Table | Description |
|---|---|---|---|
| SG-HuggingFace-Discovery | sn_ai_hf_disc_ai_discovery_staging | Parent data source | Discovers HuggingFace Spaces and feeds other staging tables |
| SG-HuggingFace-System | sn_ai_hf_disc_ai_system_staging | alm_ai_system_digital_asset | Imports AI systems and applications |
| SG-HuggingFace-Model | sn_ai_hf_disc_ai_model_staging | alm_ai_model_digital_asset | Imports AI models and embeddings |
| SG-HuggingFace-Prompt | sn_ai_hf_disc_ai_prompt_staging | alm_ai_prompt_digital_asset | Imports prompt templates |
| SG-HuggingFace-Tool | sn_ai_hf_disc_ai_tool_staging | sn_ent_ai_tool | Imports tool and function definitions |
| SG-HuggingFace-SubComponents M2M | sn_ai_hf_disc_ai_m2m_staging | sn_ent_ai_system_subcomponent_m2m | Imports 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).
Data Flow Architecture
The Hugging Face connector follows this data flow:| Stage | Description |
| Data Source | The connector calls Hugging Face APIs to discover Spaces based on organization or public visibility settings. |
| Staging Tables | Raw data is loaded into import set staging tables for processing. |
| Transform Maps | Data is transformed, validated, and mapped to target table schema. |
| Target Tables | Cleaned and structured data is inserted into the final destination tables in the ServiceNow CMDB. |