Skip to main content

Knit LangGraph SDK

Welcome to the Knit's LangGraph SDK, a powerful toolkit designed to integrate AI-powered agents built using LangGraph with a wide range of SaaS applications.

As an embedded integration platform, Knit provides a white-labeled solution empowering SaaS companies to effortlessly scale integrations within their own products, enriching customer experiences with dynamic, out-of-the-box functionality.

The Knit LangGraph SDK is designed to facilitate seamless integration between LLM agents and SaaS applications by leveraging Knit's platform and its wide range of connectors.

Installation

Kickstart your journey with the Knit LangGraph SDK by installing it via pip:

pip install knit-langgraph

Quick Start

First, get your Knit API Key by signing up at https://dashboard.getknit.dev/signup

Now, we're ready to start using the SDK. Here's a simple guide to help you start integrating with the Knit LangGraph SDK:

import logging
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
from knit_langgraph import KnitLangGraph, ToolFilter

# Initialize the Knit SDK with your API key
knit = KnitLangGraph(api_key="YOUR_KNIT_API_KEY")

# Initialize your LLM
model = ChatOpenAI(
    api_key="YOUR_OPENAI_API_KEY",
    model="gpt-4o",  # or another model of your choice
    temperature=0,
)

# Discover available tools from a specific app.
# You can then select which tools to pass to the LLM model from these
tools = knit.find_tools(app_id="charliehr")

# Get specific tools you want to pass to the LLM model.
tool_defs = knit.get_tools(tools=[ToolFilter(app_id="charliehr", tool_ids=[tool.tool_id for tool in tools])])

# Create a ReAct agent with the tools
graph = create_react_agent(model, tools=tool_defs)

# Prepare inputs for the agent
inputs = {
    "messages": [
        (
            "user",
            "I want to get the list of offices of the company.",
        )
    ]
}

# Configuration with integration ID
config = {"knit_integration_id": "YOUR_USER's_INTEGRATION_ID"}

# Stream the agent's responses
for response in graph.stream(inputs, {"configurable": config}, stream_mode="values"):
    message = response["messages"][-1]
    if isinstance(message, tuple):
        print(message)
    else:
        message.pretty_print()

That's it! It's that easy to get started and add hundreds of SaaS applications to your AI Agent.

Detailed Information

That was a quick introduction of how to get started with Knit's LangGraph SDK.

To know more about how to use its advanced features and for more in depth information, please refer to the detailed guide here: Knit LangGraph SDK Guide

Support

For support, reach out to kunal@getknit.dev

Metadata

Release files for knit-langgraph 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for knit-langgraph 0.1.3
File Size Uploaded
knit_langgraph-0.1.3.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for knit-langgraph 0.1.3
File Interpreter ABI Platform
knit_langgraph-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / knit_langgraph-0.1.3.tar.gz

Download URL knit_langgraph-0.1.3.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
885a74197c0fdaedbf63d32d0a6ace3fb87ccae24402a3b2b7639e31d8219b52
BLAKE2b-256 checksum
How to use checksums
7e2765d04ff18993c93d61b56fa39a89c7a8d60f8bb2881bdfd8951de574e13f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.9.13 Windows/10

Release files / knit_langgraph-0.1.3-py3-none-any.whl

Download URL knit_langgraph-0.1.3-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20c69ba37bc11291d45c30bb032bada6426103e342231fd4b74a3beecc5908da
BLAKE2b-256 checksum
How to use checksums
eda3199f6a8d9955d1eac5f2b18712052d4107388fee6f6c3722a48748020a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.9.13 Windows/10

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page