2023.04.28

how to talk to your Blockchain ... in English

introduction

The rise of blockchain technology, especially in the area of cryptocurrency has changed the way we conduct transactions online. Having more people but also enterprises utilizing this technology, the need for an "easy" way to interact with blockchains has become extremely important. Blockchain explorers offer a useful solution providing a very small window into the inner workings of cryptocurrency and other related technology.

While blockchain explorers can be powerful tools for exploring and understanding the blockchain, they do require a certain level of technical expertise and may not always offer a user-friendly interface or comprehensive features. The average laymen have to deal with technical complexity, lack of user-friendly interface, limited features and very often with speed- and performance issues.

the "AI" hype

So-called Artificial intelligence (AI) has become one of the biggest hype topics in computer technology over the last 2 years. Voice assistants, self-driving cars, super chatbots such as ChatGPT and much more. AIs are already being used in many areas of our daily life and business. Many new applications are set to follow in the next couple of years.

the idea

Wouldn't it be cool, to have an interface which allows you to talk to an existing Blockchain in English or any other language. Why not try to combine a Blockchain with one of the existing AI - LLM's?

the proof is out there

In one of our previous blog entry, we mentioned the Austrian Air Quality Chain, which is a monitoring solution providing and storing air- and weather information. Due to the fact, that AQC chain stores much more than simple hashes and numbers, it is a prefect candidate for such an experiment.

In order to avoid a super slow system by querying the chain online, we decided to use a downloaded snapshot instead. Even the Viennese AQC - data for the last couple of years provided millions of entries.

Technology wise, we choose the LangChain framework. LangChain is a very comprehensive framework for developing applications powered by language models such as ChatGPT. It offers modules for LLM models, prompts, indexes, chains and agents, making development pretty easy and straightforward. For the sake of convenience and since everyone is talking about it, we also choose ChatGPT as the LLM (Large language model). LangChain comes with a long list of document loaders, indexes and corresponding text splitters which basically allows you to work with any type of data, from simple files, over databases up to web content and even YouTube videos.

Texts and pieces of texts can afterwards create so-called embeddings, which are vector representations of this data. Those embeddings can afterwards persistent stored in many different databases such as Chroma.

LangChain is available on PyPi, so to it is supposedly easy to install with pip. As it turned out, you have to tweak and config a little bit and even patch a couple of modules in order to make it work properly.

..does it actually work?

Although our plan was to make a command line only version, we decided to wrap a simple web application around in order to be able to present it online without messing around with shell's and ssh sessions.

Screen: AQC Talker is not going to win a design contest


..let's begin with a very simple question:

Screen: AQC Talker is explaining the data it is working with


..search for specific values:

Screen: AQC Talker tells us at which station it recorded the highest Ozone values


..more simple questions:

Screen: AQC talks about dangerous places


..let's try to have it think a little bit more:

Screen: Everyone loves windmills


..can it even look into a crystal ball and predict the future?:

Screen: AQC Talker thinks that it is gonna be warm next winter.


..how is it dealing with absolute stupid questions?:

Screen: AQC Talker is having its own mind


conclusion

As we have learned, it is possible to talk to Blockchain's naturally .. more or less. Please be aware, that this will only work up to a certain level, heavily depending on the quality of data you can provide.

One of the reasons why ChatGPT has gained so much attention is the fact, that it is using years and years of website scraping. Without that information, it would most likely only be able to correct your speaking- or typing grammar, nothing else.

Nevertheless. This experiment has shown, that apart from this simple hack, there will be meaningful future use cases capable of bridging the gap between people and software.

For more information on Blockchain tech and how to implement Blockchain applications in a real world scenario, do not hesitate to contact us at office@infinite-trust-digital.com

@Copyright 2023 - Infinite Trust Digital GmbH