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:
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:
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
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).
@YashaB do you use Pinecone?
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
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...
But how do you manage the data on Elasticsearch? How do you insert, edit, delete data?
Is it manually with custom code?
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
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?
Can I dm you? I think I got an interesting idea for an AI powered SaaS after a deep market research.
Yeah sure. Your more than welcome to reach out in twitter
Can you reach out to me on Discord? Vector#4461
It doesn't allow me to write you on Twitter.
sorry man, blocked that for some reason, now you should be able to DM though
Just sent you a dm