Build sophisticated AI agents using LangChain’s framework with seamless access to business data through StackOne’s unified API.

Overview

  • ReAct and OpenAI Functions agents with business tool access
  • Multi-step workflow automation
  • Conversational agents with memory
  • Advanced error handling and resilience
from stackone_ai import StackOneToolSet
from langchain_openai import ChatOpenAI

# Initialize and convert tools
toolset = StackOneToolSet()
tools = toolset.get_tools("hris_*", account_id="your-account-id")
langchain_tools = tools.to_langchain()

# Create model with tools
model = ChatOpenAI(model="gpt-4o-mini")
model_with_tools = model.bind_tools(langchain_tools)

# Use the agent
response = model_with_tools.invoke("List all employees in engineering")

# Handle tool execution
for tool_call in response.tool_calls:
    tool = tools.get_tool(tool_call["name"])
    if tool:
        result = tool.execute(tool_call["args"])
        print(f"Result: {result}")

Complete Examples

GitHub Examples: For detailed implementations including ReAct agents, conversational memory, and streaming responses:→ View LangChain Integration ExamplesFor LangChain patterns and framework guides, see the LangChain documentation.