Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

How to Make a RAG Application With LangChain4j

Retrieval-augmented generation, or RAG, introduces some serious capabilities to your large language models (LLMs). These applications can answer questions about your specific corpus of knowledge, while leveraging all the nuance and sophistication of a traditional LLM.

This tutorial will take you through the ins and outs of creating a Q&A chatbot using RAG. The application will:

  1. Retrieve data from a MongoDB Atlas database.
  2. Embed and store documents as vector embeddings.
  3. Use LangChain4j to query the database and augment LLM prompts with the retrieved data.
  4. Enable secure, scalable, and efficient AI-powered applications.

If you want to see the completed application, it is available in the GitHub repository.

Read More

Building a Real-Time AI Fraud Detection System with Spring Kafka and MongoDB

In this tutorial, we’ll build a real-time fraud detection system using MongoDB Atlas Vector Search, Apache Kafka, and AI-generated embeddings. We’ll demonstrate how MongoDB Atlas Vector Search can be used to detect anomalies in a stream of financial transactions by analyzing a user’s transaction history and identifying suspicious behavior based on LLM-generated embeddings.

Our solution will monitor MongoDB Change Streams using the Java synchronous driver, triggering vector searches on each new transaction to detect potential fraud. While this approach works well for our demo, and for many use cases, we’ll also discuss its limitations. Throughout the tutorial, I’ll cover alternative strategies to optimize performance, whether you need higher transaction throughput, faster fraud detection, or a more scalable architecture.

Read More