Integrations
LangChain
REIN ships LangChain tool wrappers out of the box. Wrap any tool with rein.tool() to enforce your on-chain policy before every LLM-driven call.
Install
npm install @rein/sdk langchain
Tool wrapper
import { ReinClient } from '@rein/sdk';
import { DynamicTool } from 'langchain/tools';
const rein = new ReinClient({ vault: process.env.REIN_VAULT! });
const searchTool = rein.langchainTool({
name: 'brave_search',
recipient: 'api.brave.com',
cost_usdc: 0.02,
async func(query) { return braveSearch(query); }
});
// Pass to your LangChain agent
const agent = initializeAgentExecutorWithOptions(tools, llm, { agentType: "openai-functions" });