David Macias

6 results

Go from 0 to 1 to Enterprise-Ready with MongoDB Atlas and LLMs

Creating compelling, truly differentiated experiences for your customers from generative AI-enriched applications means grounding artificial intelligence in truth. That truth comes from your data, more specifically, your most up-to-date operational data. Whether you’re providing hyper-personalized experiences with advanced semantic search or producing user-prompted content and conversations, MongoDB Atlas unifies operational, analytical and vector search data services to streamline embedding the power of LLMs and transformer models into your apps. Everyday, developers are building the next groundbreaking, transformative generative AI powered application. Commercial and open source LLMs are advancing at breakneck speed. The frameworks and tools to build around them are plentiful and democratize innovation. And yet taking these applications from prototype to enterprise-ready is the chasm development teams must cross. First, these large models can provide incorrect or uninformed answers, because the data they have access to is dated. There are two options to solve uninformed answers - fine-tuning a large model or providing it with long-term memory. However, doing so begets a second barrier - deploying an application around an informed LLM with the right security controls in place, and at the scale and performance users expect. Developers need a data platform that has the data model flexibility to adapt to the constantly changing unstructured and structured data that informs large models without the hindrance of rigid schemas. While fine-tuning a model is an option, it’s a cost-prohibitive one in terms of time and computational resources. This means developers need to be able present data as context to large models as part of prompts. They need to give these generative models long-term memory. We discuss a few examples of how to do so with various LLMs and generative AI frameworks below. Five resources to get started with MongoDB Atlas and Large Language Models MongoDB Atlas makes it seamless to integrate leading generative AI services and systems such as the hyperscalers and open source LLMs and frameworks. By combining document and vector embedding data stores in one place via Atlas Database and Atlas Vector Search (preview), developers can accelerate building their generative AI-enriched applications that are grounded in the truth of operational data. Below are examples with how to work with popular LLM frameworks and MongoDB: 1. Get started with Atlas Vector Search (preview) and OpenAI for semantic search This tutorial walks you through the steps of performing semantic search on a sample movie dataset with MongoDB Atlas. First, you’ll set up an Atlas Trigger to make a call to an OpenAI API whenever a new document is inserted into your cluster, so as to convert it into a vector embedding. Then, you’ll perform a vector search query using Atlas Vector Search. There’s even a special bonus section for leveraging HuggingFace models. Read the tutorial . 2. Build a Gen AI-enriched chat app with your proprietary data using Llamalndex and MongoDB LlamaIndex provides a simple, flexible interface to connect LLMs with external data. This joint blog from LlamaIndex and MongoDB goes into more detail about why and how you might want to build your own chat app. The attached notebook in the blog provides a code walkthrough on how to query any PDF document using English language queries. Read the blog . 3. See the docs for how to use Atlas Vector Search (preview) as a vector store with LangChain As stated in the partnership announcement blog post, LangChain and MongoDB Atlas are a natural fit, and it’s been demonstrated by the organic community enthusiasm which has led to several integrations in LangChain for MongoDB. In addition to now supporting Atlas Vector Search as a Vector Store there is already support to utilize MongoDB as a chat log history. Read the docs: python , javascript . 4. Generate predictions directly in MongoDB Atlas with MindsDB AI Collections MindsDB is an open-source machine learning platform that brings automated machine learning to the database. In this blog you’ll generate predictions directly in Atlas with MindsDB AI Collections, giving you the ability to consume predictions as regular data, query these predictions, and accelerate development speed by simplifying deployment work-flows. Read the blog . 5. Integrate HuggingFace transformer models into MongoDB Atlas with Atlas Triggers HuggingFace is an AI community that makes it easy to build, train and deploy machine learning models. Leveraging Atlas Triggers alongside HuggingFace allows you to easily react to changes in operational data that provides long-term memory to your models. Learn how to set up Triggers to automatically predict the sentiment of new documents in your MongoDB database and add them as additional fields to your documents. See the GitHub Repo . Figure 1: The sample app architecture shows how external, or proprietary, data provides long-term memory to an LLM and how the data flows from a user's input to an LLM-powered response. From prototype to production with MongoDB for generative AI-enriched apps MongoDB’s developer data platform built on Atlas provides a modern, optimized developer experience while also being battle tested by thousands of enterprises globally to perform at scale and securely. Whether you are building the next big thing at a startup or enterprise, Atlas enables you to: Accelerate building your generative AI-enriched applications that are grounded in the truth of operational data. Simplify your app architecture by leveraging a single platform that allows them to store app and vector data in the same place, react to changes in source data with serverless functions, and search across multiple data modalities for improving relevance and accuracy in responses that their apps generate. Easily evolve your gen AI-enriched apps with the flexibility of the document model while maintaining a simple, elegant developer experience. Seamlessly integrate leading AI services and systems such as the hyperscalers and open source LLMs and frameworks to stay competitive in dynamic markets. Build gen AI-enriched applications on a high performance, highly scalable operational database that's had a decade of validation over a wide variety of AI use cases. While these examples are the building blocks for something more innovative, MongoDB can help you go from concept to production to scale. Get started today by signing up for MongoDB Atlas free tier and integrating with your preferred frameworks and LLMs. If you’re interested in working with us more closely, check out our MongoDB AI Innovators program , which enables Artificial Intelligence innovation and showcases cutting-edge solutions from startups, customers, and partners.

June 22, 2023

Visualize Blended Atlas and AWS S3 Data From Atlas Data Lake with MongoDB Charts

As of June 2022, the functionality previously known as Atlas Data Lake is now named Atlas Data Federation. Atlas Data Federation’s functionality is unchanged and you can learn more about it here . Atlas Data Lake will remain in the Atlas Platform, with newly introduced functionality that you can learn about here . We’re excited to announce that MongoDB Charts supports Atlas Data Lake as a data source! You can now use Charts to easily visualize data stored across different Atlas databases and AWS S3 buckets. Thanks to the aggregating power of Atlas Data Lake’s federated query, creating charts and graphs from blended application and cloud object data is simpler than ever before. On the surface this powerful integration is as simple as adding your Atlas Data Lake as a data source within Charts. However, it unlocks a deeper level of analysis while eliminating the need for creating an Extract-Transform-Load (ETL) process across your Atlas and S3 data. The integration provides the ability to visualize data from the following combination of sources without writing any code: Data from many Atlas databases or clusters, including multi-cloud clusters Cloud storage data from AWS S3 Blended Atlas and cloud storage (AWS S3) data Scenario: Finding insights from aggregated customer profile and contract data Let’s add a real world scenario of how this can enhance the analytics you derive from your data. While doing so, we will walk through the steps of setting up your Atlas Data Lake, adding it as a data source to Charts, and getting the most of your data with Charts’ powerful visualization capabilities. For context, let’s imagine we’re an analyst at a telecom company and we have contract data that is stored in MongoDB Atlas in different clusters and databases for each country we operate in - United States and Canada. Second, we have offloaded data from our Customer Relationship Management (CRM) tool as a parquet file into an AWS S3 bucket. All three datasets share a common “customerID” field. Configure Atlas Data Lake Because both “contracts” collections (or datasets) in MongoDB Atlas share the same fields, I simply mapped both into a single collection within the data lake. I mapped the customer profiles dataset into its own collection, since it only shares the “customerID” field. However, now that it’s in the same data lake, I will easily be able to join it to my contract data with a $lookup in my Charts aggregation pipeline or with a Lookup Field in the chart builder. (A $lookup in the MongoDB Query API is equivalent to a join in SQL.) Configure Charts data source I want to find insights from all contracts, both US and Canada in this scenario. Once I have created a single Atlas Data Lake collection (DL_contracts.allcontracts) from the two separate databases, I then need to add it as a data source in Charts. Simply click on “add data source” within Charts and add your data lake, and then choose the collections we want to use in the next step. For completeness I also added the two Atlas collections (US and Canada contracts) as data sources in Charts by following the same steps. Visualize data across multiple Atlas databases With Atlas Data Lake’s federated query capability, which effectively performs a union of data, I am able to build a column chart that shows the amount of all US and CA contracts in a single chart without writing any code. As you can see below, the chart shows both US and CA columns when connected to the data lake collection. When the data source is switched directly to either Atlas database, it only shows data for that respective database, or country in this example. Visualize blended data from Atlas and an AWS S3 bucket Lastly, let’s take our insights to the next level by visualizing data from multiple Atlas databases and a parquet file that’s stored in an AWS S3 bucket. Adding customer profile data that I offloaded from my CRM tool into S3 will enable me to find more robust insights. I could also visualize the data from the parquet file alone by connecting to that data lake collection. Since the contract data and customer profile data are in different collections within my Atlas Data Lake, I created a $lookup in the aggregation pipeline of the Charts data source. I then created a table chart from three different data sources with conditional formatting to quickly identify high value customers. The columns with blue boxes include contract data from both Atlas clusters, while the columns with orange boxes include customer profile data from a parquet file via AWS S3 bucket. Note, I could also aggregate the data in Atlas Data Lake and use $out to create a new collection of the data , and then connect Charts to the new collection as a data source. For the purposes of this blog, I wanted to highlight Charts-specific aggregation capabilities. We hope that you’re excited about the ability to easily visualize multiple data sources, from multiple Atlas databases to AWS S3 buckets in one place! Remember, if you haven’t used Charts before, you can get started for free by signing up for MongoDB Cloud , deploying an Atlas cluster and activating Charts. Try MongoDB Atlas for free today!

July 9, 2021

Dive Deeper into Chart Data with New Drill-Down Capability

With the latest release of MongoDB Charts, you’re now able to dive deeper into the data that’s aggregated in your visualizations. At a high level, we generally create charts, graphs and visualizations of our data to answer questions about our business or products. Oftentimes, we need to “double click” on those visualizations to get insight into each individual data point that makes up the line, bar, column, etc. How the drill-down functionality works: Step 1: Right click on the data point you are interested in drilling down into Step 2: Click "show data for this item" Step 3: View the data in tabular or document format Each view can be better for different circumstances. For data without too many fields or no nested arrays, it might be quicker and more easily viewed in a table. On the other hand, the JSON view allows you to explore the structure of documents and click into arrays. Scenarios where more detailed information can help: Data visualization use cases are relatively broad spanning, but oftentimes they fall into 3 main categories: monitoring data, finding insights, and embedding analytics into applications. I’ll be focusing on the first two of these three as there are many different ways you could potentially build drilling-down into data via embedded charts. (Read more about our click events and embedded analytics ). For data or performance monitoring purposes , we're not speaking so much about the performance of your actual database and its underlying infrastructure, but the performance of the application or system built on top of the database. Imagine I have an application or website that takes reviews, if I build a chart like the one below where I want to easily see when an interaction hits a threshold that I want to dive deeper into, I now have the ability to quickly see the document that created that data point. This chart shows app ratings given after a user session in an app. For this example, we want to dive into any rating that was below a 3 (out of 5). This scatter plot shows I have two such ratings that cross that threshold. With the drill-down capability, I can easily see all the details captured in that user session. For finding new insights, let’s imagine I’m tracking how many transactions happen on my ecommerce site over time. In the column chart below, you can see I have purchases by month for the last year and a half (note, there’s a gap because this example is for a seasonal business!). Just by glancing at the chart, I can quickly see purchases have increased over time, and my in-app purchases have increased my overall sales. However, I want to see more about the documents that were aggregated to create those columns, so I can quickly see details about the transaction amount and location without needing to create another chart or dashboard filter. In both examples, I was able to answer a deeper level question that the original chart couldn’t answer on it’s own. We hope this new feature helps you and your stakeholders get more out of MongoDB Charts, regardless if you’re new to it or have been visualizing your Atlas data with it for months, if not years! If you haven’t tried Charts yet, you can get started for free by signing up for a MongoDB Atlas and deploying a free tier cluster.

April 6, 2021

Add Interactivity to Your Embedded Analytics with Click Events

MongoDB Charts’ data visualizations can now become more interactive, so users and stakeholders can dive deeper into the insights they care more about. That’s possible with a new feature currently in preview with support for most Charts types: click events. A click event in the Charts embedding SDK is simply a notification that a user clicked on a chart. That click could be anything: They might have clicked on a bar in a bar chart, a chart’s legend, or even empty white space within the chart. Web developers can subscribe to these events and create different functionality depending on where the user clicked. Why might you want to enhance your app or embedded analytics workflow with click event data? Click-event data opens up a wide range of possibilities. Here are a couple of examples, inspired by various Charts users who’ve been telling us how they’d like to use click-event data. Open up another chart, based on a user clicking on data within a chart: A logistics company has a bar chart that shows pending orders at an aggregate level per region, and they want to see more detail on pending orders for a specific region. They create a click event handler in their application that opens up a new chart with pending orders per supplier, based on the region selected in the aggregate chart. Filtering the other charts on a dashboard when a series or data point on a single chart is clicked: A retail clothing company has a dashboard with various shopping cart information such as sales, orders processed, and returns, for their portfolio of products. The head of outerwear sales only wants to see data for the “outerwear” category of products, so they click on the “outerwear” series within a bar chart. The rest of the dashboard can adapt so that it shows only information relevant to outerwear. The example below is created from one of our sample data sets. We created two charts in a single app, tied to the sample movie data set that every Atlas user can access. On the left is a stacked bar chart with category level data that includes genre and decade. On the right is a table chart that shows each individual movie within a category. Clicking on a specific category in the bar chart updates the movies shown in the table chart. How can you get started with click events of embedded charts? If you haven’t yet used the embedding SDK for MongoDB Charts, you’ll want to familiarize yourself with the docs , consider watching this video tutorial , and access the SDK via the Charts GitHub repository . Regardless if you’re new to using the SDK or have experience with it, it’s important to note that you will need to use the @mongodb-js/charts-embed-dom@beta tagged version of the SDK to have access to the click events functionality while it’s in preview. There are two examples specifically for click events in the repository: click-events-basic and click-events-filtering . If you just want to explore and test out the functionality, you can play around with them in the following sandboxes using codesandbox.io: Click events basic sandbox Click events filtering sandbox Here’s a snapshot of the data surfaced in a click event that is available for developers to use in their apps. In this example I clicked on the yellow section of the top bar in the Movie Genres chart above. Note how it includes details of the click coordinates, the type and role of the clicked mark, and the corresponding chart data for the mark. { "chartId": "90a8fe84-dd27-4d53-a3fc-0e40392685dd", "event": { "type": "click", "altKey": false, "ctrlKey": false, "shiftKey": false, "metaKey": false, "offsetX": 383, "offsetY": 15, "clientX": 403, "clientY": 99, "pageX": 403, "pageY": 99, "screenX": 756, "screenY": 217 }, "data": { "y": { "label": "Genre", "value": "Drama" }, "x": { "label": "# Movies", "value": 3255 }, "color": { "label": "Decade", "value": "2010 - 2020", "lowerBound": 2010, "upperBound": 2020 } }, "target": { "type": "rect", "role": "mark", "fill": "#F0D175" }, "apiVersion": 1 } Whether you’re an avid user or new to MongoDB Charts, we hope you consider taking advantage of the new click event capability to increase the interactivity of Charts. It’s in preview because there is more functionality still to come. It has yet to be released for a few chart types: geospatial, table, top item, word cloud, and number charts. On that note, we’d love to hear your thoughts through the MongoDB Feedback Engine . If you haven’t tried Charts yet, you can get started for free by signing up for a MongoDB Atlas and deploying a free tier cluster.

January 20, 2021