# AI Agent Overview

* **Pretraining**: We start with a state-of-the-art language model trained on billions of tokens across web and real-estate forums to build broad conversational fluency.<br>

* **Domain Fine-Tuning**: Next, we fine-tune on a curated corpus of real-estate dialogues—scripts, FAQs, and support transcripts—so the bot masters property terminology, market norms, and cultural nuances <br>

* **Intent & Entity Supervision**: A smaller BERT-based classifier is trained on 5,000+ labelled examples to recognise visitor intents (PriceInquiry, FeatureRequest, NextSteps) and extract key entities (names, addresses, dates, cultural keywords) with > 95% accuracy.<br>

* **Retrieval Augmentation:** We index your property database and local-market guides in a hybrid SQL + vector store. At runtime, the chatbot retrieves precise facts (availability, price, specs) or context-rich passages (neighbourhood insights) to ground its responses.&#x20;

* **Continuous Learning**: Every live conversation is logged (utterance, bot reply, lead rating). Quarterly, we retrain the intent classifier and fine-tune the response model on the highest-value transcripts to boost accuracy and relevance over time.

**Stage-by-Stage Breakdown**<br>

1. **Entity Extraction**\
   A transformer-based named-entity recogniser tags visitor names, property features, dates and cultural terms.<br>
2. **Intent Classification**\
   A fine-tuned BERT model classifies the visitor’s query into one of the predefined intents.<br>
3. **Knowledge-Base Retrieval**\
   A hybrid SQL + vector search returns exact facts or context passages matching the intent.<br>
4. **Response Generation**\
   A custom LLM assembles a prompt: combining system instructions, recent context and retrieved facts, then generates the reply.<br>
5. **Safety & Consistency Filtering**\
   Draft replies pass through fact-checks, brand-voice enforcement and policy filters to eliminate errors or off-brand language.<br>
6. **Context Update**\
   The final exchange is logged into session memory, so follow-ups remain grounded in the visitor’s journey, looping back to intent classification for the next input.
