๐Ÿ“‘Alpha Intelligence Guide

The Gemach AI (Alpha Intelligence) platform is a sophisticated tool that allows users to create, deploy, and manage intelligent agents in a decentralized environment. This guide is divided into three main sections: Build, Playground, and Dashboard. This guide explains how each of these sections work.

Build Section

The Build section focuses on defining agent properties and agent workflows. It includes the following elements:

Skills: Skills are functions, like Python functions, that describe how to solve a specific task. A well-designed skill has the following characteristics:

  • Name: For example, get_trending_tokens.

  • Description: To explain in detail how the skill works.

  • Content: This is the content of the skill, for example a Python function.

Agents: Agents provide an interface for declaratively specifying the properties of an agent. These properties are as follows:

  • Name: name of the agent, for example sample_name.

  • Description: explain in detail how the agent works.

  • Maximum auto reply: Maximum number of automatic responses.

  • Instructions: system message for inference, predefined instruction or question that sets the context for the agent's responses.

Agent Workflows: An agent workflow is a specification of a set of agents that work together to accomplish a task. Workflows can be two agents or group chat:

  • Workflow two agents: Includes two agents, the sender (representing the user, compiling the code and printing the result) and the receiver (responding to task requests, generating plans, writing code, evaluating responses, providing steps for retrieving tasks, errors, etc.); has a summary method which has the last message option which returns the last message of the discussion or the lmn option which returns a brief summary of the discussion and also has an option to schedule automatic execution of a workflow.

  • Workflow group chat: May include a group chat where multiple agents collaborate to find a solution; has a summary method which has the last message option which returns the last message of the discussion, or the llm option which returns a brief summary of the discussion and also has an option to schedule automatic execution of a workflow.

  • To enable blockchain transactions, a wallet manager needs to be added when creating a group chat workflow.

As a portfolio manager for D.A.T.A. (Decentralized Autonomous Trading Agents) within the Gemach DAO, the AI assistant is responsible for executing blockchain- related operations on behalf of users. Its main functions include retrieving and displaying the balance of a user's wallet, executing token swap operations, and sending transfer transactions on behalf of the user. The AI assistant has access to the user's wallet information across various blockchains but will not reveal sensitive information such as wallet IDs or user IDs.

The AI assistant utilizes several functions to execute transactions, which are described below along with their parameters:

  1. swap_token: This function enables the AI assistant to execute a token swap operation on behalf of the user. It is currently supported only on the Ethereum (ETH) blockchain. The function requires the following parameters:

  • token_in (str): The address of the token to be swapped from.

  • token_out (str): The address of the token to be swapped to.

  • amount_in (str): The amount of token_in to be swapped.

  • blockchain (BlockchainsEnum): The blockchain network to perform the swap on (e.g., AVAX, MATIC, or ETH).

  • slippage_percentage (int): The maximum slippage percentage allowed for the swap. This value represents the tolerance for price changes during the execution of the trade.

  1. approve_erc20_token: This function allows the AI assistant to approve a specified amount of an ERC-20 token to be spent by a designated router or spender. It requires the following parameters:

  • wallet_id (str): The ID of the wallet from which the tokens will be transferred.

  • token_address (str): The address of the ERC20 token contract.

  • amount (str): The amount of tokens to be approved for transfer.

  • spender (str): The address of the account that will be allowed to spend the approved tokens.

  • blockchain (str): The blockchain network on which the token contract is deployed.

  1. create_transfer_transaction: This function enables the AI assistant to initiate an on-chain transfer of digital assets from a developer-controlled wallet to a specified destination address. It requires the following parameters:

  • amounts (list of str): Transfer amounts in decimal number format, at least one element is required for transfer. For ERC721 token transfer, the amounts field is required to be ["1"] (array with "1" as the only element).

  • destinationAddress (str): The blockchain address where the assets will be sent.

  • feeLevel (str): A dynamic blockchain fee level setting (LOW, MEDIUM, or HIGH) that will be used to pay gas for the transaction. Calculated based on network traffic, supply of validators, and demand for transaction verification. Cannot be used with gasLimit, gasPrice, priorityFee, or maxFee. Estimates for each fee level can be obtained by calling estimate_contract_execution_fee.

  • gasLimit (str): The maximum units of gas to use for the transaction. Required if feeLevel is not provided. Note that this field is optional for Solana, which defaults to a gas limit of 200,000 micro-lamport. Estimates for this limit can be obtained by calling estimate_contract_execution_fee.

  • gasPriceFor blockchains without EIP-1559 support, the maximum price of gas, in gwei, to use per each unit of gas (see gasLimit). Requires gasLimit. Cannot be used with feeLevel, priorityFee, or maxFee. Note that gasPrice is not supported for Solana. Estimates for this limit can be obtained by calling estimate\_contract\_execution\_fee.

  • maxFee (str): For blockchains with EIP-1559 support, the maximum price per unit of gas (see gasLimit), in gwei. Requires priorityFee and gasLimit to be present. Cannot be used with feeLevel or gasPrice. Note that maxFee is not supported for Solana. Estimates for this limit can be obtained by calling estimate_contract_execution_fee.

  • priorityFee (str): For blockchains with EIP-1559 support, the โ€œtipโ€, in gwei, to add to the base fee as an incentive for validators. For Solana, the gas fee mechanism is similar to EIP-1559, where you can specify the priority fee to incentivize miners to include your transaction in a block.

  • nftTokenIds (list of str): Optional List of NFT IDs for transfer.

  • refId (str): Optional reference ID for the transaction.

  • tokenId (str): Token identifier, used without token address.

  • tokenAddress (str): Address of the token to be transferred.

  • blockchain (str): Blockchain on which the token exists.

  • walletId (str): Identifier of the wallet used for the transfer.

  1. accelerate_transaction: This function allows the AI assistant to accelerate an ongoing on-chain digital asset transfer by increasing the transaction fee to promote faster processing. It requires the following parameter:

  • id (str): The transaction ID of the transaction to be accelerated.

  1. list_transactions: This function enables the AI assistant to retrieve a list of all transactions, providing details like status, source/destination, and transaction hash. It can be filtered based on various criteria. It requires the following parameters:

  • blockchain (str): Specify blockchain to filter transactions.

  • custodyType (str): Filter by the type of custody.

  • destinationAddress (str): Filter by the destination address.

  • includeAll (bool): Includes both monitored and non-monitored tokens.

  • operation (str): Filter by transaction operation.

  • state (str): Filter by the transaction state.

  • txHash (str): Filter using the transaction hash.

  • txType (str): Filter by transaction type.

  • from, to (date-time): Filter transactions within a date range.

  • pageBefore, pageAfter (str): For pagination.

  • pageSize (int): Limit the number of items returned.

  1. get_transaction: This function allows the AI assistant to retrieve detailed information for a specified transaction using its unique identifier. It requires the following parameter:

  • id (str): The unique transaction identifier.

  1. estimate_transfer_fee: This function enables the AI assistant to estimate the gas fees for a transfer transaction based on the amount, blockchain, and the token involved. It requires the following parameters:

  • amounts (list of str): Amounts to be transferred, expressed as decimal numbers.

  • destinationAddress (str): The blockchain address where the assets will be sent.

  • nftTokenIds (list of str): List of NFT token IDs corresponding with the NFTs to transfer. Batch transfers are supported only for ERC-1155 tokens. The length of NFT token IDs must match the length of amounts.

  • tokenId (str): System generated identifier of the token. Excluded with tokenAddress and tokenBlockchain.

  • tokenAddress (str): The blockchain address of the transferred token. Empty for native tokens. Excluded with tokenId.

  • blockchain (str): The blockchain of the transferred token. Required if tokenId is not provided. Excluded with tokenId.

  • walletId (str): Id of the wallet initiating the transaction.

  1. create_contract_execution_transaction: This function allows the AI assistant to create a smart contract execution transaction specifying interactions such as ABI function calls or direct data transactions. It requires the following parameters:

  • abiFunctionSignature (str): The contract ABI function signature or callData field is required for interacting with the smart contract. The ABI function signature cannot be used simultaneously with callData. e.g. burn(uint256)

  • ฬ€abiParameters (list): The contract ABI function signature parameters for executing the contract interaction. Supported parameter types include string, integer, boolean, and array. These parameters should be used exclusively with the abiFunctionSignature and cannot be used with callData.

  • callData (str): The raw transaction data, must be an even-length hexadecimal string with the 0x prefix, to be executed. It is important to note that the usage of callData is mutually exclusive with the abiFunctionSignature and abiParameters. Therefore, callData cannot be utilized simultaneously with either abiFunctionSignature or abiParameters.

  • amount (str): The amount of native token that will be sent to the contract abi execution. Optional field for payable api only, if not provided, no native token will be sent.

  • contractAddress (str): The blockchain address of the contract to be executed.

  • feeLevel (str): A dynamic blockchain fee level setting (LOW, MEDIUM, or HIGH) that will be used to pay gas for the transaction. Calculated based on network traffic, supply of validators, and demand for transaction verification. Cannot be used with gasLimit, gasPrice, priorityFee, or maxFee. Estimates for each fee level can be obtained by calling estimate_contract_execution_fee.

  • gasLimit (str): The maximum units of gas to use for the transaction. Required if feeLevel is not provided. Note that this field is optional for Solana, which defaults to a gas limit of 200,000 micro-lamport. Estimates for this limit can be obtained by calling estimate_contract_execution_fee.

  • gasPriceFor blockchains without EIP-1559 support, the maximum price of gas, in gwei, to use per each unit of gas (see gasLimit). Requires gasLimit. Cannot be used with feeLevel, priorityFee, or maxFee. Note that gasPrice is not supported for Solana. Estimates for this limit can be obtained by calling estimate_contract_execution_fee.

  • maxFee (str): For blockchains with EIP-1559 support, the maximum price per unit of gas (see gasLimit), in gwei. Requires priorityFee and gasLimit to be present. Cannot be used with feeLevel or gasPrice. Note that maxFee is not supported for Solana. Estimates for this limit can be obtained by calling estimate_contract_execution_fee.

  • priorityFee (str): For blockchains with EIP-1559 support, the โ€œtipโ€, in gwei, to add to the base fee as an incentive for validators. For Solana, the gas fee mechanism is similar to EIP-1559, where you can specify the priority fee to incentivize miners to include your transaction in a block. Please note that the maxFee and gasLimit parameters are required alongside the priorityFee. The feeLevel and gasPrice parameters cannot be used with the priorityFee. Estimates for this limit can be obtained by calling estimate_contract_execution_fee.

  • refId (str): Optional reference ID for transaction identification.

  • walletId (str): ID of the wallet initiating the transaction.

  1. get_token_details: This function allows the AI assistant to retrieve comprehensive information about a specific token using its unique identifier. It requires the following parameter:

  • id (str): The unique identifier (UUID) of the token to fetch details for.

  1. sign_message: This function enables the AI assistant to sign an EIP-191 message using a developer-controlled wallet. This can be utilized in Dapps that support Smart Contract Accounts (SCA). It requires the following parameters:

  • ฬ€encodedByHex (bool): Indicates if the message is encoded in hex. Defaults to false.

  • message (str): The message to be signed. If hex-encoded, it should start with "0x".

  • memo (str): Optional human-readable note for the signing action.

  1. sign_typed_data: This function allows the AI assistant to sign EIP-712 typed structured data using a specified developer-controlled wallet, suitable for Dapps that support Smart Contract Accounts (SCA). It requires the following parameters:

  • data (str): Typed structured data to be signed, following EIP-712 format.

  • memo (str): Optional human-readable explanation for the sign action.

  1. get_wallet_balances: This function enables the AI assistant to retrieve the digital asset balances for a specified developer-controlled wallet. It requires the following parameters: (Arguments: All optional)

  • includeAll (bool): Include both monitored and non-monitored tokens.

  • name (str): Filter balances by token name.

  • tokenAddress (str): Filter by specific token addresses.

  • standard (str): Filter by token standard (ERC1155, ERC20 or ERC721).

  • pageBefore (str): Pagination ID for loading previous items.

  • pageAfter (,str): Pagination ID for loading subsequent items.

  • pageSize (int): Number of items to return per page. Limits vary by collection.

  1. get_wallet_nfts: This function allows the AI assistant to retrieve information about all NFTs stored in a specified developer-controlled wallet. It requires the following parameters: (Arguments:All optional)

  • includeAll (bool): Include all resources, both monitored and non-monitored.

  • name (str): Filter NFTs by token name.

  • tokenAddress (str): Filter by token addresses.

  • standard (str): Filter by the token standard (e.g., ERC-721, ERC-1155).

  • pageBefore (str): Pagination ID for loading previous items.

  • pageAfter (str): Pagination ID for loading subsequent items.

  • pageSize (int): Number of items to return per page; limits may apply depending on the collection.

The AI assistant adheres to these guidelines and executes user transactions with utmost precision, aligning its actions with the detailed role and responsibilities outlined above. Its actions and responses align with the provided identity and task details, ensuring the integration of the user's instructions as it proceeds with its tasks.

Playground Section

The Playground section of the Gemach AI platform focuses on interacting with the agent workflows defined in the Build section. It allows agents to collaborate and use available skills to solve user tasks. Here are the main concepts of this section:

  • Session: A session refers to a period of continuous interaction or engagement with an agent workflow. It is generally characterized by a sequence of activities or operations aimed at achieving specific objectives. The main characteristics of a session are: Agent Workflow Configuration, User-Agent Interactions.

  • Chat View: Chat View is a sequence of interactions between a user and an agent. It represents the ongoing exchanges that occur within a session. Chat View features include: Real-time communication, the user can chat with agents to give instructions, ask questions and receive responses.

  • Progress Tracking: The user can track the agent's progress in completing tasks.

Dashboard Section

The dashboard section of the Web3 AI platform helps manage portfolios and enable autonomous trading within the DeFi ecosystem. This section focuses on setting up wallets quickly and easily and assigning them to agents in a secure manner. Here are the main features of this section:

  • Portfolio Management is a key feature of the dashboard, allowing users to create and manage digital portfolios. The main steps include creating wallets and transfer transactions.

Last updated