Comprehensive ServiceNow data loader for AI/LLM pipelines — Incidents, CMDB, KB, Changes, Catalog & more. Works with LangChain & LlamaIndex.
Project description
snowloader
Created by Roni Das
Comprehensive ServiceNow data loader for AI/LLM pipelines — Incidents, CMDB, KB, Changes, Problems, Catalog & more.
Works with LangChain & LlamaIndex out of the box. Python 3.10–3.13.
Documentation | PyPI | GitHub
Why snowloader?
Building RAG or agentic AI on top of ServiceNow data? You need a reliable way to pull structured ITSM records into your vector store. Existing tools either cover a single table, ignore relationships, or lock you into one framework.
snowloader gives you:
- 6 loaders covering the core ServiceNow tables (Incidents, Knowledge Base, CMDB, Changes, Problems, Service Catalog)
- CMDB relationship traversal — concurrent graph walking with dependency mapping
- Delta sync — only fetch records updated since your last sync
- 4 auth modes — Basic, OAuth Password, OAuth Client Credentials, Bearer Token
- Production-grade — retry with backoff, rate limiting, thread safety, proxy support
- Framework-agnostic core with thin adapters for LangChain and LlamaIndex
- Memory-efficient streaming — generator-based pagination, never holds the full table in memory
- Built-in HTML cleaning — strips KB article HTML without extra dependencies
- Fully typed — PEP 561 compliant, mypy --strict clean
Installation
# pip
pip install snowloader # Core only
pip install snowloader[langchain] # + LangChain adapter
pip install snowloader[llamaindex] # + LlamaIndex adapter
pip install snowloader[all] # Everything
# uv
uv add snowloader
uv add snowloader[all]
Requirements: Python 3.10+ and a ServiceNow instance with REST API access.
Quick Start
from snowloader import SnowConnection, IncidentLoader
conn = SnowConnection(
instance_url="https://mycompany.service-now.com",
username="admin",
password="password",
)
loader = IncidentLoader(connection=conn, query="active=true^priority<=2")
for doc in loader.lazy_load():
print(doc.page_content[:200])
All 6 Loaders
Every loader shares the same interface: load() returns a list, lazy_load() yields one document at a time, load_since(datetime) fetches only updated records.
from snowloader import (
IncidentLoader, # IT incidents
KnowledgeBaseLoader, # KB articles (HTML auto-cleaned)
CMDBLoader, # Configuration items + relationships
ChangeLoader, # Change requests
ProblemLoader, # Problem records
CatalogLoader, # Service catalog items
)
LangChain Adapter
from snowloader import SnowConnection
from snowloader.adapters.langchain import ServiceNowIncidentLoader
conn = SnowConnection(instance_url="...", username="...", password="...")
loader = ServiceNowIncidentLoader(connection=conn, query="active=true")
docs = loader.load() # list[langchain_core.documents.Document]
# Use with any vector store
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
vectorstore = FAISS.from_documents(docs, OpenAIEmbeddings())
LlamaIndex Adapter
from snowloader.adapters.llamaindex import ServiceNowIncidentReader
reader = ServiceNowIncidentReader(connection=conn, query="active=true")
docs = reader.load_data() # list[llama_index.core.schema.Document]
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex.from_documents(docs)
Delta Sync
from datetime import datetime, timezone
loader = IncidentLoader(connection=conn)
docs = loader.load() # First run: everything
last_sync = datetime.now(timezone.utc)
updated = loader.load_since(last_sync) # Next runs: only changes
CMDB Relationship Traversal
loader = CMDBLoader(
connection=conn,
ci_class="cmdb_ci_server",
include_relationships=True,
)
for doc in loader.lazy_load():
# -> db-prod-01 (Depends on::Used by)
# <- load-balancer-01 (Depends on::Used by)
print(doc.page_content)
Authentication
# Basic Auth (development)
conn = SnowConnection(instance_url="...", username="admin", password="pass")
# OAuth Client Credentials (recommended for production)
conn = SnowConnection(instance_url="...", client_id="...", client_secret="...")
# OAuth Password Grant
conn = SnowConnection(instance_url="...", client_id="...", client_secret="...",
username="...", password="...")
# Bearer Token (pre-obtained)
conn = SnowConnection(instance_url="...", token="eyJhbG...")
Configuration
| Parameter | Default | Description |
|---|---|---|
page_size |
100 |
Records per API call (1–10,000) |
timeout |
60 |
HTTP timeout in seconds |
max_retries |
3 |
Retry attempts for 429/502/503/504 |
retry_backoff |
1.0 |
Base delay between retries (doubles each attempt) |
request_delay |
0.0 |
Min seconds between requests (rate limiting) |
display_value |
"true" |
sysparm_display_value setting |
proxy |
None |
HTTP/HTTPS proxy URL |
verify |
True |
SSL verification (path for custom CA bundle) |
See the full documentation for all parameters.
Roadmap
| Version | Feature | Status |
|---|---|---|
| v0.2 | Async support (aiohttp + async for) — 10-50x faster |
Coming soon |
| v0.2 | Attachment loader (sys_attachment downloads) |
Coming soon |
| v0.3 | Direct vector store streaming (Pinecone, Weaviate, Chroma) | Planned |
| v0.3 | Checkpoint and resume for large loads | Planned |
| v1.0 | Custom field mapping for customized instances | Planned |
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Write tests first (we use pytest + responses for HTTP mocking)
- Ensure the quality gate passes:
ruff check src/ tests/ && ruff format --check src/ tests/ && mypy src/snowloader/ && pytest tests/ -x
- Open a pull request
Author
Created and maintained by Roni Das.
License
MIT — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snowloader-0.1.1.tar.gz.
File metadata
- Download URL: snowloader-0.1.1.tar.gz
- Upload date:
- Size: 63.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
848977f67a330e78400abe7b2ff1d0ea07bf155fa809664a57080acc1125338a
|
|
| MD5 |
15c8cb45c5053a45c162c60aadd79444
|
|
| BLAKE2b-256 |
8dbda0a72a6f7ab4d096f7196d61f7361879acdfe25868c946a25c597860ee52
|
Provenance
The following attestation bundles were made for snowloader-0.1.1.tar.gz:
Publisher:
publish.yml on ronidas39/snowloader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snowloader-0.1.1.tar.gz -
Subject digest:
848977f67a330e78400abe7b2ff1d0ea07bf155fa809664a57080acc1125338a - Sigstore transparency entry: 1183525786
- Sigstore integration time:
-
Permalink:
ronidas39/snowloader@f5ea1b23c456277ae09a3b246e8eb75bdab73af1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ronidas39
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f5ea1b23c456277ae09a3b246e8eb75bdab73af1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file snowloader-0.1.1-py3-none-any.whl.
File metadata
- Download URL: snowloader-0.1.1-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acc93ffe4d0832bc8bfd23cc57009504a788fb9ba4d271cbec9f161ed559248d
|
|
| MD5 |
7e49cf9600ae26fca6a01aa4d75df740
|
|
| BLAKE2b-256 |
b439815ce029c7903b040c50e87d3030989e1fca14c056a6e70aa3f6b99c5aeb
|
Provenance
The following attestation bundles were made for snowloader-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ronidas39/snowloader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snowloader-0.1.1-py3-none-any.whl -
Subject digest:
acc93ffe4d0832bc8bfd23cc57009504a788fb9ba4d271cbec9f161ed559248d - Sigstore transparency entry: 1183525809
- Sigstore integration time:
-
Permalink:
ronidas39/snowloader@f5ea1b23c456277ae09a3b246e8eb75bdab73af1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ronidas39
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f5ea1b23c456277ae09a3b246e8eb75bdab73af1 -
Trigger Event:
push
-
Statement type: