Simple Villa Concierge - Project to be an AI Engineer
I have shipped AI features at Villa Finder - auto-generated reply drafts, villa highlight blurbs. Those two are just wrapper. I wanted to understand the full stack behind retrieval-augmented generation, so I built a villa concierge chatbot entirely from scratch.
The concierge helps users find villas by answering natural language questions like "beachfront villa with a private pool under $350" and returns matched recommendations with reasoning.
Tech stack
- Python FastAPI and StreamingResponse for SSE
- FAISS for vector search
- SentenceTransformer all-MiniLM-L6-v2 for embeddings
- SQLite for conversation history and keyword pre-filtering
- Using opencode.ai for LLM generation
- Vanilla JavaScript frontend, zero framework
What I learned
1. Python and FastAPI
I have used a small amount of Python in the past for ETL, so using it now again plus learning some FastAPI is easy for me. This is like refreshing a memory.
2. RAG
I was familiar with the explanation of RAG (Retrieval-Augmented Generation), I know the definition, but I haven't worked on it and in this project, I experienced it and all the explanation from internet "connects"
3. SentenceTransformer, Embedding and Vector Search
This one is new to me. SentenceTransformer is to change a text into a numerical vector that is called embedding, in this project case all of the villas information are turned into numerical vectors, thus making it possible to perform vector search.
4. FAISS
This is also new to me. FAISS is like database for the embeddings, after its stored in a file, it can be used for searching in vector spaces based on similarity. A search input, turn into a numerical vector, and then searched, it will find the most similar vectors, then return the matching results.
5. Conversations Context
I thought that giving context to the LLM was easy until I started implementing it. The non-deterministic nature of LLM responses made it challenging to maintain consistent and accurate conversations. Yes it is a 'prompt-issue'.
6. Prompt Engineering.
This is related to the context management. I have to refine the system prompt to better handle context and improve the quality of the LLM's responses.
7. Prompt Injection.
This is part of Prompt Engineering, so when user ask question or send an input, I check whether it contains any malicious prompts or its real question.
8. Intent Classification.
Also related to prompt engineering. after it checks the user input, I filtered it based on the intent and to which topic it belongs.
The live demo is running at:
villa-concierge.adhityoagam.com