🧠 How I Built the AI Architect
I wanted to demonstrate how an AI assistant can be built without relying on a proprietary, closed-source AI API. Here is a look at the open, serverless AI architecture behind the "Ask AI Architect" feature.
Architecture Overview
DesignedByKirtida AI Architect
Visitor
↓
React / Next.js
↓
Cloudflare Worker
↓
┌─────────┴─────────┐
↓ ↓
Supabase Llama 3.2
+ pgvector 3B
↑
│
RAG retrieval
│
BGE embeddings
↓
Response
↓
Browser Speech APITechnology Stack
- Cloudflare Workers
- Llama 3.2 3B
- Supabase
- pgvector
- BGE Embeddings
- Web Speech API
- Next.js
Why this approach?
1. Open-Source LLMs (Llama 3.2)
Using Llama 3.2 gives maximum control over the model's behavior and system prompting. It removes the dependency on a single vendor and ensures the AI can be fine-tuned specifically for business discovery rather than generic conversational tasks.
2. Retrieval-Augmented Generation (RAG) with Supabase
Large Language Models don't inherently know about a specific business's pricing, portfolio, or technical preferences. By using Supabase with pgvector, the AI fetches verified case studies and capabilities to ground its answers, effectively reducing hallucinations.
3. Cloudflare Workers (Serverless Edge)
Deploying the inference pipeline on Cloudflare Workers guarantees minimal latency. The AI processes requests and accesses vector embeddings closer to the user, ensuring a fast, responsive chat experience without managing traditional servers.
4. Ambiguous Query Handling
An Intent Layer analyzes user input before querying the database. If a visitor types something broad like "website" or "ecommerce", the system intercepts it and asks clarifying questions instead of blindly dumping a 500-word brochure response.
Want a similar architecture for your business?
I help businesses build modern, fast, and scalable web platforms. Let's discuss how we can implement intelligent solutions for your specific needs.
Discuss Your Project