inis.run
Integrations

LangChain

LangChain Tool integration for Python agents.

Not yet available. inis-langchain is planned but not published. Use the Python SDK, Pydantic AI, or remote MCP today.

LangChain agents need a Tool (or @tool function) that executes code. The inis LangChain package will wrap the Python SDK the same way E2B ships E2BDataAnalysisTool.

Planned install

pip install inis-langchain

Planned usage

import os
from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
from inis_langchain import InisSandboxTool

tool = InisSandboxTool(api_key=os.environ["INIS_API_KEY"])

llm = ChatOpenAI(model="gpt-4o")
agent = create_tool_calling_agent(llm, [tool], prompt)
executor = AgentExecutor(agent=agent, tools=[tool], verbose=True)

executor.invoke({"input": "Plot a histogram of [1,2,2,3,3,3,4] with matplotlib"})

Tool behaviour

InisSandboxTool will maintain a persistent session for the lifetime of the tool instance — the agent can run multiple Python snippets and shell commands without losing state between steps.

ParameterDefaultDescription
api_key$INIS_API_KEYBearer token
base_urlhttps://api.inis.runAPI endpoint
language"python"Default execution language
on_stdoutNoneCallback for streaming stdout to UI

LangGraph

Works with LangGraph the same way as any LangChain tool — add InisSandboxTool to your tool node. For multi-tenant apps, create one tool instance per user session and pass the inis session id explicitly.

TypeScript / LangChain.js

Use the TypeScript SDK directly or the AI SDK helper. A dedicated @inis/langchain JS package is not planned for v1 — the surface is thin enough to inline.

On this page