# jaycoolh/hedera-agent-kit architecture

> Architecture diagram of the GitHub repository jaycoolh/hedera-agent-kit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaycoolh/hedera-agent-kit
- Repository: https://github.com/jaycoolh/hedera-agent-kit

## Overview

##### Main Components

A. Core Components:
- LangChain Integration Layer
- Hedera Agent Core
- Tools Module
- External Systems (Hedera Network, OpenAI)

B. Tool Categories:
- HTS (Hedera Token Service) Tools
- HCS (Hedera Consensus Service) Tools

**Top Layer: Client Applications**

**Middle Layer: Hedera Agent Kit**

**Bottom Layer: External Services**

##### Specific Component Details

a) Client Layer (Top):
- Rectangle labeled "Client Applications"

b) Agent Layer (Middle):
- Main component labeled "Hedera Agent Kit"
- Sub-components:
- LangChain Integration (src/langchain)
- Agent Core (src/agent)
- Tools Registry (src/tools)

c) Tools Layer (Middle-Right):
- HTS Tools Component:
- Queries Module
- Balance Query
- Transactions Module
- Token Creation
- Token Transfer
- Airdrop
- HCS Tools Component (placeholder for future implementation)

d) External Services Layer (Bottom):
- Hedera Network
- OpenAI API

##### Connection and Flow Representation

- Blue: Core components
- Green: Tool components
- Gray: External services
- Orange: Integration layers

##### Additional Elements

- Component type indicators

Annotations for:
- Environment variables requirements
- Key integration points
- Extensibility points

##### Technical Details to Highlight

- TypeScript usage throughout the system
- LangChain integration points
- Hedera Network interaction points
- Configuration requirements (environment variables)

##### Future Expansion Areas

- NFT support
- DEX integration
- Additional HCS features

Remember to:
- Use consistent naming with the codebase
- Version numbers
- A title and date
- Significant dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Title
    title[Hedera Agent Kit - System Architecture]
    style title fill:#f9f9f9,stroke:#333,stroke-width:2px
    
    %% Main Layers
    subgraph ClientLayer[Client Applications Layer]
        Client[Client Applications]:::client
    end
    
    subgraph AgentLayer[Hedera Agent Kit Layer]
        LangChainInt[LangChain Integration]:::core
        AgentCore[Agent Core]:::core
        ToolsRegistry[Tools Registry]:::core
        
        subgraph ToolsSection[Tools Section]
            subgraph HTSTools[HTS Tools]
                HTSQueries[Queries Module]:::tool
                HTSTransactions[Transactions Module]:::tool
                
                subgraph QueryTools[Query Tools]
                    BalanceQuery[Balance Query]:::tool
                end
                
                subgraph TransactionTools[Transaction Tools]
                    TokenCreation[Token Creation]:::tool
                    TokenTransfer[Token Transfer]:::tool
                    Airdrop[Airdrop]:::tool
                end
            end
            
            subgraph HCSTools[HCS Tools]
                HCSPlaceholder[Future HCS Implementation]:::future
            end
        end
    end
    
    subgraph ExternalLayer[External Services Layer]
        HederaNetwork[Hedera Network]:::external
        OpenAI[OpenAI API]:::external
    end
    
    %% Connections
    Client --> LangChainInt
    LangChainInt --> AgentCore
    AgentCore --> ToolsRegistry
    ToolsRegistry --> HTSTools
    ToolsRegistry --> HCSTools
    
    HTSQueries --> QueryTools
    HTSTransactions --> TransactionTools
    
    HTSTools -.-> HederaNetwork
    HCSTools -.-> HederaNetwork
    LangChainInt -.-> OpenAI
    
    %% Click Events
    click LangChainInt "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/langchain/index.ts"
    click AgentCore "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/agent/index.ts"
    click ToolsRegistry "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/tools/index.ts"
    click HTSTools "https://github.com/jaycoolh/hedera-agent-kit/tree/main/src/tools/hts/"
    click BalanceQuery "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/tools/hts/queries/balance.ts"
    click TokenCreation "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/tools/hts/transactions/create_token.ts"
    click TokenTransfer "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/tools/hts/transactions/transfer.ts"
    click Airdrop "https://github.com/jaycoolh/hedera-agent-kit/blob/main/src/tools/hts/transactions/airdrop.ts"
    click HCSTools "https://github.com/jaycoolh/hedera-agent-kit/tree/main/src/tools/hcs/"
    click HTSQueries "https://github.com/jaycoolh/hedera-agent-kit/tree/main/src/tools/hts/queries/"
    click HTSTransactions "https://github.com/jaycoolh/hedera-agent-kit/tree/main/src/tools/hts/transactions/"
    
    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef tool fill:#4CAF50,stroke:#2E7D32,color:white
    classDef external fill:#9E9E9E,stroke:#616161,color:white
    classDef client fill:#FF9800,stroke:#F57C00,color:white
    classDef future fill:#E0E0E0,stroke:#9E9E9E,color:#616161,stroke-dasharray: 5 5
    
    %% Legend
    subgraph Legend
        CoreComp[Core Component]:::core
        ToolComp[Tool Component]:::tool
        ExtComp[External Service]:::external
        ClientComp[Client Component]:::client
        FutureComp[Future Component]:::future
    end
```
