Overview
Mavi Çatal is an AI chatbot with RAG (Retrieval-Augmented Generation) architecture designed to answer a restaurant's customer questions 24/7. Trained on the restaurant's menu, services, and operating hours, it answers customer questions solely from its own knowledge base — no hallucination.
RAG Pipeline
The RAG flow I built from scratch:
- Document preparation: Restaurant information collected in structured format
- Chunking: Long texts split into meaningful parts (overlapping sliding window)
- Embedding: Each chunk converted to a vector using OpenAI text-embedding-3-small
- Vector storage: Stored in PostgreSQL with pgvector
- Query rewriting: Preprocessing that normalizes the user's natural language with LLM
- Retrieval: Top-k most relevant chunks fetched via cosine similarity
- Context validation: Checking whether the retrieved chunks are truly relevant to the user's question
- Answer generation: Answer produced only from validated context
LangGraph Orchestration
All these steps were modeled as a state machine on LangGraph. Each node has a specific responsibility (rewrite, embed, retrieve, validate, generate), and the graph itself manages state transitions.
Why It Matters
This project became the foundation for the AI chatbot on my personal website. I generalized the RAG pipeline I built for Mavi Çatal and adapted it to Mahmoud.sy's chat bot. So the chatbot you're talking to right now while browsing this site also runs on the same architecture.