Skip to main content
Graph Ingestion enables you to populate the context graph with custom data from your infrastructure, applications, and integrations. Import nodes and relationships in single or batch operations.

Overview

The Ingestion Service provides APIs to load data into the context graph:
  • Ingest Nodes: Add individual or batches of nodes (up to 1000 per batch)
  • Ingest Relationships: Create connections between nodes
  • Duplicate Handling: Control how duplicates are managed (error, skip, update, merge)
  • Transactional Mode: All-or-nothing batch operations
  • Dataset Association: Organize ingested data into logical datasets
Use batch operations for importing large amounts of data efficiently. Batch ingestion is significantly faster than individual imports.

Quick Start

Core Concepts

Nodes

Nodes represent entities in the graph:
  • ID: Unique identifier (string)
  • Labels: Categories/types (e.g., [“Server”, “AWS”])
  • Properties: Key-value attributes

Relationships

Relationships connect nodes:
  • Source ID: Starting node
  • Target ID: Ending node
  • Relationship Type: Connection type (e.g., “CONNECTS_TO”)
  • Properties: Optional relationship metadata

Duplicate Handling Strategies

  • error: Fail if node exists (default)
  • skip: Ignore if exists, continue
  • update: Replace existing node
  • merge: Merge properties with existing

Transactional Mode

  • true: Roll back all if any operation fails
  • false: Process individually, some may succeed

Basic Usage

Ingest Single Node

Ingest Node with Dataset

Ingest Nodes in Batch

Ingest Single Relationship

Ingest Relationships in Batch

Practical Examples

1. Import AWS Infrastructure

Import AWS resources into the graph:

2. Import Kubernetes Resources

Import Kubernetes cluster data:

3. Import Service Dependencies

Import application service dependencies:
Example services.yaml:

4. Sync from External System

Continuously sync data from external system:

Error Handling

Best Practices

1. Use Batch Operations

2. Choose Appropriate Duplicate Handling

3. Use Datasets for Organization

4. Handle Large Imports

API Reference

Node Ingestion Methods

MethodDescriptionParametersReturns
ingest_node()Ingest single nodeid, labels, properties, dataset_id, duplicate_handlingDict
ingest_nodes_batch()Ingest multiple nodesnodes, dataset_id, duplicate_handling, transactionalDict with summary

Relationship Ingestion Methods

MethodDescriptionParametersReturns
ingest_relationship()Ingest single relationshipsource_id, target_id, relationship_type, properties, dataset_idDict
ingest_relationships_batch()Ingest multiple relationshipsrelationships, dataset_id, skip_missing_nodes, transactionalDict with summary

Batch Response Structure

Next Steps

Datasets

Manage cognitive datasets

Context Graph

Query and explore the graph

Intelligent Search

AI-powered graph search

Best Practices

SDK best practices guide