Hybrid AI Search 3 - The Full Tech Stack
Programming Language: TypeScript
There is no doubt that TS(JS) is already the first language for front-end development. The key is how to choose a back-end development language, With the help of AI, learning and using a language is not difficult, What matters is how to develop efficiently. To achieve efficient development, you need to be familiar with the common frameworks, compilation tools, testing tools, deployment tools, and deployment platforms of the corresponding programming languages. Although many problems are not difficult, they all take up our precious time. Our precious time should be spent on the most important things.
As a backend developer with 10 years of programming experience, who has deeply used C++, Java, Python, and Node, and has used Python to develop AI backend API for a year, I decided to use TS for backend development to keep the front-end and back-end languages consistent.
So you will find that the main language of the MemFree memfree project is TS.
AI Model: OpenAI + Anthropic + Google Gemini
OpenAI's GPT-4o, Anthropic's Claude 3.5 Sonnet, and Google's Gemini 1.5 Pro are currently the most advanced AI models, and we need to allow users to choose according to their own scenarios.
Unified API for AI Model: Vercel AI SDK
With the Vercel AI SDK, you can integrate an AI model with just a few lines of code, easily implement tool calls, and easily support image input.
TP DataBase: Upstash Redis
I have tried many databases, and the reason why I finally chose Upstash Redis is:
- Fast
- ServerLess
- Easy-to-Use
- Cost-Effective
Vector DataBase: LanceDB
I have tried many databases, and also built a vectorized search service based on Faiss index. the reason why I finally chose LanceDB is:
- High-Performance Column Store
- Native vector Support
- Native Lake Support
- Native Serverless
- Ease of Use and Maintenance
- Written in Rust and High Performance
Frontend Stack
- Next.js : The most popular open source React Framework
- React : The most popular open source JavaScript library for building user interfaces
- Shadcn-UI : The most popular reusable open source component libraries based on Radix UI and Tailwind CSS
- Tailwindcss : The most popular open source utility-first CSS framework
- Prettier : Code Formatter
- Stripe : The most popular and powerful payment method
- Contentlayer : The easiest way to build blogs and documentation for your website based on md or mdx files
- Next‑intl : An open source internationalization (i18n) library for Next.js applications, Deeply integrated with Next.js, easy to use and high performance
Why?
Because they are the most popular and powerful front-end frameworks, when you encounter problems, most of them can quickly find solutions. When you choose a framework, the ecosystem is the first thing you should consider, Even though AI can now help us solve most problems.
TS Runtime:Bun
I won't explain too much, I'll just say that if you haven't used bun yet, I highly recommend you spend a few minutes with it, which is super fast and easy to use.
Auth:Auth.js
- Powerful ecosystem, Integration of google, github, x, email, etc. can be completed in a few minutes
- You should own your users’ authentication data and should not put it in other people’s hands
Object Storage: Cloudflare R2 + AWS S3 Express
Cloudflare R2 is cheap but fast, AWS S3 Express is fast but expensive.
So if you want to store some images, files, you could use Cloudflare R2, if you want to store database files, you should use AWS S3 Express.
Recently, I'm trying uploadthing for temporary files and images in MemFree search. I'll update it in a month if I find uploadthing stable enough.
Search API: SearXNG + Serper + Exa
SearXNG is cheap but slow and need to slef-host, Serper is fast but expensive.
Exa is the most expensive. Currently, MemFree mainly uses Exa to support Twitter content search.
You could refer to MemFree Mixed use
Deploy Platform:Vercel + Fly.io
Why?
- Vercel has the arguably best support for nextjs
- For the reasons of choosing fly.io, you can refer to The Advantages of deploying Searxng on Fly.io
Email: Resend + React Email
- Resend : Developer-friendly, RESTful API, Batch Email Sending
- React Email: React Email is a great companion for writing emails when you use Resend to send emails.
Log System: Axiom
- Axiom : High performance and Cost-Effective
Web Analytics: Cloudflare Web Analytics
- Cloudflare Web Analytics : Free and easy-to-use