# goat-sdk/goat architecture

> Architecture diagram of the GitHub repository goat-sdk/goat, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goat-sdk/goat
- Repository: https://github.com/goat-sdk/goat

## Overview

##### Project Type and Purpose
- GOAT is a toolkit library that provides onchain tools for DeFi, minting, betting, analytics, and more.
- It is designed to integrate with different blockchain networks (EVM, Solana, Aptos, Chromia, Fuel, Sui, Starknet, Zilliqa, etc.) and supports wallet providers (smart wallets, keypair wallets, LIT, MPC, etc.).
- Its functionality extends deeply into agent frameworks through adapters for frameworks like Langchain, Eliza, ElevenLabs, and others.
- The README explicitly emphasizes “+200 tools” and a wide range of plugins covering significant onchain features.

##### File Structure
- At the top level you have several directories: typescript, python, docs, and configuration files for CI/CD and project tooling.
- Under each language folder (typescript and python) there are subdirectories clearly separated into:
- Core packages (often with classes, types, utilities)
- Plugins (divided into many folders – each for a specific protocol or feature like 1inch, coingecko, debridge, dexscreener, farcaster, etc.)
- Wallets (different integrations for EVM, Solana, crossmint, etc.)
- Adapters (agent framework adapters such as for Langchain)
- Examples and tests that illustrate practical usage.
- The repository also includes configuration for package managers (pnpm, poetry) showing how the project is built/integrated across different languages.

##### README for Additional Insights
- The README highlights the features:
- Extensive onchain tool support (+200 tools)
- Support for diverse chains (EVM, Solana, Aptos, etc.)
- Multiple wallet integrations (keypair, smart wallets like Crossmint, LIT, etc.)
- Integration with agent frameworks (Langchain, ElevenLabs, Eliza, and others)
- It also provides links to detailed documentation sections for Plugins, Wallets, and Adapters.

##### Final Visualization Summary
- Branch out to two primary language stacks: TypeScript and Python, showing that both share a similar structure (Core, Plugins, Wallets, Adapters).
- Plugins Cluster: Label sub-components (list representative plugins such as 1inch, opensea, coingecko, etc.).
- Adapters/Agent Integration: Represent the modules connecting to external AI frameworks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    AA["AI Agents"]:::external

    %% GOAT Core Library as central hub
    GCL["GOAT Core Library"]:::core

    %% External Blockchain Networks
    EB["External Blockchain Networks"]:::external

    %% Connections from AI Agents to Adapters
    AA -->|"sendsRequests"| TS_AD
    AA -->|"sendsRequests"| PY_AD

    %% Central connection from Adapters to GOAT Core Library will be depicted in each language cluster

    %% TypeScript Implementation Subgraph
    subgraph "TypeScript Implementation"
        TS_CORE["TS Core Library"]:::core
        TS_PLUG["Plugins: +200 Onchain Tools"]:::plugin
        TS_WALL["Wallet Integrations"]:::wallet
        TS_AD["Agent Framework Adapters"]:::adapter
        TS_EX["Examples & Tests"]:::example
        
        %% Internal TS Connections
        TS_AD -->|"calls"| TS_CORE
        TS_CORE -->|"registers"| TS_PLUG
        TS_CORE -->|"utilizes"| TS_WALL
        TS_PLUG -->|"exposes"| TS_CORE
        TS_WALL -->|"connectsTo"| EB
    end

    %% Python Implementation Subgraph
    subgraph "Python Implementation"
        PY_CORE["Python Core Library"]:::core
        PY_PLUG["Plugins: +200 Onchain Tools"]:::plugin
        PY_WALL["Wallet Integrations"]:::wallet
        PY_AD["Agent Framework Adapters"]:::adapter
        PY_EX["Examples & Tests"]:::example

        %% Internal PY Connections
        PY_AD -->|"calls"| PY_CORE
        PY_CORE -->|"registers"| PY_PLUG
        PY_CORE -->|"utilizes"| PY_WALL
        PY_PLUG -->|"exposes"| PY_CORE
        PY_WALL -->|"connectsTo"| EB
    end

    %% Connecting GOAT Core Library with Language Implementations
    GCL --> TS_CORE
    GCL --> PY_CORE

    %% Click Events for TypeScript Components
    click TS_CORE "https://github.com/goat-sdk/goat/tree/main/typescript/packages/core"
    click TS_PLUG "https://github.com/goat-sdk/goat/tree/main/typescript/packages/plugins"
    click TS_WALL "https://github.com/goat-sdk/goat/tree/main/typescript/packages/wallets"
    click TS_AD "https://github.com/goat-sdk/goat/tree/main/typescript/packages/adapters"
    click TS_EX "https://github.com/goat-sdk/goat/tree/main/typescript/examples"

    %% Click Events for Python Components
    click PY_CORE "https://github.com/goat-sdk/goat/tree/main/python/src/goat-sdk/goat/classes"
    click PY_PLUG "https://github.com/goat-sdk/goat/tree/main/python/src/plugins"
    click PY_WALL "https://github.com/goat-sdk/goat/tree/main/python/src/wallets"
    click PY_AD "https://github.com/goat-sdk/goat/tree/main/python/src/adapters/langchain"
    click PY_EX "https://github.com/goat-sdk/goat/tree/main/python/examples"

    %% Styles and Classes
    classDef core fill:#f9f,stroke:#333,stroke-width:2px;
    classDef plugin fill:#ccf,stroke:#333,stroke-width:2px;
    classDef wallet fill:#cfc,stroke:#333,stroke-width:2px;
    classDef adapter fill:#fcf,stroke:#333,stroke-width:2px;
    classDef example fill:#ffc,stroke:#333,stroke-width:2px;
    classDef external fill:#eef,stroke:#333,stroke-width:2px;
```
