Crypto.com AI Agent SDK
  • Getting Started
    • Introduction
    • Quick Start Guide: Simulation Entry Point
  • Core Concepts Overview
    • Plugins
    • Tools
    • Blockchain Functions
      • Wallet Management
      • Token Interaction
      • Transaction Queries
      • Block Information
      • Contract Operations
      • CronosID Operations
      • Defi Operations
      • Crypto.com Exchange
    • Built-in Telegram Feature
    • Advanced Usage: Custom Instructions
    • Dynamic AI Model Manager
  • Crypto.com On-Chain Developer Platform
    • Developer Platform API Methods
  • On-Chain Functions and Examples
    • AI Agent Chatbot
    • "Magic Link" Signer
  • Resources for Developers
Powered by GitBook
On this page
  • Introduction
  • Overview
  • Key Features
  • Prerequisites
  • Get Started
  • What’s Next?

Was this helpful?

  1. Getting Started

Quick Start Guide: Simulation Entry Point

PreviousIntroductionNextCore Concepts Overview

Last updated 1 day ago

Was this helpful?

Introduction

This file serves as a simulation and testing entry point for the Crypto.com Agent Client. It demonstrates how to initialize the agent, configure plugins, and interact with the LangGraph-based conversational AI.

Overview

The simulation provides a controlled environment to experiment with the Crypto.com AI Agent’s capabilities before integrating it into real-world applications, configuring it with a large language model (LLM) and blockchain settings to enable seamless interactions. It integrates various plugins, including LangFuse for observability, SQLite for persistent storage, and custom tools for enhanced functionality.

Additionally, the script features an interactive CLI-based testing loop, allowing developers to validate AI-driven blockchain interactions in real time which makes it a powerful tool for experimentation and development.

Key Features

  • Agent initialization with LLM and blockchain configurations.

  • Plugin integration (LangFuse, SQLite for storage, and custom tools).

  • Interactive CLI loop for testing agent responses.

Prerequisites

Before starting, ensure you have the following components ready.

  1. Python installed (version ≥ 3.12)

  2. API Key for or

  3. API Keys of AI provider, refer to the to see which providers are supported by the AI Agent SDK. Only the API keys for the selected AI provider are required when initializing the agent.

  4. For Windows Users:

    1. Windows 10 SDK or Windows 11 SDK depends on system version

    2. MSVC v143 - C++ x64/86 build tools

Get Started

pip install cryptocom-agent-client

Step 2 - Before running the script, ensure that all configurations are properly set up: Replace placeholders such as your-api-key with valid credentials to enable proper functionality. Then run the python file to initialize the bot.

Simulation Example Code

from crypto_com_agent_client import Agent, SQLitePlugin, tool

# (OPTIONAL) Use SQLiteStorage for persistence
custom_storage = SQLitePlugin(db_path="agent_state.db")

# (OPTIONAL) LangFuse plugin configuration
user_langfuse_handler = {
    "public-key": "user-public-key",
    "secret-key": "user-secret-key",
    "host": "https://langfuse.example.com",
}

# (OPTIONAL) Custom personality and character
personality = {
    "tone": "friendly",
    "language": "German",
    "verbosity": "high",
}
# (OPTIONAL)
instructions = (
    "You are a humorous assistant that always includes a joke in your responses."
)

# (OPTIONAL)
@tool
def get_weather(location: str) -> str:
    """
    Provide the current weather for a given location.

    Args:
        location (str): The name of the location for which to retrieve weather information.

    Returns:
        str: A message describing the current weather in the given location.
    """
    # Simulated weather response for demonstration purposes
    weather_data = {
        "New York": "sunny, 25°C",
        "Berlin": "cloudy, 18°C",
        "Tokyo": "rainy, 22°C",
    }

    weather = weather_data.get(location, "unavailable at the moment")
    return f"The current weather in {location} is {weather}."

# Initialize the agent with LLM and blockchain configurations
agent = Agent.init(
    llm_config={
        "provider": "OpenAI",
        "model": "gpt-4o-mini",
        "provider-api-key": "your-api-key",
        "temperature": 0.7, # This parameter controls the randomness and creativity of the generated text.
    },
    blockchain_config={
        "chainId": "chain-id",
        "explorer-api-key": "your-api-key",
        "private-key": "your-private-key",
        "sso-wallet-url": "your-sso-wallet-url",
    },
    plugins={
        "personality": {
            "tone": "friendly",
            "language": "English",
            "verbosity": "high",
        },
        "instructions": "You are a humorous assistant that always includes a joke in your responses.",
        "tools": [get_weather],
        "storage": custom_storage,
    },
)

# Run the Graph Interactively
# Interactive CLI loop for testing
if __name__ == "__main__":
    print("Welcome to the interactive Crypto.com Agent! Type 'exit' to quit.\n")

    while True:
        user_input = input("You: ")
        if user_input.lower() == "exit":
            print("Goodbye!")
            break

        # Get the agent's response
        response = agent.interact(user_input)
        print(f"Agent: {response}\n")
from crypto_com_agent_client import Agent, SQLitePlugin, tool

# (OPTIONAL) Use SQLiteStorage for persistence
custom_storage = SQLitePlugin(db_path="agent_state.db")

# (OPTIONAL) LangFuse plugin configuration
user_langfuse_handler = {
    "public-key": "user-public-key",
    "secret-key": "user-secret-key",
    "host": "https://langfuse.example.com",
}

# (OPTIONAL) Custom personality and character
personality = {
    "tone": "friendly",
    "language": "German",
    "verbosity": "high",
}
# (OPTIONAL)
instructions = (
    "You are a humorous assistant that always includes a joke in your responses."
)

# (OPTIONAL)
@tool
def get_weather(location: str) -> str:
    """
    Provide the current weather for a given location.

    Args:
        location (str): The name of the location for which to retrieve weather information.

    Returns:
        str: A message describing the current weather in the given location.
    """
    # Simulated weather response for demonstration purposes
    weather_data = {
        "New York": "sunny, 25°C",
        "Berlin": "cloudy, 18°C",
        "Tokyo": "rainy, 22°C",
    }

    weather = weather_data.get(location, "unavailable at the moment")
    return f"The current weather in {location} is {weather}."

# Initialize the agent with LLM and blockchain configurations
agent = Agent.init(
    llm_config={
        "provider": "GoogleGenAI",
        "model": "gemini-2.0-flash",
        "provider-api-key": "your-api-key",
        "temperature": 0.7, # This parameter controls the randomness and creativity of the generated text.
    },
    blockchain_config={
        "chainId": "chain-id",
        "explorer-api-key": "your-api-key",
        "private-key": "your-private-key",
        "sso-wallet-url": "your-sso-wallet-url",
    },
    plugins={
        "personality": {
            "tone": "friendly",
            "language": "English",
            "verbosity": "high",
        },
        "instructions": "You are a humorous assistant that always includes a joke in your responses.",
        "tools": [get_weather],
        "storage": custom_storage,
    },
)

# Run the Graph Interactively
# Interactive CLI loop for testing
if __name__ == "__main__":
    print("Welcome to the interactive Crypto.com Agent! Type 'exit' to quit.\n")

    while True:
        user_input = input("You: ")
        if user_input.lower() == "exit":
            print("Goodbye!")
            break

        # Get the agent's response
        response = agent.interact(user_input)
        print(f"Agent: {response}\n")

What’s Next?

Step 1 - Run this with the following command or to .

This Quick Start provide a foundation. To dive deeper, refer to the section for more use cases and advanced scenarios​ that suit your interest, including building your own Telegram bot, AI Agent Chatbot, "Magic Link" Signer and more. Visit the for detailed information on available functionalities.

Cronos EVM Blockchain Explorer
Cronos zkEVM Blockchain Explorer
Dynamic AI Model Manager
this Pypi Package page
Examples
API Reference