Getting Started With AI Functions

Featured Imgs 23

This past week we went "all-in" on AI functions. An AI function is the ability to create AI assistant logic, allowing the chatbot to "do things," instead of just passively generating text.

To understand the power of such functions you can read some of our previous articles about the subject.

How To Avoid AI Hallucinations With ChatGPT

Category Image 062

Tage wrote about how to prevent ChatGPT from hallucinating a couple of months ago. However, I wanted to dive deeply into one specific thing you can do to completely avoid AI hallucinations. Before I explain how to avoid hallucinations, I need to explain a little bit about what we do when we create a custom ChatGPT chatbot.

What we do is prompt engineering based on an SQL database with VSS capabilities. It could be argued that we jailbreak ChatGPT, but instead of allowing ChatGPT to go completely berserk, we significantly restrict its capabilities to only be able to answer questions related to the data found in our SQL database. To understand the process, it helps to create your custom chatbot, something you can do below. 

Fear of AI Is Superstitious Mumbo Jumbo

Featured Imgs 23

I just saw the Netflix movie called "Upgrade." It's a super fascinating movie, captivating and well written, but like every movie created around the same idea, it is based upon superstitious mumbo jumbo. Voodoo rubbish. The same garbage that has prevented us as a specie to evolve for 200,000 years.

As a species, our greatest asset is our greatest disadvantage. Roughly 70,000 years ago, we almost went extinct. However, one man had a genetic mutation, and we call this man "genetic Adam" today. 98% of every single human alive today originates from this single man somehow.

Disrupting the AI Scene With Open Source and Open Innovation

Featured Imgs 23

When I discovered OpenAI on the 23rd of December 2022, I became obsessed. I hadn't had this much fun coding since I started 40 years ago. After playing with "fine-tuning" for a month and miserably failing, I found a YouTube video by Dave Shapiro that explained how to create a Q&A chatbot using OpenAI's "embeddings" API.

Dave has since removed the video, but it explains how to use OpenAI's embeddings API and combine it with their chat/completion API to create a Q&A chatbot that knows "everything" about the problem domain. Tage's reaction best sums up my findings, as he told me one day.

How We Made Our ChatGPT Chatbot 10X Faster

Category Image 062

A ChatGPT-based website chatbot can dramatically reduce your website's performance. A decent chatbot needs to download reCAPTCHA. This is a heavy library, blocking rendering during downloads, significantly impacting the performance of your website. A slow website scores badly on SEO, something we published an article about last week. You should, therefore, carefully measure the performance of your website both before and after including a chatbot on your website, or you might be up for a surprise as you see organic clicks from Google drop like a stone in water because you wanted "a cool ChatGPT-based website chatbot on your site."

We just made some huge performance gains on our own chatbot technology. The way we did it was by deferring the loading of reCAPTCHA libraries until the chatbot is activated. Let's face it, your chatbot is amazing, but most people come to your site to see (duh!) your site and not your chatbot. Hence, loading reCAPTCHA before it's needed is a waste. reCAPTCHA is also an extremely poorly written JavaScript library, blocking DOM rendering for 3 to 4 seconds on phones. Yes, I know, the irony...

GPT3.5-Turbo Versus GPT4

Category Image 062

There are thousands of articles about the difference between ChatGPT version 3.5 versus version 4. However, we have a unique technology that allows you to embed ChatGPT on your website. This makes our requirements fairly unique. Hence, none of these existing comparisons really provide any value for us. We, therefore, decided to compare ChatGPT and its GPT3.5-turbo model against GPT4 in our chatbot to see the differences.

WARNING! GPT4 is 30 times more expensive than GPT3.5-turbo — so the quality and speed is not the only factor here. Unless you've got very deep pockets, you will obviously have to consider the price differences too.

Have ChatGPT Scrape Your Website

Category Image 062

AINRO.IO's ChatGPT website chatbot, AI Expert System, and AI Website Search are based on scraping your website. The technique is actually quite simple. However, how can we end up having so much higher quality than most others?

What we do is really simple. We scrape your website, and then we store your website's text as context snippets in a database. When users ask a question to our ChatGPT website chatbot, we use OpenAI's embedding API to look for the most relevant context snippets and attach this as a "context" to the question before we send the question to ChatGPT. This allows OpenAI to return an answer to your question using the supplied context as the foundation for the answer. Fundamentally you could argue the following.

How We Built a 1% Website in 3 Days for €7

Category Image 062

Due to events outside of our control, Aria, Tage, and I were forced into a situation where we had to launch a successful and profitable ChatGPT-based website chatbot company in two weeks. The stakes are super high, but we'll get there with some help from our friends.

Failure is not an option, though, so we're confident that we'll make it — especially considering all of our amazing friends who have been there for us these last days and supported us. Thank you, it means the world to us. The words "teamwork and friendship" have created meaning for us these last days in ways most people unfortunately never will experience during their lifetimes.

How To Create Your Own ChatGPT (Ish) In 5 Minutes

Category Image 062

Most developers are probably aware that OpenAI provides an API at this point. By intelligently using this API, you can actually “create your own ChatGPT chatbot.” Your own private ChatGPT that answers questions the way you want it to answer questions. To see an example of this, check out our ChatGPT chatbot. If you’re too lazy to click the link, there’s a screenshot below.

The basic idea is really simple. You point it at a website, our system scrapes your site, and you get your own custom ChatGPT version that knows everything about YOU and YOUR COMPANY and only speaks nicely about your services. Watch the video below to understand the process.

The Enterprise, the Database, the Problem, and the Solution

Featured Imgs 23

A friend of mine runs a company that has almost 100 clients. His company is delivering IT services to its clients, managing databases, servers, apps, etc. Some of his clients have 1,000 + employees and create hundreds of millions of database records each month. For most people, such numbers would result in data becoming completely opaque.

How do you manage hundreds of millions of database records, divided unto thousands of databases?

Scheduled Tasks With Hyperlambda and Retry

Featured Imgs 23

Scheduled tasks imply repeatedly executing some piece of code according to some interval. Adding retry implies retrying execution until it succeeds. Creating scheduled tasks with Hyperlambda is extremely easy. Making sure your tasks execute using retry logic is slightly more complex, but it's quite easy once you understand the flow of things, and you learn some basic Hyperlambda. To understand our code, we'll need to analyze some of the core Hyperlambda slots first.

Hyperlambda Is Async to the Bone

The above implies that Hyperlambda consumes tiny amounts of operating system resources while it's waiting for tasks. If you invoke [http.get] to retrieve some data from another server, the thread your Hyperlambda is scheduled to run on is actually suspended and released back to the operating system. This allows your operating system to "reuse" threads for different tasks, resulting in your app as a whole can accept a lot more throughput. Your app scales much better as a result.

Create your next Web API in SQL

Category Image 006

My CTO is a kick ass SQL guy, but he doesn't know much C#, so wrapping his SQL into a Web API is difficult for him. Every now and then he throws me some SQL statement or Stored Procedure in our Teams chat, and asks me to wrap it into an HTTP endpoint for him, because one of my colleagues needs it for our frontend parts. The process is almost the exact same every single time.

  • Wrap the SQL into an SqlQuery invocation using Entity Framework
  • Create some sort of view model matching the return from the Store Procedure
  • Choose which roles are allowed to access the endpoint
  • Parametrise the SQL invocation
  • Execute the SQL and return the content as my view model

Realising I could completely automate this process using Magic, providing high level UX components doing the entirety of the job, resulted in the following click button solution.