Skip to content

CDP Agent

The BrianCDPAgent is a langchain agent that leverages the Brian APIs and execute operations on the provided Coinbase MPC-wallet.

Usage

Creating a BrianCDPAgent takes few lines of code:

import { createBrianAgent } from "@brian-ai/langchain";
import { ChatOpenAI } from "@langchain/openai";
 
const agent = await createBrianCDPAgent({
  apiKey: "your-brian-api-key",
  coinbaseApiKey: "your-coinbase-api-key-name",
  coinbaseApiKeySecret: "your-coinbase-api-key-secret",
  walletData: JSON.parse(process.env.COINBASE_WALLET_DATA!),
  llm: new ChatOpenAI(),
});

Invoking the agent

Once the agent is created, you can invoke it with a given input:

const response = await agent.invoke({
  input:
    "Deploy an ERC-20 token named BrianToken and symbol BRT with 100000 total supply",
});

CDP Agent Toolkit

The BrianCDPAgent has a set of tools that can be used to interact with the Brian APIs. Please refer to the CDP Toolkit for more information.