Skip to main content

Quickstart - Create a Hedera Agent

See the npm package: https://www.npmjs.com/package/hedera-agent-kit

1. Create your project directory

2. Install the agent kit and init the project

Init and install with npm:
Open package.json and add "type": "module" to enable ES modules.
Note: The Hedera Agent Kit supports both LangChain v1 (recommended) and LangChain classic (v0.3, legacy). The examples below use LangChain v1.

3. Install ONE of these AI provider packages

4. Add Environment Variables

Create a .env file in your directory:
If you don’t already have a Hedera account, create a testnet account at https://portal.hedera.com/dashboard Add the following to the .env file:

5. Create your agent

Once you have your project set up, create an index.js file:
index.js
Using a different AI provider? You can substitute ChatOpenAI with other LangChain chat models like ChatAnthropic, ChatGroq, or ChatOllama. Install the corresponding package (e.g., @langchain/anthropic) and update the import accordingly.

6. Run Your “Hello Hedera Agent Kit” Example

From the root directory, run your example agent:

Examples

Clone the repository and try out different example agents. Both LangChain v1 (recommended) and LangChain classic (v0.3) examples are available. See the full Developer Examples documentation for detailed setup instructions. Available Examples:

Agent Execution Modes

This tool has two execution modes with AI agents:

Resources