Langchain Toolkit extension of Agentkit (forked from Coinbase)
npm install @thirdfy/agentkit-langchainLangChain extension of AgentKit. Enables agentic workflows to interact with onchain actions.
- CDP API Key
- OpenAI API Key
- Node.js 18 or higher
``bash`
npm install @coinbase/agentkit-langchain @coinbase/agentkit @langchain @langchain/langgraph @langchain/openai
Set the following environment variables:
`bash`
export OPENAI_API_KEY=
`typescript
import { getLangChainTools } from "@coinbase/agentkit-langchain";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { ChatOpenAI } from "@langchain/openai";
import { AgentKit } from "@coinbase/agentkit";
const agentKit = await AgentKit.from({
cdpApiKeyId: "CDP API KEY NAME",
cdpApiKeySecret: "CDP API KEY SECRET",
});
const tools = await getLangChainTools(agentKit);
const llm = new ChatOpenAI({
model: "gpt-4o-mini",
});
const agent = createReactAgent({
llm,
tools,
});
``
See CONTRIBUTING.md for detailed setup instructions and contribution guidelines.