Skip to main content

ServiceNow document loaders for LangChain — load Incidents, CMDB, KB, Changes, Problems, and Catalog into LangChain Documents.

Project description

langchain-snowloader

ServiceNow document loaders for LangChain, powered by snowloader.

Covers six core ServiceNow tables — Incidents, Knowledge Base, CMDB, Changes, Problems, and Service Catalog — with production-grade features like retry logic, delta sync, CMDB relationship traversal, and HTML cleaning.

Installation

pip install langchain-snowloader

Usage

from snowloader import SnowConnection
from langchain_snowloader import ServiceNowIncidentLoader

conn = SnowConnection(
    instance_url="https://mycompany.service-now.com",
    username="admin",
    password="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())

Available Loaders

Loader ServiceNow Table Description
ServiceNowIncidentLoader incident IT incidents with optional work notes/comments
ServiceNowKBLoader kb_knowledge Knowledge Base articles (HTML auto-cleaned)
ServiceNowCMDBLoader cmdb_ci Configuration Items with relationship graph traversal
ServiceNowChangeLoader change_request Change requests with implementation windows
ServiceNowProblemLoader problem Problems with root cause and known error tracking
ServiceNowCatalogLoader sc_cat_item Service catalog items

CMDB with Relationships

from langchain_snowloader import ServiceNowCMDBLoader

loader = ServiceNowCMDBLoader(
    connection=conn,
    ci_class="cmdb_ci_server",
    include_relationships=True,
)

docs = loader.load()
print(docs[0].page_content)
# Configuration Item: web-prod-01
# Class: cmdb_ci_server
# ...
# Relationships:
#   -> db-prod-01 (Depends on::Used by)
#   <- load-balancer-01 (Depends on::Used by)

Delta Sync

Only fetch records updated since your last sync:

from datetime import datetime, timezone

loader = ServiceNowIncidentLoader(connection=conn)
docs = loader.load()
last_sync = datetime.now(timezone.utc)

# Next run — only get changes
updated = loader.load_since(last_sync)

Lazy Loading

Stream documents one at a time for memory efficiency:

for doc in loader.lazy_load():
    print(f"[{doc.metadata['number']}] {doc.page_content[:100]}")

Authentication

snowloader supports four auth modes:

# Basic Auth (development)
conn = SnowConnection(instance_url="...", username="...", password="...")

# 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
conn = SnowConnection(instance_url="...", token="eyJhbG...")

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_snowloader-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_snowloader-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file langchain_snowloader-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_snowloader-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_snowloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d85c035d718be965dfc98eeb777371c9b694b60d77747c9af05fa8b85f46dbb6
MD5 2b55716478ccf1b774e46874609429be
BLAKE2b-256 7c2c79ae5e83ee826b129c007979508727b12520602e60e2100252b498616f51

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_snowloader-0.1.0.tar.gz:

Publisher: publish.yml on ronidas39/langchain-snowloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_snowloader-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_snowloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18511882ac73a29915263658f0ee879403c52a245e02c11f187bf628c7b5fb3a
MD5 8781c8e55650a75aa0cf1f6feec16673
BLAKE2b-256 b41df50f8ad5ef98e854af42cb045c2de5a71aacd6ea074b067b4b07e1c76040

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_snowloader-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ronidas39/langchain-snowloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page