What Will This Guide Demonstrate?
This guide provides a step-by-step explanation concerning the entire process of purchasing services from an AI agent on the SingularityNET alpha. By the conclusion of this guide, the user will have purchased services from an AI agent on the SingularityNET alpha platform.
For Whom is this Article Written?
This article is written for anyone interested in experimenting with purchasing AI services from an AI agent on the SingularityNET alpha. The guide assumes the reader is entirely unfamiliar with GitHub, Ethereum wallets, and all other associated facets of purchasing services from the SingularityNET alpha.
Before We Begin, A High-level Perspective
In navigating this guide, the reader will be instructed how to:
- 1.) Register with GitHub
- 2.) Install MetaMask on your browser of choice
- 3.) Configure MetaMask for the Kovan test net
- 4.) Use your GitHub login and your MetaMask wallet address to request Kovan AGI to your MetaMask wallet, from the SingularityNET alpha website
- 5.) Visit the Kovan ETH faucet, and request funds to your MetaMask wallet
- 6.) Request Services from an AI agent on the SingularityNET alpha
Graphical Representation of Data Flow for Guide
The data flow graph above demonstrates the user-driven communication with the various modules throughout the guide. Below, each communication to and from the module is explained:
- User provides credentials during registration with GitHub
- GitHub provides user with GitHub username
- User downloads and provides credentials for the MetaMask web browser extension
- MetaMask provides user with wallet addresses, private keys, and a username
- User configures MetaMask to operate in the Kovan Test Network mode
- MetaMask provides to user the Kovan wallet address and balance
- User provides the Kovan Test Network wallet address
- SingularityNET alpha sends 1.0 Kovan AGI to user’s Kovan Test Network wallet address
- User provides the Koven Ethereum faucet with the Kovan Test Network Wallet Address
- Kovan Ethereum Faucet sends 3.0 Kovan Ethereum (ETH) to user’s Kovan Test Network wallet address
- User selects an AI agent on the SingularityNET alpha and sends the requisite amount of Kovan AGI to purchase the service offered by the AI agent
- AI agent on the SingularityNET alpha provides the purchased services
While traversing the guide, if there is an issue at any of the 12 steps mentioned above, please reference which step is causing the issue when seeking support. This will help support your successful purchase of AI services.
1.) Registering with GitHub
GitHub is a platform on which many software teams work collaboratively — either with the community or in private groups — on a particular project or set of projects. GitHub offers a base level service tier, which is free to the community.
In order to participate, you will need to register at GitHub. If you have a GitHub account already, you can skip this step. The setup should look like this:
Select the free tier, unless you think you’ll be running some private repositories. In any case, you can easily upgrade later.
Give GitHub some market analytics, if you want.
Make sure you confirm the email from GitHub at the email address you registered with.
And, that’s it. You should now be registered with GitHub sufficiently well to run the SingularityNET alpha.
2.) Install MetaMask on Chrome Browser
MetaMask is an internet browser application extension that allows the use of multiple Ethereum-based platform wallets. You will be given a unique key phrase for sole control of your MetaMask wallet. If you are unfamiliar with private key management, it is recommended that you do not use MetaMask outside the purposes of this guide until you have had a chance to become familiar; mismanagement of private keys may result in lost funds. If you have used MetaMask in the past, and you are uncomfortable with this step, it is advisable that you register a new MetaMask wallet solely for the purposes of this tutorial.
You don’t have to use Chrome browser. I did, and this tutorial is specific to that, but there are other options. If you have any issues on a different browser, let me know. Always glad to help. Obviously, if you have MetaMask already, you can skip this step.
Visit the MetaMask website, and choose the Chrome app.
After clicking on the ‘GET CHROME EXTENSION’ tab, you will be prompted to the Google app store, where you can install the MetaMask Chrome app.
Click ‘ADD TO CHROME’ in the top right of the screen.
You’ll then be prompted through all sorts of permission requests before finishing the install. I’ve listed them below. As always, it is important to read these. After reading each, click ‘Accept’ (you have to scroll to the bottom before it will allow you to accept).
Then, you will be asked to choose a password. As MetaMask is a handy tool generally, I suggest creating a strong password.
Next is probably the most important part of setting up MetaMask, especially if you use it for storing valuable tokens later. Get something to write your seed sequence on, and make sure you have a safe place to put it.
You should be all set up now with MetaMask. If the user interface disappeared, you should be able to find it on the Chrome apps dashboard, which should look something like this.
Click on the fox, that’s MetaMask.
If everything went well, you should see the MetaMask home screen.
3.) Configure MetaMask to Work with the Kovan Test Net
The Kovan network is an Ethereum test network. Prior to deploying real-time applications on the Ethereum main network, which uses fiat-denominated (i.e. valuable) Ethereum, projects use Kovan or other Ethereum test networks to pilot their software. The Kovan test network offers developers a chance to test their applications prior to deployment on the Ethereum main network.
Notice, at this time, you have no test ETH in the account and that the MetaMask wallet is in the ETH ‘Main Network’ mode. Let’s change the mode to the Kovan Network mode, which is a platform for testing ETH dapps prior to release. Click on the drop down tab beside ‘Main Network’ in the top left, and select the ‘Kovan Test Network’.
Your home screen should now look like the image below, clearly demonstrating you are on the Kovan Test Net. Now, click on the ‘…’ tab and you will be able to copy your MetaMask ETH wallet address to your clipboard.
4.) Request Kovan AGI from the SingularityNET alpha Website
Kovan AGI refers to AGI tokens that have been created for and used by the Kovan test network. These tokens are not fiat-denominated (valuable). Kovan AGI tokens facilitate the operation of the Kovan test network SingularityNET alpha. Kovan AGI are not valuable. Kovan AGI will be used to purchase AI services from an AI agent on the SingularityNET alpha.
Now, you will want to visit the SingularityNET alpha website.
When you get there, you should see this.
Click ‘LOGIN’. You will be asked to provide your GitHub credentials, and provide access to the SingularityNET alpha.
Select ‘Authorize singnet’, and you should get the following screen.
If you do not get the screen above, make sure your MetaMask is unlocked and able to communicate through the browser. This usually means logging in.
You can see that you have no AGI in your MetaMask wallet, by looking at the ‘Balance’ tab. Let’s fix that.
Click on the ‘Get Kovan AGI’ tab in the top right. Give it a few seconds and, if you have been successful, you should get the following screen.
You will have been sent to a different page than you were previously on during this process. Navigate back to the SingularityNET alpha website.
You should now have 1 AGI in your wallet, as shown below.
5.) Acquire Kovan Test Net Ethereum Tokens
All transactions that take place on the Kovan test network require the use of Kovan Ethereum. Kovan Ethereum are required to generate any transaction on the Kovan test network, as is the case on the Ethereum main net. Before a Kovan AGI token can be sent to an AI agent for purchase of services, the sending wallet must possess Kovan Ethereum to afford the transaction.
There’s only one minor issue. You still don’t have any Kovan ETH to pay for gas fees that will allow you to spend the AGI. Let’s get some.
Visit the Kovan faucet.
You’ll likely have to sign up to join. Click ‘SIGN IN TO START TALKING’. I recommend doing so with GitHub.
Select ‘SIGN IN WITH GITHUB’ and provide any necessary credentials.
You’ll be asked to agree to their terms and permit Kovan to access your GitHub account.
Now, you can request Kovan ETH to your MetaMask wallet. So, join the room by clicking ‘JOIN ROOM’ at the bottom of the chat.
Once in the chat, simply supply your Kovan Test Net MetaMask wallet address to the text entry field. As a reminder, the MetaMask wallet address can be found here.
After you have the wallet address, supply it to the Kovan chat as follows.
Wait for a few minutes before you receive a response. Once your request has been processed, you should receive a message like the following.
Give it a few more minutes for the Kovan Test Net ETH to make it to the MetaMask wallet, and we can verify receipt.
If everything worked, you should now have 3.000 ETH in the MetaMask wallet. We are now ready to spend out Kovan AGI on the SingularityNET alpha.
6.) Purchase Services from an AI Agent on the SingularityNET alpha Platform
The purchase of AI services from an AI agent on the SingularityNET alpha consists of supplying a desired task to the AI agent. Each agent is trained to perform a specific, narrow task and will produce only the results specific to its narrow training. The example I have chosen is an image classification neural network, and attempts to identify and categorize a given image. Several of the other AI agents (those that this guide does not engage with) require user inputs which I have not been able to locate. As such, without specification of required user inputs, it is recommended the reader purchase services from the AI agent used in the following example.
Return once again to the SingularityNET alpha website.
If MetaMask is unlocked, your Kovan ETH are in the MetaMask wallet, and the Kovan AGI are in the wallet, you should now be able to see the list of AI agent services specific to the SingularityNET alpha.
A word of caution here.
It may be my own shortcoming, but I was not able to find documentation for several of the AI agents at this time. This does not mean the documentation does not exist, but merely that I could not locate any.
However, I was successful with purchasing services from the ‘Alpha TensorFlow Agent’, which was pretty cool. I recommend using it (because this tutorial does).
Select ‘Create Job’ on the ‘Alpha TensorFlow Agent’ tab. You should see this.
Select ‘Create Job Contract’ and permit the transaction on MetaMask when prompted.
Now, select ‘Approve AGI Transfer’.
Verify the transaction on MetaMask.
Select ‘Fund Job Contract’.
Approve the transaction on MetaMask.
Select ‘Call Agent API’.
Sign the message on MetaMask.
Select an image of interest from your local computer, or download something from the internet.
Once again, select ‘Call Agent API’. Now, the classification neural network will attempt to accurately classify the image you provided and will also provide a confidence score.
What Just Happened?
Apparently the neural network believes the image I supplied is a jellyfish, and gives its prediction a confidence score of 0.498.
Congratulations! You have just purchased AI services from the SingularityNET alpha platform. I had fun, and spent some more time throwing images at the neural network to see how it was working. I gave it some easy ones and some tough ones. The results were interesting.
I hope you enjoyed this tutorial. If you have any difficulty, and you want support, give me a shout. Glad to help you get set up and try out the alpha!
All comments and requests for clarification are welcome. Please submit any commentary/questions in the comments section below, and I will address them promptly.