Coins: 12,834
Exchanges: 948
Market Cap: $2.05T 0.9%
24h Vol: $106.621B
Gas: 32 GWEI
Go Ad-free
API
TABLE OF CONTENTS

How to Build an AI Crypto Chatbot (Low-code Easy Tutorial)

4.6 | by Automation Architech

Have you ever thought of building your chatbot, but felt overwhelmed by the technical details? Fortunately with drag-and-drop editors, advanced coding skills are no longer required to create an artificial intelligence (AI) cryptocurrency chatbot based on a language learning model (LLM).

In this beginner-friendly tutorial, we’ll cover how to easily develop and deploy your own crypto AI chatbot with Flowise, an open-source UI tool to build custom LLM flows without needing to code, leverage OpenAI's GPT-3.5 Turbo model and CoinGecko API for crypto price data.

Let’s dive in!

Disclaimer: This guide is catered for users operating on Windows.


Design your own AI crypto chatbot - easy step-by-step guide for beginners

How to Create an AI Crypto Chatbot

We'll be creating an artificial intelligence (AI) cryptocurrency chatbot in 5 easy steps, without prior coding knowledge needed. Here's a quick overview of the steps:

  1. Set up Flowise on your computer.
  2. Create and connect nodes in your Flowise project.
  3. Add your OpenAI API key.
  4. Add your CoinGecko API key.
  5. Test your chatbot by asking questions.

Step 1: Set up Flowise

First, ensure you have Node.js installed on your computer. Visit nodejs.org and download the LTS version.

Set up Flowise on your computer

Once installed, open the command prompt and input the following command:

npm install -g flowise

Execute this command to install Flowise on your local machine.

Install Flowise

Once installed successfully, input the following command.

npx flowise start

If everything is set up right, you’ll see a message that says ‘Flowise server is listening at port 3000’.

code script

To access Flowise, navigate to http://localhost:3000 and you’ll arrive at the Flowise dashboard shown below:

Step 2: Create and Connect Nodes in Your Flowise Project

To initiate a new chat Flow, click on ‘Add New’. This action will present you with a blank canvas where you can design your AI application.

Blank canvas on Flowise

On the left side of the screen, there’s a button for adding nodes. Once clicked, it reveals a list of available components, such as agents, chains, chat models, document loaders, and more, which we can utilize.

Add nodes to chat flow

Let’s start by dragging and dropping the nodes. We’ll be using chains, so navigate to nodes and select ‘chains’.

There, you’ll find a chain named ‘conversational retrieval QA chain’, which is a document QA chain. This fits our needs perfectly, so let’s place it onto the canvas.

conversational retrieval QA chain

Drag the OpenAI chat model node onto the canvas. Once in place, quickly connect this LLM to the chain. Next, input your OpenAI API key. We can retain the default model setting as GPT 3.5 Turbo. Now, let’s proceed to set up the next steps.

CoinGecko API key.

Click on ‘nodes’ and navigate to ‘Vector stores’. Within this section, there are several options available. For this demonstration, we’ll choose the ‘in-memory Vector store’.

However, for real-world applications, consider alternatives like ‘pinecone’ or “‘Super Bass’. Drag the in-memory Vector store onto the canvas, and connect it to our chain. Now, our chain is equipped with both an LLM and a vector store.

Vector Stores

Next, we’ll introduce a document loader to our project. Under ‘document loaders’, there’s a range of options, including the Cheerio web scraper, upload CSV and DOCX files, and even a loader for a folder containing various files.

For simplicity, we’ll add the ‘API loader’ to our project. This node enables us to fetch data from the CoinGecko API, converting the data into documents. Now, let’s connect this node to our vector store.

Flowise API Loader

What we aim to do is upload our file, divide its contents into segments, and then generate documents from these segments.

Alternatively, we can connect a text splitter to this node. In the nodes section, navigate to “Text Splitters”. 

Within that category, choose the “Recursive Character Text Splitter” and incorporate it into our canvas.

You can link the “text splitter” to the “text splitter” parameter on our text file node.

Text Splitter

While the default chunk size is set at 1,000 characters, we can reduce this to 200 characters. However, the ideal chunk size is ultimately your decision – bearing in mind that the goal is to extract these chunks to enrich our conversation context. Smaller chunks are advantageous because they utilize fewer tokens, which can result in cost savings. We can also set a chunk overlap, say 20 characters, ensuring each chunk includes portions from its preceding and succeeding chunks.

Now, with this setup, you can upload files directly from your device.

The system will then segment the file based on the specified parameters, and each segment will be transformed into a ‘line chain’ document stored in our Vector database.

This leads us to the final element of our chain: embeddings. For the AI to comprehend the content stored in the database, it must translate the text into vector arrays. To achieve this translation, we invoke the embeddings function.

Embeddings Function on Flowise

Setting this up is straightforward. In the nodes section, navigate to ‘embeddings’. From the available options, choose the embedding function corresponding to our LLM. Since we’re utilizing OpenAI as the LLM, we’ll opt for the ‘OpenAI embeddings function’.

Drag and drop this onto your workspace. Link it to the Vector store. Remember, to activate the OpenAI embeddings API, you’ll need to provide the OpenAI API key. Once done, you can proceed to save your setup.

Step 3: Add the OpenAI API Key

The next step is to add your OpenAI Key to these two nodes. If you need help learning how to get your API key from OpenAI, you can follow this guide.

Add Your OpenAI API Key in Flowise

OpenAI API Key

Step 4: Add the CoinGecko API Key

Sign up for a CoinGecko Demo account and generate your Demo API key. Once you have your API key, head over to our API documentation and identify the desired endpoint. For this tutorial, we’ll focus on the following two endpoints:

  • /coins/markets – provides a comprehensive list of coin prices, market caps, volumes, etc.
  • /search/trending – retrieves data on top trending searches

CoinGecko API key.

Navigate to /coins/markets on CoinGecko API. Click on ‘Try it out.’ The mandatory parameter here is vs_currency. Input your desired currency — in this instance, we’ll use USD.

CoinGekcko API coins markets endpointSearch Trending Endpoint CoinGekcko API

While this is the only requirement, you have the flexibility to adjust other parameters. For instance, by selecting ‘category,’ you can filter coins by their categories. After configuring your desired parameters, hit ‘Execute’. Then, it will generate the URL, which you can then integrate into the chatbot’s API loader.

CoinGecko API documentation /coins/markets endpoint free crypto price apicrypto price api feed

Once you have the URL ready, you can append your CoinGecko API Key at the end – `&x_cg_demo_api_key=YOUR_API_KEY` and replace YOUR_API_KEY with your actual CoinGecko API Key. For example, to fetch Bitcoin's market data using your Demo API key, you would use:

https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin&x_cg_demo_api_key=YOUR_API_KEY

Finally, add the URL to Flowise API Loader and insert the URL you want to talk to.

CoinGecko API key.

Now that your URL has been processed , you can start chatting with the results returned from it.

With that, you have designed your first chatbot! Let's move on to the final step to test the chatbot's flow and logic.

Step 5: Test Your AI Crypto Chatbot

We'll ask a few questions to see if our chatbot is indeed pulling live and accurate information from CoinGecko API.

First query: What is the price of Bitcoin today?

CoinGecko API key.

Second query: What is the 7-day price change for Ethereum?”

CoinGecko API key.

Third query: What coin is trending today?

Due to limitations in this tutorial’s architecture, we treat each endpoint as a single 'document' for the chatbot to reference. To give the bot access to today’s trending information, you will need to update the CoinGecko API to /search/trending.

https://api.coingecko.com/api/v3/search/trending&x_cg_demo_api_key=YOUR_API_KEY

Test your artificial intelligence AI crypto chatbot


Conclusion

With the sheer accessibility to data provided by APIs, building a chatbot is no longer a complicated and challenging process. By understanding the basics of how chatbots work and using the right tools and data feeds, you can easily create an AI crypto chatbot.

Unlock OHLC crypto price data with paid CoinGecko API plans

Tell us how much you like this article!
Vote count: 43
Automation Architech
Automation Architech

Automation Architech boasts a seasoned team specializing in ML-driven solutions, operations engineering, and digital product development. They are dedicated to ethical AI, bridging tech gaps, and fostering creativity without sidelining humanity. Follow the author on Twitter @auto_architech

Related Articles

coingecko
Continue in app
Track prices in real-time
Open App
Select Currency
Suggested Currencies
USD
US Dollar
IDR
Indonesian Rupiah
TWD
New Taiwan Dollar
EUR
Euro
KRW
South Korean Won
JPY
Japanese Yen
RUB
Russian Ruble
CNY
Chinese Yuan
Fiat Currencies
AED
United Arab Emirates Dirham
ARS
Argentine Peso
AUD
Australian Dollar
BDT
Bangladeshi Taka
BHD
Bahraini Dinar
BMD
Bermudian Dollar
BRL
Brazil Real
CAD
Canadian Dollar
CHF
Swiss Franc
CLP
Chilean Peso
CZK
Czech Koruna
DKK
Danish Krone
GBP
British Pound Sterling
GEL
Georgian Lari
HKD
Hong Kong Dollar
HUF
Hungarian Forint
ILS
Israeli New Shekel
INR
Indian Rupee
KWD
Kuwaiti Dinar
LKR
Sri Lankan Rupee
MMK
Burmese Kyat
MXN
Mexican Peso
MYR
Malaysian Ringgit
NGN
Nigerian Naira
NOK
Norwegian Krone
NZD
New Zealand Dollar
PHP
Philippine Peso
PKR
Pakistani Rupee
PLN
Polish Zloty
SAR
Saudi Riyal
SEK
Swedish Krona
SGD
Singapore Dollar
THB
Thai Baht
TRY
Turkish Lira
UAH
Ukrainian hryvnia
VEF
Venezuelan bolívar fuerte
VND
Vietnamese đồng
ZAR
South African Rand
XDR
IMF Special Drawing Rights
Cryptocurrencies
BTC
Bitcoin
ETH
Ether
LTC
Litecoin
BCH
Bitcoin Cash
BNB
Binance Coin
EOS
EOS
XRP
XRP
XLM
Lumens
LINK
Chainlink
DOT
Polkadot
YFI
Yearn.finance
Bitcoin Units
BITS
Bits
SATS
Satoshi
Commodities
XAG
Silver - Troy Ounce
XAU
Gold - Troy Ounce
Select Language
Popular Languages
EN
English
RU
Русский
DE
Deutsch
PL
język polski
ES
Español
VI
Tiếng việt
FR
Français
PT
Português
All Languages
AR
العربية
BG
български
CS
čeština
DA
dansk
EL
Ελληνικά
FI
suomen kieli
HE
עִבְרִית
HI
हिंदी
HR
hrvatski
HU
Magyar nyelv
ID
Bahasa Indonesia
IT
Italiano
JA
日本語
KO
한국어
LT
lietuvių kalba
NL
Nederlands
NO
norsk
RO
Limba română
SK
slovenský jazyk
SL
slovenski jezik
SV
Svenska
TH
ภาษาไทย
TR
Türkçe
UK
украї́нська мо́ва
ZH
简体中文
ZH-TW
繁體中文
Login to track your favorite coin easily 🚀
By continuing, you agree to CoinGecko Terms of Service and acknowledge you’ve read our Privacy Policy
or
Forgot your password?
Didn't receive confirmation instructions?
Resend confirmation instructions
IT'S FREE! Track your favorite coin easily with CoinGecko 🚀
By continuing, you agree to CoinGecko Terms of Service and acknowledge you’ve read our Privacy Policy
or
Password must contain at least 8 characters including 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character
Didn't receive confirmation instructions?
Resend confirmation instructions
Forgot your password?
You will receive an email with instructions on how to reset your password in a few minutes.
Resend confirmation instructions
You will receive an email with instructions for how to confirm your email address in a few minutes.
Get the CoinGecko app.
Scan this QR code to download the app now App QR Code Or check it out in the app stores