Skip to main content

No project description provided

Project description

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

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

knit_langgraph-0.0.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

knit_langgraph-0.0.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file knit_langgraph-0.0.1.tar.gz.

File metadata

  • Download URL: knit_langgraph-0.0.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.13 Windows/10

File hashes

Hashes for knit_langgraph-0.0.1.tar.gz
Algorithm Hash digest
SHA256 718a25dad29bcc5f881f17198a1cc87ad80ca8be268fab3b3d58395b7e3722bb
MD5 77ccabe4c9beff01fb2d57d572234504
BLAKE2b-256 8f40d0ab4d92aa9c22a6dfad210b1f76ed7b92ef8a3c4ec075b281824e779974

See more details on using hashes here.

File details

Details for the file knit_langgraph-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: knit_langgraph-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.13 Windows/10

File hashes

Hashes for knit_langgraph-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13d6537380d599503c112aa284d35039c80b5ed6ecfecaf7a5c614786cfbe5e9
MD5 0f69951823b278f50ca3f3026db414c3
BLAKE2b-256 5969a2fc87fa90a3c193176b4defae3bf5c07788d396a401c26c0988fbf005af

See more details on using hashes here.

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