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, continueupdate: Replace existing nodemerge: Merge properties with existing
Transactional Mode
true: Roll back all if any operation failsfalse: Process individually, some may succeed
Basic Usage
Ingest Single Node
Example Response
Example Response
Ingest Node with Dataset
Ingest Nodes in Batch
Example Response
Example Response
Ingest Single Relationship
Example Response
Example Response
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: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
| Method | Description | Parameters | Returns |
|---|---|---|---|
ingest_node() | Ingest single node | id, labels, properties, dataset_id, duplicate_handling | Dict |
ingest_nodes_batch() | Ingest multiple nodes | nodes, dataset_id, duplicate_handling, transactional | Dict with summary |
Relationship Ingestion Methods
| Method | Description | Parameters | Returns |
|---|---|---|---|
ingest_relationship() | Ingest single relationship | source_id, target_id, relationship_type, properties, dataset_id | Dict |
ingest_relationships_batch() | Ingest multiple relationships | relationships, dataset_id, skip_missing_nodes, transactional | Dict 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