Overview
Build LLM-powered applications that interact with the Hedera Network using Python. Create conversational agents that can understand user requests in natural language and execute Hedera transactions, or build backend systems that leverage AI for on-chain operations. This is the Python edition of the Hedera Agent Kit, providing a flexible and extensible framework for building AI-powered Hedera agents.Note: See also the JavaScript SDK documentation for the JS/TypeScript version.The Hedera Agent Kit (Python) provides:
- Plugin Architecture: Extensible design for easy customization
- LangChain Integration: Support for LangChain v1 and LangChain Classic
- Comprehensive Hedera Tools: Token creation (HTS), smart contracts (EVM), account operations, topics (HCS), and more
- Autonomous Execution: Direct transaction execution on the Hedera network
Quickstart — Create a Hedera Agent
See the PyPI package at: https://pypi.org/project/hedera-agent-kit/1. Create your project directory
2. Set up virtual environment and install dependencies
Create and activate a virtual environment:3. Install ONE of these AI provider packages
The example below uses OpenAI and is written for LangChain V1 (Python). It does not use the older LangChain “classic” API. If you want to use a different model provider (Anthropic, Groq, Ollama, etc.), check the LangChain Python integrations docs here.For the LangChain classic example code, refer to the example in the Hedera Agent Kit (Python) repo.
4. Add Environment Variables
Create a.env file in your directory:
.env file:
5. Create your agent
Create amain.py file:
main.py
Using a different AI provider? You can substituteChatOpenAIwith other LangChain chat models likeChatAnthropic,ChatGroq, orChatOllama. Install the corresponding package 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:- Option A - Plugin Tool Calling Agent (LangChain v1): Uses LangGraph with plugin-based tool management
- Option B - Tool Calling Agent (LangChain Classic): Basic tool-calling with LangChain Classic
- Option C - Plugin Tool Calling Agent (LangChain Classic): Plugin-based agent with LangChain Classic
- Option D - Structured Chat Agent (LangChain Classic): Structured chat with LangChain Classic
About the Agent Kit
Agent Execution Modes
The Python SDK currently supports one execution mode:| Mode | Status | Description |
|---|---|---|
AgentMode.AUTONOMOUS | ✅ Supported | Transactions are executed directly using the operator account |
AgentMode.RETURN_BYTES | 🔜 Coming Soon | Transaction bytes returned for user signing (human-in-the-loop) |
Agent Kit Plugins
The Hedera Agent Kit provides tools organized into plugins by the type of Hedera service they interact with. Available Plugins| Plugin | Description |
|---|---|
| core_account_plugin | Tools for Hedera Account Service operations (transfer HBAR, create/update/delete accounts, manage allowances) |
| core_account_query_plugin | Tools for querying account data (balances, account info, token balances) |
| core_consensus_plugin | Tools for Hedera Consensus Service (HCS) operations (create/update/delete topics, submit messages) |
| core_consensus_query_plugin | Tools for querying HCS data (topic messages, topic info) |
| core_token_plugin | Tools for Hedera Token Service (HTS) operations (create/mint/transfer tokens, manage allowances) |
| core_token_query_plugin | Tools for querying HTS data (token info, pending airdrops) |
| core_evm_plugin | Tools for interacting with EVM smart contracts (ERC-20, ERC-721 tokens) |
| core_misc_query_plugin | Tools for miscellaneous queries (exchange rates) |
| core_transaction_query_plugin | Tools for transaction-related queries (get transaction records) |
Requests and Contributions
To request additional functionality, please open an issue. To contribute to the Hedera Agent Kit (Python), see the repository’s contributing guidelines.Resources
- GitHub: https://github.com/hashgraph/hedera-agent-kit-py
- PyPI: hedera-agent-kit
- Issues: https://github.com/hashgraph/hedera-agent-kit-py/issues
- Developer Examples: DEVEXAMPLES.md
- Plugins Documentation: HEDERAPLUGINS.md