All Integrations
Integration

LangChain

The LangChain integration provides a SkillRouterToolkit that exposes all discovered skills as LangChain tools. Compatible with any LangChain agent, chain, or workflow.

1

Installation

  1. 1Install the SkillRouter Python SDK: pip install skillrouter
  2. 2Install LangChain if not already installed: pip install langchain
  3. 3Import the SkillRouterToolkit in your agent code
  4. 4Initialize with your API key and pass tools to your agent
2

Configuration

terminal
# Install dependencies
pip install skillrouter langchain langchain-openai

# Set your API key
export SKILLROUTER_API_KEY="sk_live_..."
export OPENAI_API_KEY="sk-..."
3

Usage Example

agent.py
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from skillrouter.integrations.langchain import SkillRouterToolkit

# Initialize SkillRouter toolkit
toolkit = SkillRouterToolkit(api_key="sk_live_...")

# Get all available tools
tools = toolkit.get_tools()

# Create a LangChain agent with SkillRouter tools
llm = ChatOpenAI(model="gpt-4o")
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

# Run the agent
result = executor.invoke({
    "input": "Send a Slack message to #general saying hello"
})
print(result["output"])
Documentation | SkillRouter