Design and deploy a RAG-based Q&A AI agent, integrated in WhatsApp

Overview
We partnered with a top Dutch real-estate firm to develop and deploy their first RAG-based Q&A AI agent. Utilising LangChain, an industry-standard framework, the agent features a modular design built around three pillars: AI agent, data sources, and user interface.
The ChallengE
AI systems are set to disrupt any market defined by large quantities of underutilised data and labour-intensive manual processes. The real estate sector is no exception. Recognising this, our partner sought to strategically leverage AI to better serve its members, enhance its existing assets and strengthen its market position.
Our Solution
We developed and delivered an AI agent that provides instant access to the organisation’s extensive knowledge base.
The agent streamlines information retrieval, enabling users to quickly find accurate answers to their queries by:
  • Understanding natural language
  • Efficiently searching the plethora of different data sources such as portal member pdfs, learning resources or property listing via API
  • Delivering precise answers with links to supporting sources
Key features:
  • User-friendly interaction using everyday language
  • Comprehensive analysis of the knowledge base
  • Accurate, trustworthy information
  • Efficient retrieval of relevant resources
Built in a modular manner, the agent’s design ensures a solid foundation for future iterations and adaptations to the solution, so that emerging challenges can be easily met.
RAG setup
Retrieval-augmented generation (RAG) is an architectural approach that enhances the efficacy of LLM applications by leveraging custom data. This is achieved by retrieving documents relevant to a query and providing them as context for the LLM.
RAG has proven effective in support chatbots and Q&A systems that require up-to-date information or domain-specific knowledge.
Our RAG setup includes:
  • Document Ingestion and Preprocessing: We begin by ingesting documents and their associated metadata, applying necessary preprocessing steps like text cleaning and formatting.
  • Chunking: Documents are divided into optimal chunks based on the chosen embedding model and downstream LLM application. This ensures efficient embedding generation and effective context retrieval.
  • Vector Embedding and Indexing: Each chunk is converted into a numerical vector representation using a pre-trained embedding model. These embeddings are then indexed within a high-performance vector search engine for rapid retrieval.
  • Context Retrieval and Prompt Augmentation: User queries trigger a search against the indexed embeddings, retrieving the most relevant document chunks. These chunks are then seamlessly integrated into the LLM prompt, providing crucial context for generating accurate responses.
  • LLM Application Development: We encapsulate the entire pipeline, from prompt augmentation to LLM interaction, within a robust endpoint. This allows for seamless integration of our RAG system into various applications and workflows.
This approach ensures accurate, context-aware responses while maintaining flexibility for various applications and workflows.
Benefits

Up-to-date Responses

Utilises current external data sources, not just static training data.

Reduced Hallucinations

Grounds LLM outputs in relevant external knowledge, minimising inaccuracies. Includes source citations for verification.

Domain-Specific Relevance

Tailors responses to an organisation’s proprietary or specialised data.

Efficiency and Cost-effectiveness

Simpler and more economical than other LLM customisation methods. Allows frequent updates without model retraining.

Our Approach
We adopted a rapid prototyping approach for the design and development of the Q&A agent. To do so, we relied on:
  • Continuous Integration and Continuous Deployment (CI/CD): Automated testing ensured code readiness for main branch integration.
  • Scalable Architecture Design: Cloud-based solutions with defined API contracts, notably between the Data Science and Engineering teams, enabled us to ensure parallel workflows and prevent development bottlenecks.
  • User-Centred Design: Ongoing user testing identified key challenges and opportunities for the agent’s iterations.
conclusion
We partnered with a leading Dutch real estate organisation to design and develop their first RAG-based AI agent using LangChain. This modular solution streamlines information retrieval from the their knowledge base, providing accurate, up-to-date answers. Tailored for real estate, it minimises inaccuracies and positions the organisation to leverage AI strategically, enhance member services and strengthen its market position.
FESTINA LENTE

Curious to learn more?

Reach out to us!