2
12 Comments

The new definition of tech stacks for AI startups

There are a lot of tech stack design decisions to make when you’re building a startup powered by AI. There are so many different pieces that come up together to build up a successful Saas. Now, I’m not talking about the kind of business that just connects a chat interface to the customer with OpenAI APIs 🙂. If you’re doing that, then you’re in Huge trouble and its time to think big 😎.

What technology can I possibly use other than the obvious OpenAI?

Let’s face it, if you are just making a simple app that connects your users to OpenAI, then you better sell it soon or just wait until your business gets ruined by 1000s of products just like your’s. To differ yourself, deciding on the correct tech stacks is vital and you need to decide the tech stack in the following categories:

Semantic Search🔍: this basically enables you to find relevant data that belongs to you and feed it to LLM. its like a database for your LLM. there are a lot of vector databases to pick from (Elasticsearch, Qdrant, Milvus, vespa.ai…). Here I’m going to describe the challenges we faced and why we used Elasticsearch

LLM (Brain of the product) 🧠: The AI itself that is able to answer a specific question or do a specific task as an agent. Believe it or not, OpenAI is not the only one out there 🙂. It might have been the first one with the breakthrough technology, but with the emerge of open source community, there are alternatives (Bard, Lamma, Falcon…)

Semantic Search
Semantic Search is the Long term memory of AI, I’m sure it has happened to you that most of the time OpenAI returns stupid responses, or there were times you wished that it actually answered the question based on your niche or the data of your product. Well that’s where vector databases come in. There are a tons of them to choose:

  • PineCone: Paid service, widely used among indie hackers because of its competitive Pricing, downside is that you have to pay a lot once the requests increase.
  • Weaviate: Paid service, Also used a lot among entrepreneurs, But again the downside is that once the requests increase, you have to pay a lot.
  • Qdrant: An Open Source project written in C. there’s actually a benchmark done in their blog comparing different databases. This is my second go to
  • Redis: Redis is known for its queue and high-throughput, But the team has implemented a vector search in Redis. The downside, everything is in memory with some query limitations.
  • Milvus: another open source project that has been there for a while and they actually implemented alot of features based on FAISS Index, A vector search library developed by Facebook. They have also integrations to store the vectors in S3
  • Elasticsearch: From ES 8.0 they have implemented KNN Features in Elasticsearch.

How We did it?

At URLSLAB we have implemented a lot of features using AI, LLMs and Semantic search. Implementing these features lead to creating a new project SemanticWrap (semantic search wrapped over Elasticsearch, I know the name is a little bit awkward). After experimenting with all the mentioned free solutions, there was one downside with all of them. You need to pay for a huge amount of memory to keep all the data in memory 😀. Memories are much much more expensive than Hard drives. On the other hand, most of the solutions out there (except ElasticSearch) don’t provide the ability for complex queries.

So why not Use Elasticsearch as a vector Database?

I wish it was that simple 😀. Here’s the deal, Elasticsearch’s speed in vector search decreases a lot with huge amounts of data. According to our Benchmarks, it took 9 seconds for 500K data (which is basically nothing).
Solution: Don’t reinvent the wheel, make it better 🛞
That’s why after one month of struggle, plan changes, not working software… Semantic Wrap was born powered by Elasticsearch. We were able to increase the performance of Elasticsearch (almost as fast as Pinecone) and maintain low consumption of Memory (the case where Other databases failed on). We’re going to open source the project to benefit the community also, but choosing the vector database depends on your needs, But I truly recommend Elasticsearch, if you have low amount of data, and for higher, well Semantic Wrap, stay tuned and I’ll let you know when we release

Is there really an alternative to OpenAI?

A thing that most of the people don’t know. Yeah 😀. Not Saying we are going to use it, but for sure this area is an untouched area up until the time of this writing. There are so many better open source alternatives than paid services like Open AI or Bard. The most famous of them are:

  • LLama
  • Falcon
    These are the most popular open source LLMs, So you can buy a server with GPU, spend some hours on setting it up there with an inference point and you’re good to go, the upside is that, you are paying a flat fee each month for the service whereas if you’re using OpenAI, You’ll be paying alot if you make a lot of requests. In Semanticwrap from the first days we built the system, so that it works well with different kinds of LLMs and different Embedding Models (that’s another topic too)

Did you even provide a tech stack honestly?
In AI era no one talks about which programming language to choose. Tech stacks are going to be more about which Embedding Model to choose or which vector store to choose or which LLM Model to use. And this is the field that has been untouched. So If your an indie hacker who’s looking for the next idea, then you might want to take a look at this field

Stay Tuned for more:
https://twitter.com/Yasha_br
https://www.urlslab.com

on June 9, 2023
  1. 2

    Problem with alternatives like LLaMA, Falcon, Mistral... is that they require strong devops and ML skills to deploy and maintain. Also, they are usually less accurate than GPT-3.5 or GPT-4, especially in non English languages...

    I use 2 very good OpenAI alternative APIs in my product:

    An interesting thing is that these platforms are not censored (which can be useful if you want to use AI to build adult chatbots for example).

    1. 1

      No, I'm using Elasticsearch. I built an application leveraging Elasticsearch as vector store and langchain. But that's not it. at first Elasticsearch was slow :).
      Had to implement some data analytics technique to make it work. But now I'm able to use semantic search and also leverage complex queries that ES is capable of :)
      planning to open source it soon though. haven't got much time to work on the documentation. I'm working 24/7 on URLsLab now :D

      1. 1

        Are you happy with Langchain? I had a try last year and I was under the impression that my project was more complex with Langchain than without...

      2. 1

        But how do you manage the data on Elasticsearch? How do you insert, edit, delete data?

        Is it manually with custom code?

        1. 1

          Yeah, its with custom code, From the service that I created, its possible to use any elasticsearch API that you need. Some use cases that I use in URLsLab are Bulk Deleting and updating. All the updates are done using ES painless scripts:
          https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-using.html

          1. 1

            Do you think it would be useful if you had a tool to convert & handle your data (whether from traditional db, documents, etc) to vectors and easily query it through an API?

            Or even just convert it to an external vector database (like Pinecone), and query it on your backend directly?

  2. 1

    Can I dm you? I think I got an interesting idea for an AI powered SaaS after a deep market research.

    1. 1

      Yeah sure. Your more than welcome to reach out in twitter

      1. 1

        Can you reach out to me on Discord? Vector#4461

        It doesn't allow me to write you on Twitter.

        1. 1

          sorry man, blocked that for some reason, now you should be able to DM though

          1. 1

            Just sent you a dm

Trending on Indie Hackers
Why Indie Founders Fail: The Uncomfortable Truths Beyond "Build in Public" User Avatar 138 comments Your AI Product Is Not A Real Business User Avatar 86 comments The Clarity Trap: Why “Pretty” Pages Kill Profits (And What To Do Instead) User Avatar 34 comments I built an enterprise AI chatbot platform solo — 6 microservices, 7 channels, and Claude Code as my co-developer User Avatar 28 comments I got let go, spent 18 months building a productivity app, and now I'm taking it to Kickstarter User Avatar 17 comments I went from 40 support tickets/month to 8 — by stopping the question before it was asked User Avatar 16 comments