<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Michael Lynn on Medium]]></title>
        <description><![CDATA[Stories by Michael Lynn on Medium]]></description>
        <link>https://medium.com/@michael-lynn?source=rss-ca06e83644e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ISwx4m_KfWVUFvt6qykxGg.jpeg</url>
            <title>Stories by Michael Lynn on Medium</title>
            <link>https://medium.com/@michael-lynn?source=rss-ca06e83644e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:41:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@michael-lynn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Project Mapper Bridges the Gap Between Your Code and LLMs]]></title>
            <link>https://michael-lynn.medium.com/how-project-mapper-bridges-the-gap-between-your-code-and-llms-621ab4603d80?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/621ab4603d80</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 14:01:09 GMT</pubDate>
            <atom:updated>2025-03-12T14:57:30.194Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of my job as a Developer Advocate at MongoDB, I’m painfully aware of the challenges developers face today. With the volume and velocity, and complexity of projects, Large Language Models (LLMs) like ChatGPT, Claude, and GitHub Copilot have quickly become critical tools developers must depend on. I use some of these tools every day to assist with code writing, debugging, explaining complex systems, and even architecting solutions. However, if you’re like me… and you’ve tried using these tools for substantial work on an existing codebase, you’ve faced the ever-present and significant limitation: <em>context</em>.</p><h3>The Context Problem</h3><p>The tools I’ve mentioned and the LLMs upon which they depend have limits when it comes to their context window… the amount of text they can see and understand at one time. Despite many of the recent improvements that have expanded context windows, they still can’t ingest and fully understand entire large codebases, particularly for medium to large projects. When you attempt to work with an LLM on an existing project, you’ll run into these challenges:</p><ol><li><strong>Token limitations</strong>: Only a fraction of your codebase can be shared at once.</li><li><strong>Fragmented understanding</strong>: Sharing individual files without context results in a disjointed understanding.</li><li><strong>Missing relationships</strong>: Dependencies between components often get lost.</li><li><strong>Domain-specific terminology</strong>: Repeated explanations are needed for project-specific jargon.</li><li><strong>Project architecture</strong>: Conveying the big picture is difficult with just code snippets.</li></ol><p>So what ends up happening…? More time is spent explaining your project to the AI than receiving meaningful help. Your interactions become increasingly inefficient and frustrating and more often than not, lead you down rabbit holes that force you to spend time backing-out, git stash’ing as you repeatedly provide context that should be implicit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*cWlzbE2vFeJjp41aKpF09Q.png" /><figcaption>AI Project Mapper — Documentation</figcaption></figure><h3>Enter Project Mapper</h3><p>This is precisely the problem I am trying to solve with <a href="https://github.com/mrlynn/ai-project-mapper">Project Mapper</a>. Project Mapper is a CLI and a set of plugins that help you generate comprehensive summaries of your codebase. It aims to address the issues mentioned above by providing a structured overview of your project. It does this by scanning your project’s directory structure, identifying major components, inferring design patterns, recognizing terminology, and uncovering potential limitations. Project Mapper generates comprehensive, LLM-friendly summaries of your codebase. It then produces a “knowledge transfer document” that gives AI assistants a holistic view of your code.</p><pre># ai-project-mapper Project Knowledge Transfer<br><br>## Project Identification<br><br>**Name:** project-mapper<br><br>**Primary Purpose:** Generate LLM-friendly project summaries to help AI assistants understand your codebase<br><br>**Application Type:** Command-line interface (CLI) tool<br><br>**Problem It Solves:** Generate LLM-friendly project summaries to help AI assistants understand your codebase<br><br>## Architectural Overview<br><br>### Major Components<br><br>1. **Entry Point** - Main application entry point that initializes the system<br>   - Located in `src/index.js`<br>   - Responsibilities:<br>     - Initialize the application<br>     - Handle startup logic<br>     - Coordinate other components<br><br>2. **Docs Build Assets Js Module** - Handles docs/build/assets/js functionality<br>   - Located in `docs/build/assets/js`<br>   - Responsibilities:<br>     - Implement docs/build/assets/js features</pre><h3>How It Works</h3><p>Project Mapper works in one of several straightforward stages:</p><ol><li><strong>Analysis</strong>: It scans your project’s directory structure, languages, import/export relationships, functions, classes, entry points, and dependencies.</li><li><strong>Distillation</strong>: The tool identifies major components, infers design patterns, recognizes terminology, and uncovers potential limitations.</li><li><strong>Generation</strong>: Finally, it creates a structured knowledge transfer document optimized for LLM consumption.</li></ol><p>The result is a fairly concise yet comprehensive summary that fits within the token limits while providing crucial context about your project.</p><h3>Real-World Impact</h3><p>Let’s see how Project Mapper improves your workflow when using popular AI tools:</p><h3>Without Project Mapper</h3><pre>You: I need to add a feature to my project that processes new transaction types. <br>AI: I&#39;d be happy to help! Could you share details about your project and how transactions are currently processed? <br>You: *pastes a file* This is our main transaction processor. <br>AI: I see. What database are you using? How is validation handled? <br>You: *pastes another file* Here&#39;s our validation logic. <br>AI: And how does this integrate with the rest of your system? <br>You: *sighs and pastes more code*</pre><p>This back-and-forth continues, until you’ve consumed all of your time, and your available tokens…eating up your valuable time and the AI’s context window with explanations rather than solutions.</p><h3>With Project Mapper</h3><pre>You: *uploads project-knowledge-transfer.md* Based on this document, I need to add support for cryptocurrency transactions. <br>AI: Based on your project structure, I see that you have a TransactionService in `src/services/` handling transactions through the `processTransaction` method. <br> Transactions are validated in the `Transaction` model with the `isValid()` method. To add cryptocurrency support, you&#39;ll need to:<br>1. Update the `Transaction` model to include crypto-specific fields.<br>2. Extend the `isValid()` validation logic.<br>3. Add a new fee calculation method for crypto in `calculateFee()`.<br>4. Update the `TransactionController` to handle the new transaction type. Here&#39;s how you can implement each step…</pre><p>The difference is pretty much night and day. With Project Mapper, the AI can immediately understand your project’s structure, architecture, and patterns, providing contextual help without the endless back-and-forth.</p><h3>Integration with Popular Developer Tools</h3><p>Project Mapper enhances your experience with a wide array of AI development tools:</p><h3>Web-Based Assistants</h3><ul><li><strong>ChatGPT</strong> and <strong>Claude</strong> now understand your entire project through a single knowledge transfer document, which fits comfortably within their context windows.</li><li><strong>Perplexity</strong> can provide more accurate answers based on a clearer understanding of your project’s capabilities and limitations.</li></ul><h3>Developer-Focused Tools</h3><ul><li><strong>Cursor</strong> can offer more accurate code completions and suggestions when it has a complete understanding of your project.</li><li><strong>GitHub Copilot</strong> benefits from improved context when you’re working across multiple files or components.</li><li><strong>Anthropic’s Claude for VSCode</strong> can reference your project structure when offering assistance.</li></ul><h3>Beyond Efficiency: Opening New Possibilities</h3><p>The benefits of Project Mapper go beyond just saving time:</p><h3>Better QA</h3><p>Having a clear understanding of your project’s architecture, design patterns, and terminology, LLMs are more likely to suggest code that aligns with your existing structure and conventions rather than offering generic solutions.</p><h3>Knowledge Transfer for Human Teams</h3><p>The same knowledge transfer documents that assist LLMs also provide an invaluable resource for new team members, helping them get up to speed quickly by offering a high-level project overview that is often missing from traditional documentation.</p><h3>Architectural Insights</h3><p>Having an external system analyze and summarize your project can reveal patterns or architectural decisions you hadn’t fully articulated. Project Mapper offers a fresh perspective on your own project.</p><h3>Practical Tips for AI-Driven Development</h3><p>From my experience developing and using Project Mapper, here are a few best practices for integrating AI tools into your development process:</p><ol><li><strong>Generate fresh summaries after significant changes</strong> to keep the AI’s understanding current.</li><li><strong>Use the detailed template for complex projects</strong> with many components.</li><li><strong>Ask the AI to become an expert on your project</strong> before diving into specific questions.</li><li><strong>Reference specific sections</strong> from the knowledge transfer document in your questions.</li><li><strong>Combine Project Mapper with other context sources</strong> like architecture diagrams or business requirements.</li></ol><h3>Getting Started with Project Mapper</h3><p>Ready to give it a try? Installation is a breeze:</p><h3>Install globally</h3><pre>npm install -g project-mapper</pre><p>Or use it with npx without installing</p><pre>npx project-mapper</pre><p>Then, simply navigate to your project directory and run:</p><pre>project-mapper --help</pre><p>The tool can analyze your project and generate a `project-knowledge-transfer.md` file that you can share with any LLM.</p><h3>The Future of AI-Augmented Development</h3><p>Tools like Project Mapper highlight the future of AI-powered development… where the line between human developers and AI assistants becomes increasingly seamless. Rather than replacing developers, AI tools are becoming powerful extensions of our abilities… making developers more productive and capable of tackling complex problems… provided they have the right context.</p><p>As context windows expand and embedding techniques evolve, we’ll likely see even more advanced ways of providing LLMs with a comprehensive view of our projects. But one thing will remain clear: better context leads to better assistance.</p><h3>Conclusion</h3><p>If you’re a developer using AI tools, improving the AI’s understanding of your project is a game-changer. Project Mapper now provides another approach to solving the context problem, focusing on generating concise yet comprehensive knowledge transfer documents that make your codebase more accessible to LLMs.</p><p>Next time you’re stuck copy-pasting files into ChatGPT or repeatedly explaining your project structure to an AI assistant, remember: there’s a better way. Using the right tools, AI can grasp your project as a cohesive whole rather than a series of disconnected fragments.</p><p>What’s been your experience with using AI tools for development? Have you found other effective ways to provide context to your AI assistants? I’d love to hear your thoughts and experiences in the comments.</p><p><em>Michael Lynn is a software developer and AI enthusiast focused on creating tools that improve developer workflows. You can find more of his work on </em><a href="https://github.com/mrlynn"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=621ab4603d80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a RAG Helpdesk App in 10 minutes (or less)]]></title>
            <link>https://michael-lynn.medium.com/create-a-rag-helpdesk-app-in-10-minutes-or-less-96e0263e3f0f?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/96e0263e3f0f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Wed, 19 Feb 2025 17:59:14 GMT</pubDate>
            <atom:updated>2025-02-19T17:59:14.275Z</atom:updated>
            <content:encoded><![CDATA[<p>AI Chatbots are very popular… but how can you create a chatbot that provides real, high value content specific to the needs of your potential users? The technique is referred to as RAG, or Retrieval Augmented Generation.</p><p>Unlike traditional chatbots that only <strong>generate responses from pre-trained knowledge</strong>, RAG <strong>retrieves fresh and domain-specific information</strong>, making the chatbot:</p><p>✔ <strong>More accurate</strong> (less hallucinations).<br>✔ <strong>More relevant</strong> (tailored to a company’s data).<br>✔ <strong>More dynamic</strong> (updates without retraining the model).</p><p>By combining <strong>Retrieval + Generation</strong>, RAG empowers <strong>AI chatbots to provide real, high-value content</strong> that is <strong>grounded in authoritative data sources</strong>.</p><p>I’m going to show you how to get a <strong>RAG-enabled chatbot</strong> up and running in less than 10 minutes no painful setup, no endless configuration.</p><h4><strong>The secret?</strong></h4><p>A brand-new library designed specifically to take the pain out of building AI-powered chatbots: MongoDB-RAG.</p><h4><strong>Best part?</strong></h4><p>Minimal code. Maximum results. Minimal Time.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8PTATSNl1WU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8PTATSNl1WU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8PTATSNl1WU%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f1891d2e22ca935f58cf3619a4bb47e6/href">https://medium.com/media/f1891d2e22ca935f58cf3619a4bb47e6/href</a></iframe><p>Let’s dive in.</p><h3>What We’re Building</h3><p>In about <strong>10 minutes</strong>, you’ll have:</p><ul><li>A <strong>helpdesk chatbot</strong> that retrieves relevant support docs using <strong>MongoDB Atlas Vector Search</strong></li><li>A <strong>sleek, modern frontend</strong> with an easy-to-use search interface</li><li>A <strong>robust Express backend API</strong> for processing queries</li><li><strong>Automated document ingestion</strong> and vector embedding generation</li></ul><p>Here’s a sneak peek of what it’ll look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*Iy-g-z-OYqXEZS7UxtgSEg.png" /></figure><p>Let’s get started.</p><p>— -</p><h3>Prerequisites</h3><p>Before we jump in, you’ll need:</p><ul><li>Node.JS installed</li><li>A <strong>MongoDB Atlas account</strong> —<a href="https://mdb.link/rag-signup"> sign up for free</a></li><li>An <strong>OpenAI API key</strong> (for generating embeddings) — <a href="https://openai.com/index/openai-api/">Get your key here</a></li><li><strong>Basic familiarity</strong> with <strong>JavaScript &amp; Node.js</strong></li></ul><p>— -</p><h3>Step 1: Set Up MongoDB Atlas (3 Minutes)</h3><ol><li><strong>Create a Free Atlas Cluster</strong></li></ol><ul><li>Go to [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)</li><li>Click ”Create Cluster” → Choose <strong>FREE (M0) Tier</strong></li><li>Pick your **cloud provider &amp; region** → Click **”Create”**</li></ul><p>2. <strong>Configure Database Access</strong></p><ul><li>Under **Security &gt; Database Access**, create a **new user**</li><li>Set **read/write** permissions</li></ul><p>3. <strong>Allow Network Access</strong></p><ul><li>Go to <strong>Security &gt; Network Access</strong></li><li>Click ”Allow Access from Anywhere” (for dev purposes)</li></ul><p>4. <strong>Get Your Connection String</strong></p><ul><li>Click ”Connect” → Choose ”Connect Your Application”</li><li>Copy the <strong>MongoDB URI</strong> (you’ll need this soon)</li></ul><p>— -</p><h3>Step 2: Configure Your RAG Environment</h3><p>Run the setup command:</p><pre>npx mongodb-rag init</pre><p>This generates a <em>.mongodb-rag.json</em> config file:</p><pre>{ <br>  “mongoUrl”: “mongodb+srv://your_user:your_password@your-cluster.mongodb.net/mongorag”, <br>  “database”: <br>  “helpdesk”, <br>  “collection”: <br>  “articles”, <br>  “embedding”: {<br>     “provider”: “openai”, <br>      “apiKey”: “your-embedding-api-key”, <br>      “model”: “text-embedding-3-small”, <br>      “dimensions”: 1536 }, <br>      “search”: { “maxResults”: 5, “minScore”: 0.7 }, <br>      “indexName”: “vector_index”<br>  }<br>}</pre><p>Convert this to environment variables:</p><pre>npx mongodb-rag create-env</pre><p>Boom. Your <em>.env</em> file is ready.</p><p>— -</p><h3>Step 3: Create a Vector Search Index (1 Minute)</h3><p>Let’s index our data for <strong>semantic search</strong>. You have two options:</p><h4>Option 1: Use the CLI (Easy Mode)</h4><p>npx mongodb-rag create-index`</p><p>### 🛠 **Option 2: Use the MongoDB Atlas UI**</p><p>1. In **Atlas**, go to your database</p><p>2. Click **”Search” → “Create Index”**</p><p>3. Select **”Atlas Vector Search”**, then use this config:</p><pre>{ <br>  “name”: “vector_index”, <br>  “type”: “vectorSearch”, <br>  “definition”: { <br>    “fields”: [{ “type”: “vector”, <br>      “path”: “embedding”, <br>      “numDimensions”: 1536, <br>      “similarity”: “cosine” <br>    }] <br>  } <br>}`</pre><p>Either way, your **vector index is now live!** 🎉</p><p>— -</p><h3>Step 4: Deploy Your Helpdesk Chatbot</h3><p>Generate the full app:</p><pre>npx mongodb-rag create-rag-app my-helpdesk cd my-helpdesk</pre><p>Your project structure:</p><pre>my-helpdesk/ <br>  ├── frontend/ # React frontend <br>  ├── backend/ # Express backend <br>  └── package.json # Root config</pre><p>Install dependencies and run the servers:</p><pre>npm install npm run dev</pre><p>Your chatbot is now live at <a href="http://localhost:3000/">http://localhost:3000</a> 🎉</p><p>— -</p><h3>Step 5: Add Your Helpdesk Articles</h3><p>Create some <strong>Markdown helpdesk docs</strong> (or use your own existing FAQs).</p><p>Example:</p><p><strong>wifi-connection.md:</strong></p><pre>### Wi-Fi Connection Issues <br><br>**Issue:** My Wi-Fi isn’t working. <br><br>**Solution:** <br>  1. Restart your router <br>  2. Check if other devices can connect <br>  3. Forget &amp; reconnect to the network <br>  4. Contact your ISP if needed`</pre><p>Ingest them into MongoDB:</p><pre>npx mongodb-rag ingest — directory ./helpdesk-docs</pre><p>Done! Your chatbot now “knows” your helpdesk articles.</p><p>— -</p><h3>Step 6: Test Your Chatbot</h3><p>Try searching via CLI:</p><pre>npx mongodb-rag search “wifi not connecting” <br>npx mongodb-rag search “reset my password”</pre><p>Or hit the API:</p><pre>curl “http://localhost:4001/api/search?query=wifi not working”</pre><p>— -</p><h3>Troubleshooting</h3><h4>💡 No results?</h4><ul><li>Ensure your vector index is built</li><li>Check that embeddings match the **1536-dimension** OpenAI model</li></ul><h4>💡 Slow searches?</h4><ul><li>Verify your index is active</li><li>Optimize <strong>numCandidates</strong> &amp; <strong>similarity thresholds</strong></li></ul><p>— -</p><h3>Next Steps</h3><p>Take your chatbot further by:</p><ul><li>Adding **authentication**</li><li>Implementing **conversation history**</li><li>Supporting **file uploads (PDFs, CSVs, etc.)**</li><li>Fine-tuning **document chunking**</li></ul><h3>Want more?</h3><p>Check out:</p><ul><li><a href="https://mongodb-developer.github.io/mongodb-rag">MongoDB RAG Documentation</a></li><li><a href="https://github.com/mongodb-developer/mongodb-rag">MongoDB RAG GitHub Repo</a></li><li><a href="https://www.mongodb.com/docs/atlas/atlas-vector-search">MongoDB Vector Search</a></li></ul><p>— -</p><h3>Final Thoughts</h3><p>In under 10 minutes, we built a <strong>RAG-powered AI chatbot</strong> using <strong>MongoDB Atlas Vector Search</strong>.</p><p><strong>Try it out</strong> and let me know what you think!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e0263e3f0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Challenges of AI Development: From Prototype to Production]]></title>
            <link>https://michael-lynn.medium.com/navigating-the-challenges-of-ai-development-from-prototype-to-production-3fe260566d4d?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fe260566d4d</guid>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 16:21:13 GMT</pubDate>
            <atom:updated>2024-12-10T16:21:13.975Z</atom:updated>
            <content:encoded><![CDATA[<p>Creating AI solutions is undeniably one of the most thrilling things I get to do on a daily basis. The process of going from idea to prototype literally in a few hours produces an adrenaline surge like few other aspects of my job. Prototypes spark incredible excitement as they reveal the potential of intelligent, responsive systems. But turning those promising prototypes into production-ready applications? That’s where the real work begins. As someone who’s worked with startups and enterprises alike as a Developer Advocate, I’ve seen firsthand how this leap is often riddled with challenges. Beyond technical skill, success requires thoughtful strategies to handle complexity, ensure scalability, and optimize workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*H2rxthGABYK5-N1Zk5W6Jw.png" /><figcaption>From Prototype to Production with AI</figcaption></figure><p>Let’s break down the journey — from prototyping to production — and I’ll share insights from my experiences helping developers streamline their processes and overcome common pitfalls.</p><h3>Prototyping AI: A Double-Edged Sword of Innovation</h3><p>The prototyping phase is where innovation thrives. It’s exhilarating to watch developers test the limits of machine learning models, build intricate data pipelines, and explore cutting-edge AI features. In my role, I’ve had the privilege of diving into these prototypes, often marveling at the creativity and ambition developers bring to the table. Yet, I’ve also seen the recurring challenges that surface during this phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gOcWrEZxhM5hL0UA" /><figcaption>Photo by <a href="https://unsplash.com/@jccards?utm_source=medium&amp;utm_medium=referral">Marek Studzinski</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Let’s take a closer look at what prototyping involves, and where I’ve witnessed both success and struggle:</p><ul><li><strong>Experimenting with Machine Learning Models</strong><br>I’ve worked with teams exploring everything from basic regression models to complex neural networks. The trial-and-error process is essential, but it’s easy to lose focus without clear goals for what the prototype should prove.</li><li><strong>Building Data Pipelines</strong><br>I’ve seen startups piece together scrappy pipelines using whatever tools they can access quickly. While this flexibility is valuable, these pipelines often don’t scale well, creating headaches down the road.</li><li><strong>Tapping into AI Features</strong><br>Features like vector search or natural language processing can feel like magic in prototypes. I’ve helped teams evaluate these tools, ensuring they’re not just flashy but truly aligned with their end goals.</li><li><strong>Working Within Resource Constraints</strong><br>Many teams I’ve worked with operate on tight budgets and minimal infrastructure. This constraint forces creativity but can also lead to technical debt if the groundwork isn’t solid.</li></ul><p>Prototyping is incredibly rewarding, but it’s clear to me that the fragmented toolsets and resource constraints in this phase can create significant challenges when it’s time to scale.</p><h3>The Growing Pains of Scaling AI</h3><p>Transitioning AI prototypes into production is where the rubber meets the road. I’ve worked with developers facing a variety of hurdles during this transition, and while the specifics vary, the underlying challenges tend to be universal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2cxl4UgVh9gqTXcb" /><figcaption>Photo by <a href="https://unsplash.com/@sxoxm?utm_source=medium&amp;utm_medium=referral">Sven Mieke</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Here’s what I’ve observed most often:</h4><ol><li><strong>Toolchain Overload</strong><br>Many developers I’ve supported rely on a hodgepodge of tools — each chosen for a specific function during prototyping. One team I worked with used five different tools for storage, analytics, and search alone. Consolidating these tools into a unified, production-ready environment often felt like unraveling a tangled knot.</li><li><strong>Fragmented Data</strong><br>A common issue I’ve encountered is separating operational data from AI-specific data like vectors. This disconnect causes delays and makes real-time synchronization difficult. I recall helping one company integrate their AI pipeline with operational databases, cutting their data sync time in half.</li><li><strong>Operational Bottlenecks</strong><br>Managing multiple specialized tools adds overhead. A large enterprise I collaborated with had entire teams dedicated to maintaining infrastructure, slowing their pace of innovation. Simplifying their toolchain was a game-changer.</li><li><strong>Scalability Roadblocks</strong><br>I’ve seen this repeatedly — tools built for small-scale experimentation crumbling under the pressure of production workloads. One startup had to re-architect their entire system just to handle an influx of new users.</li></ol><p>These challenges reinforce the need for a streamlined, scalable approach — one that I emphasize whenever I mentor developers transitioning from prototype to production.</p><h3>A Platform Approach: Simplifying AI with MongoDB</h3><p>Having worked with a range of tools and platforms, I’ve found that MongoDB stands out as a solution that simplifies many of these challenges. I’ve had the opportunity to recommend and help developers implement MongoDB’s developer data platform, and the results speak for themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X6JhSmA_mhjZnkvc" /><figcaption>Photo by <a href="https://unsplash.com/@kalebnimz?utm_source=medium&amp;utm_medium=referral">Kaleb Nimz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here’s how I’ve seen it transform teams’ workflows:</p><ul><li><strong>Unified Data Storage</strong><br>I worked with a team building a recommendation engine. By consolidating their operational and AI-specific data into MongoDB, they eliminated a complex web of sync jobs and reduced latency, improving their app’s performance significantly.</li><li><strong>Built-in Vector Search</strong><br>I’ve seen developers light up when they realize MongoDB Atlas has native support for vector search. One project I supported was a search engine for e-commerce. By integrating MongoDB’s vector search, the team added AI-powered recommendations without needing additional infrastructure.</li><li><strong>Scalability by Design</strong><br>A global enterprise I collaborated with used MongoDB to scale from a pilot project to a production system serving millions of users. The platform’s scalability meant they could focus on adding features rather than worrying about infrastructure.</li><li><strong>Developer-Friendly Features</strong><br>The document model is a favorite among developers I’ve mentored. It’s intuitive and flexible, making it easy for teams to adapt MongoDB to their specific needs.</li></ul><h3>Best Practices for Scaling AI Solutions</h3><p>Over the years, I’ve distilled a set of best practices that I share with developers navigating the leap from prototype to production. These are lessons learned through hands-on experience, both my own and the teams I’ve supported:</p><ol><li><strong>Consolidate Your Tools</strong><br>I’ve seen teams succeed by simplifying their tech stack early. Platforms like MongoDB offer the flexibility to cover multiple use cases, reducing complexity and cost.</li><li><strong>Plan for Scalability Early</strong><br>I can’t count how many times I’ve heard, “We’ll think about scaling later.” Those who plan for growth from day one save themselves countless hours of rework.</li><li><strong>Optimize Your Data Architecture</strong><br>Keeping operational and AI data close is critical. I worked with one company that significantly improved query performance by centralizing their data in MongoDB.</li><li><strong>Learn from Experts</strong><br>Developer Advocates like me, along with technical consultants, can be invaluable. I’ve helped teams avoid common mistakes simply by sharing patterns I’ve seen work elsewhere.</li></ol><h3>From Idea to Impact: Unlocking AI’s Full Potential</h3><p>While prototyping is exciting, I’ve learned that the real magic happens in production. Seeing a system I’ve helped shape go live — whether it’s powering personalized shopping experiences or improving healthcare diagnostics — is incredibly fulfilling. Platforms like MongoDB make this transition smoother by unifying workflows and ensuring scalability.</p><p>So whether you’re working on a startup project or scaling within a large enterprise, I encourage you to simplify, streamline, and think long-term. The effort you invest in getting your architecture right today will pay dividends as your application grows.</p><h3>Let’s Share Experiences</h3><p>Scaling AI solutions is a shared journey. What challenges have you faced while moving from prototype to production? Let’s swap stories and insights in the comments — I’d love to hear how you’ve tackled this exciting yet complex process.</p><p><strong>Ready to simplify your AI journey?</strong> <a href="https://www.mongodb.com/">Explore MongoDB’s developer data platform</a> and see how it can power your next big leap.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fe260566d4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing a Global Risk Management Platform]]></title>
            <link>https://michael-lynn.medium.com/optimizing-a-global-risk-management-platform-1b1196cd00ae?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b1196cd00ae</guid>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Tue, 03 Dec 2024 13:55:05 GMT</pubDate>
            <atom:updated>2024-12-09T14:43:12.229Z</atom:updated>
            <content:encoded><![CDATA[<h4>A MongoDB Design Review Case Study</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*hvzStDqpjQ7QrCJnYw7YCQ.png" /></figure><p>As a Developer Advocate at MongoDB, I have one of the most amazing roles. I get to spend time with developers, diving deep into their applications, understanding their challenges, and helping them optimize for scale and performance. Conducting design reviews has got to be one of my favorite activities because this combines technical problem-solving with real-world impact. Each review is like solving a puzzle, where the pieces are performance requirements, data models, and scalability needs.</p><p>Recently, I had the opportunity to work with a global insurance company that was building a risk management platform. In the insurance industry, effectively managing and analyzing exposure data across global operations is critical for risk assessment and capital allocation. In this article, I’ll take you behind the scenes of our design review, exploring the technical challenges we uncovered and the solutions we crafted together to ensure the platform could scale to meet their ambitious goals.</p><h3>The application and use case</h3><p>The application serves as a centralized platform for managing insurance exposure data across multiple business segments. It aggregates data about insurable assets globally, enabling various teams to analyze risk factors and make informed decisions about underwriting and capital allocation.</p><h3>System architecture</h3><p>Below is a high-level overview of the system architecture:</p><figure><img alt="MongoDB Architecture Diagram" src="https://cdn-images-1.medium.com/max/742/0*Ebfp9e-zlcLbfZ8H" /></figure><h3>Key stakeholders include:</h3><ul><li>Underwriting teams analyzing global exposure across regions.</li><li>Catastrophe modeling teams assessing risks for large-scale events.</li><li>Pricing teams evaluating risk impacts on premiums.</li><li>Reinsurance teams determining optimal risk transfer strategies.</li></ul><h3>Problem statement and goals</h3><p>The platform was initially piloted for property segments but needed to scale to support additional business segments globally. Several technical challenges emerged:</p><ol><li><strong>Performance at scale:</strong> The system needed to handle millions of records while maintaining query performance.</li><li><strong>Document size management:</strong> A polymorphic data structure for various insurable assets risked exceeding document size limits.</li><li><strong>Complex search requirements:</strong> Advanced search capabilities were needed for geographic and risk-based queries.</li><li><strong>Global scalability:</strong> The system needed to efficiently serve users across multiple regions.</li></ol><h3>Current solution analysis</h3><p>The existing implementation used a polymorphic collection structure to store different types of insurable assets. While this approach provided flexibility, it presented challenges:</p><ul><li>Growing document sizes as coverage data expanded</li><li>Potential performance issues with complex queries across millions of records</li><li>Limited search capabilities for specialized queries</li></ul><h3>Technical recommendations</h3><h3>1. Data modeling optimizations</h3><h4>Subset pattern implementation</h4><p>We recommended implementing the subset pattern to address document size limitations and optimize query performance. This pattern separates frequently accessed current data from historical records:</p><p><strong>Main collection (current exposure data)</strong></p><pre>{<br>  _id: ObjectId(&quot;…&quot;),<br>  propertyId: &quot;P123&quot;,<br>  type: &quot;commercial&quot;,<br>  location: {<br>  type: &quot;Point&quot;,<br>  coordinates: [-73.9857, 40.7484]<br>},<br>  currentExposure: {<br>  coverage: 5000000,<br>  effectiveDate: ISODate(&quot;2024–01–01&quot;),<br>  riskFactors: {<br>  constructionType: &quot;steel&quot;,<br>  occupancyType: &quot;office&quot;,<br>  fireProtection: &quot;sprinklered&quot;<br>}<br>},<br>  lastUpdated: ISODate(&quot;2024–10–31&quot;),<br>  historicalDataRef: &quot;H789&quot; // Reference to historical collection<br>}</pre><p><strong>Historical collection</strong></p><pre>{<br>  _id: &quot;H789&quot;,<br>  propertyId: &quot;P123&quot;,<br>  exposureHistory: [<br>    {<br>      coverage: 4500000,<br>      effectiveDate: ISODate(&quot;2023–01–01&quot;),<br>      endDate: ISODate(&quot;2023–12–31&quot;),<br>      changeReason: &quot;annual_adjustment&quot;<br>    },<br>    {<br>      coverage: 4000000,<br>      effectiveDate: ISODate(&quot;2022–01–01&quot;),<br>      endDate: ISODate(&quot;2022–12–31&quot;),<br>      changeReason: &quot;property_improvement&quot;<br>    }<br>  ],<br>    retentionPolicy: {<br>    yearsToRetain: 7,<br>    regulatoryRequirement: &quot;SOX&quot;<br>  }<br>}</pre><p>This separation provides several key benefits:</p><ul><li>Reduces working set size by keeping only current data in the main collection</li><li>Improves query performance for common operations that only need current data</li><li>Enables efficient historical analysis without impacting current operations</li><li>Facilitates compliance with data retention requirements</li></ul><h4>Advanced polymorphic design</h4><p>To handle different types of insurable assets while maintaining query efficiency, we recommended a hybrid approach. The design separates base properties that are common across all asset types from specific properties that are unique to each asset type. This allows efficient storage and indexing of both shared and specialized fields.</p><p>However, it’s crucial to consider some potential downsides of the polymorphic approach:</p><ol><li><strong>Indexing efficiency</strong>: The polymorphic pattern requires separate indexes for fields specific to each asset type. This can create more complexity compared to the attribute pattern, where a single key-value array field can be indexed more uniformly. The attribute pattern allows for more efficient compound indexing across common fields, while sparse indexes in MongoDB can handle null or missing fields effectively. Therefore, the concern about sparse fields impacting performance is often overstated.</li><li><strong>Query performance</strong>: The polymorphic approach can lead to more complex queries that may need to use $or operations to handle different document shapes. This type of query cannot leverage indexes as effectively as the simpler queries enabled by the attribute pattern. The attribute pattern typically performs better for queries involving multiple asset types since it can utilize a single index scan, whereas polymorphic designs often require multiple scans or complex logic.</li><li><strong>Storage concerns</strong>: MongoDB’s storage engine is optimized for sparse documents, meaning that null fields do not consume significant space. The polymorphic approach, which involves different document structures for different asset types, can actually lead to more storage overhead due to repeated field names across varied document shapes.</li></ol><pre>{<br>  _id: ObjectId(&quot;…&quot;),<br>  baseProperties: {<br>  type: &quot;vehicle_fleet&quot;,<br>  region: &quot;EMEA&quot;,<br>  lastAssessment: ISODate(&quot;2024–09–15&quot;)<br>  },<br>    specificProperties: {<br>    fleetSize: 150,<br>    vehicleTypes: [&quot;commercial_truck&quot;, &quot;delivery_van&quot;],<br>    operationalAreas: [&quot;urban&quot;, &quot;highway&quot;]<br>  },<br>    riskMetrics: {<br>    aggregateValue: 7500000,<br>    riskScore: 3.2,<br>    primaryFactors: [&quot;fleet_age&quot;, &quot;route_exposure&quot;]<br>  }<br>}</pre><h3>2. Search and query optimization</h3><h4>Atlas Search implementation</h4><p>We recommended Atlas Search with custom analyzers and field mappings. Atlas Search provides significant advantages over conventional text search methods:</p><ul><li><strong>Enhanced capabilities:</strong> Atlas Search supports more sophisticated indexing, including full-text search, complex compound queries, and efficient geospatial queries in a single integrated solution. This makes it versatile for handling a mix of data types and searching needs.</li><li><strong>Performance efficiency:</strong> With custom analyzers and field mappings, Atlas Search allows for more targeted and efficient search capabilities, such as geospatial search and exact match filtering, which are more performant compared to standard text search.</li><li><strong>Integration with MongoDB:</strong> Atlas Search is built directly into MongoDB Atlas, eliminating the need to manage separate search infrastructure, such as Lucene/Elastic. This tight integration allows for easier implementation, simplified management, and reduced operational overhead.</li></ul><pre>{<br>  &quot;mappings&quot;: {<br>    &quot;dynamic&quot;: false,<br>    &quot;fields&quot;: {<br>      &quot;location&quot;: {<br>        &quot;type&quot;: &quot;geo&quot;,<br>        &quot;representation&quot;: &quot;geometry&quot;<br>      },<br>      &quot;riskFactors&quot;: {<br>        &quot;type&quot;: &quot;document&quot;,<br>        &quot;fields&quot;: {<br>        &quot;constructionType&quot;: {<br>          &quot;type&quot;: &quot;string&quot;,<br>          &quot;analyzer&quot;: &quot;standard&quot;<br>        },<br>        &quot;occupancyType&quot;: {<br>          &quot;type&quot;: &quot;string&quot;,<br>          &quot;analyzer&quot;: &quot;standard&quot;<br>        }<br>      }<br>    },<br>    &quot;currentExposure.coverage&quot;: {<br>      &quot;type&quot;: &quot;number&quot;,<br>      &quot;type&quot;: &quot;double&quot;<br>      }<br>    }<br>  }<br>}</pre><p>This configuration enables:</p><ul><li>Efficient geospatial queries for risk concentration analysis.</li><li>Full-text search across risk factors and property attributes.</li><li>Range queries on coverage amounts.</li><li>Compound queries combining multiple search criteria.</li></ul><h3>3. Indexing strategy</h3><h4>Query pattern analysis</h4><p>In this section, we analyze query performance leveraging some of MongoDB’s tools to identify slow or long-running queries. This is a critical part of understanding how well the system is handling workloads from the application and whether any queries need to be optimized.</p><p>Active operations</p><pre>db.currentOp({<br>&quot;active&quot;: true,<br>&quot;secs_running&quot;: { &quot;$gt&quot;: 1 }<br>});</pre><p>This command helps in identifying currently active operations that have been running for more than one second. It’s particularly useful for diagnosing real-time performance issues and understanding which queries might be holding up resources or causing bottlenecks.</p><p>Slow query profiling</p><pre>db.setProfilingLevel(1, { slowms: 100 });<br>db.system.profile.find(<br>  { &quot;millis&quot;: { &quot;$gt&quot;: 100 } },<br>  { &quot;ns&quot;: 1, &quot;query&quot;: 1, &quot;millis&quot;: 1 }<br>).sort({ &quot;millis&quot;: -1 });</pre><p>Here, we first set the profiling level to 1, which captures all queries that take longer than 100 milliseconds (slowms). The db.system.profile.find() query is then used to retrieve these slow queries, showing the namespace (ns), the query itself, and the execution time (millis). Sorting by millis in descending order allows us to quickly identify the most time-consuming queries. This analysis is vital for recognizing inefficient query patterns and areas where indexing might help.</p><h4>Index implementation</h4><pre>// Frequently accessed queries<br>db.properties.createIndex({ &quot;location&quot;: &quot;2dsphere&quot; })<br>db.properties.createIndex({ &quot;type&quot;: 1, &quot;currentExposure.coverage&quot;: 1 })<br>db.properties.createIndex({ &quot;lastUpdated&quot;: 1 })<br>// Compound indexes for complex queries<br>db.properties.createIndex({<br>  &quot;baseProperties.region&quot;: 1,<br>  &quot;riskMetrics.riskScore&quot;: -1,<br>  &quot;currentExposure.coverage&quot;: -1<br>})</pre><h3>4. Scalability solutions</h3><p>Due to the need for efficient data distribution and scalability, we recommended a sharding strategy. As the platform scaled from supporting a single property segment to multiple business segments globally, the volume of data grew exponentially. Sharding became a necessity to ensure that the platform could handle millions of records while providing consistent query performance.</p><ol><li><strong>Handling large data volume:</strong> The platform’s expansion required it to store and manage millions of records across different business segments. Sharding enabled the data to be distributed across multiple servers, thus reducing the load on any single server and preventing performance bottlenecks.</li><li><strong>Geographic distribution: </strong>The application had to serve users across multiple regions globally. By sharding based on fields like region and type, data could be distributed in a manner that allowed users to access information relevant to their location more efficiently. This minimized latency and improved the user experience, especially for region-specific queries.</li><li><strong>Write and read scalability: </strong>The platform experienced high write and read operations due to its real-time nature of managing insurance exposure data. Sharding helped distribute these operations evenly across multiple shards, ensuring that the write throughput was balanced and preventing any single shard from becoming a performance bottleneck.</li><li><strong>Zone sharding for compliance: </strong>The platform had regulatory and compliance requirements, which sometimes necessitated storing data in specific regions. With zone sharding, data could be stored in compliance with regional regulations while still being part of the larger, globally accessible system.</li></ol><h4>Sharding implementation</h4><figure><img alt="MongoDB Sharded Architecture Diagram" src="https://cdn-images-1.medium.com/max/770/0*t8EQHI3cdCvE6y3Q" /></figure><h4>Shard key selection</h4><pre>{<br>  &quot;baseProperties.region&quot;: 1,<br>  &quot;type&quot;: 1,<br>  &quot;_id&quot;: 1<br>}</pre><p>This sharding strategy provides:</p><ul><li>Natural data distribution across regions.</li><li>Efficient targeting of queries to specific shards.</li><li>Support for zone sharding based on geographic regions.</li><li>Balanced write distribution.</li></ul><h4>Performance optimization techniques</h4><p><strong>Batch processing</strong></p><p>The company needed to account for batch processing to efficiently handle large volumes of updates and ensure that the system could keep up with the constant stream of incoming changes. Given the nature of the risk management platform, updates to insurance exposure data were frequent, involving large datasets. Batch processing allows for these updates to be grouped and executed in bulk, which significantly reduces the number of individual write operations and minimizes system load.</p><pre>const batchSize = 1000;<br>const updateQueue = [];<br>async function processBatchUpdates(updates) {<br>  for (let i = 0; i &lt; updates.length; i += batchSize) {<br>    const batch = updates.slice(i, i + batchSize);<br>    await collection.bulkWrite(batch, { ordered: false });<br>    await sleep(100); // Prevent overwhelming the system<br>  }<br>}</pre><p><strong>Read optimization</strong></p><pre>// Analytics queries<br>const analyticsClient = client.with({<br>  readPreference: &#39;secondary&#39;,<br>  readConcern: { level: &#39;local&#39; }<br>});<br>// Real-time queries<br>const realtimeClient = client.with({<br>  readPreference: &#39;primary&#39;,<br>  readConcern: { level: &#39;majority&#39; }<br>});</pre><h3>Expected benefits</h3><p>Given these suggestions and recommendations, we’ll likely enjoy benefits associated with immediate performance improvements but also in the overall resilience and stability of the database implementation.</p><h3>Improved performance</h3><ul><li>Faster query response times</li><li>Efficient handling of large document sets</li><li>Optimized memory usage</li></ul><h3>Enhanced scalability</h3><ul><li>Support for global expansion</li><li>Efficient resource utilization</li><li>Better handling of traffic spikes</li></ul><h3>Better search capabilities</h3><ul><li>More flexible query options</li><li>Improved geospatial search</li><li>Better support for complex risk assessments</li></ul><h3>Next steps and implementation guidance</h3><h3>Performance testing</h3><ul><li>Implement comprehensive test harness</li><li>Simulate realistic data volumes and access patterns</li><li>Validate indexing and sharding strategies</li></ul><h3>Phased implementation</h3><ul><li>Start with subset pattern implementation</li><li>Gradually introduce additional optimization patterns</li><li>Monitor and tune performance metrics</li></ul><h3>Monitoring and optimization</h3><ul><li>Set up comprehensive monitoring</li><li>Establish performance baselines</li><li>Regularly review and optimize indexes</li></ul><h3>Conclusion</h3><p>Looking back at this design review, I’m reminded of why I love being a Developer Advocate at MongoDB. It’s not just about suggesting technical solutions — it’s about partnering with development teams to solve real-world challenges that impact their business. This particular project stands out because it demonstrates how the right combination of data modeling patterns and MongoDB features can transform a complex business requirement into an elegant, scalable solution.</p><p>What makes this case study particularly exciting is how we evolved from addressing immediate performance concerns to building a foundation for global scale. Through our collaborative sessions with the insurance company’s engineering team, we didn’t just solve technical problems — we helped them reimagine what their risk management platform could achieve.</p><p>The most rewarding part? Seeing how our recommendations around subset patterns, search optimization, and sharding strategies came together to support their ambitious growth plans. It’s one thing to know these patterns in theory, but watching them solve real-world challenges at scale is truly satisfying. For other teams facing similar challenges with global platforms, remember that scaling isn’t just about handling more data or users. It’s about thoughtful design decisions that balance immediate needs with future growth. Sometimes that means making tough choices between flexibility and performance, or between simplicity and sophistication. But with MongoDB’s rich feature set and the right architectural patterns, you can build systems that don’t just scale — they thrive.</p><p>I’d love to hear about your experiences with similar challenges. Have you implemented any of these patterns in your applications? What lessons did you learn along the way? Connect with me on <a href="https://linkedin.com/in/mlynn">LinkedIn</a> or <a href="https://x.com/mlynn">Twitter</a> to continue the conversation, or join us in the <a href="https://www.mongodb.com/community/forums/">MongoDB Developer Community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b1196cd00ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAG chunking lifecycle: How document chunking strategies impact AI response quality]]></title>
            <link>https://michael-lynn.medium.com/rag-chunking-lifecycle-how-document-chunking-strategies-impact-ai-response-quality-2da4fb2a1c12?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2da4fb2a1c12</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Sun, 07 Apr 2024 00:00:01 GMT</pubDate>
            <atom:updated>2025-04-25T15:46:59.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_G4pV7PC8AtPjcmQXwvEzQ.png" /></figure><h3>Introduction</h3><p>Retrieval Augmented Generation (RAG) is not a new concept. You’re likely aware of this strategy for building smarter, more personalized AI systems… ones the can pull in external knowledge instead of hallucinating facts or coming up with inaccurate or irrelevant information. And while most of the buzz around AI centers around fancy embedding models and powerful LLMs, there’s one surprisingly underrated component that can make or break your AI-enabled system: how you chunk your documents.</p><p>In this post, we’ll take a closer look at the full RAG chunking lifecycle — from slicing up documents to generating a final response — and show how thoughtful chunking can dramatically improve AI output quality.</p><p>In an effort to illuminate the importance of chunking strategies while preparing to deliver a RAG workshop at MongoDB Developer Day in Atlanta recently, I had some time overnight to think… and when I think deeply, it usually involves building something. That resulted in this: <a href="https://rag-chunk-explainer.vercel.app/">The RAG Chunk Explainer</a>. The explainer app enables you to test various chunking strategies and view the impact on performance for a simple HR Policy use case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6ro7kd7bGDVjt6U8Skn_pQ.png" /><figcaption>RAG Pipline Demo — <a href="https://rag-chunk-explainer.vercel.app/">https://rag-chunk-explainer.vercel.app/</a></figcaption></figure><h3>Back it up…</h3><p>Let’s review some basics about RAG before getting into chunking. RAG brings together two superpowers: large language models and external knowledge retrieval. Instead of relying only on what the model knows from its parametric knowledge, a RAG system actively looks things up in a knowledge base and feeds the relevant context into the model to generate a response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bJB4no8Vp9eUmv-N.png" /></figure><p>Here’s how the RAG pipeline generally flows:</p><ul><li><strong>Chunking</strong> — Break documents into smaller, useful pieces</li><li><strong>Embedding</strong> — Turn those chunks into vector representations</li><li><strong>Retrieval</strong> — Find the chunks most relevant to a given query</li><li><strong>Generation</strong> — Craft a response using the retrieved chunks</li></ul><p>It’s simple in theory. However, in practice, I’ve learned that there are several critical decisions you need to make which can impact the effectiveness of your RAG app greatly. Obviously, Model choice has a significant impact, but let’s focus on chunking.</p><h3>Why chunking matters</h3><p>Every step in the pipeline plays a role, but chunking is the one that quietly influences everything downstream. Done right, you get great relevance and performance. Done wrong, and you’re left with vague, irrelevant, or just plain confusing answers.</p><p>Why chunking is critical:</p><ul><li>LLMs have relatively short attention spans (aka token limits)</li><li>Better chunks = better retrieval (semantic matching thrives on coherence)</li><li>Messy chunks = lost meaning</li><li>Efficient chunks = faster, smarter systems</li></ul><h3>The RAG chunking lifecycle</h3><p>Let’s break down the lifecycle and walk through each phase.</p><h4>Stage 1: Document chunking</h4><p>This is where it all begins… taking raw documents and breaking them into smaller, distinct… well, chunks. Your strategy here has ripple effects all the way down the line. Although I don’t think it’s optional, I’ll talk a bit about the pros and cons of chunking:</p><ul><li><em>Pros:</em> Keeps related ideas together. Especially if you leverage a semantic break strategy.</li><li><em>Cons:</em> Requires deeper processing (LLM-based or embedding-based)</li></ul><p>While rolling your own chunking logic gives you fine-grained control, you don’t have to start from scratch and build a chunking capability from scratch. There are several popular frameworks and libraries that can help you develop faster and handle more complex use cases:</p><ul><li><strong>LangChain</strong> — Comes with RecursiveCharacterTextSplitter, TokenTextSplitter, and more. Easy to use, production-tested.</li><li><strong>LlamaIndex</strong> — Offers advanced semantic chunking with SemanticSplitterNodeParser using LLMs.</li><li><strong>Unstructured.io</strong> — Great for extracting content from real-world formats (PDFs, HTML, DOCX) into clean, structured chunks.</li><li><strong>spaCy / NLTK</strong> — Traditional NLP tools for sentence/paragraph/token splitting. Still great for rule-based chunking.</li></ul><p>I recommend leveraging a strategy that makes use of an LLM to help you semantically break your content. LLM-based chunking can:</p><ul><li>Interpret the text’s meaning.</li><li>Segment based on conceptual breaks (not just formatting.)</li><li>Preserve context that traditional delimeter or length-based methods might split apart.</li></ul><p>Common approaches include:</p><ul><li>Prompting an LLM to segment content</li><li>Using embeddings and clustering</li><li>Using paragraph boundaries as a proxy (still common in practice)</li></ul><p>In production RAG pipelines, teams often start with simple heuristics (like paragraph breaks) and evolve toward semantic LLM-powered methods as they scale and tune for quality.</p><h4>Stage 2: Vector embedding</h4><p>Each chunk gets turned into a high-dimensional vector… basically a mathematical fingerprint or representation of the semantic meaning of the text. Tools like OpenAI’s embedding models, e.g.text-embedding-3-small take care of this. Keep these things in mind when constructing your vector embedding strategy:</p><ul><li><strong>Model quality</strong> — Better models = better representations</li><li><strong>Dimensions</strong> — More dimensions can mean richer context, but also more storage</li><li><strong>Garbage in, garbage out</strong> — Better chunks yield better vectors</li></ul><h4>Stage 3: Vector retrieval</h4><p>When the user asks a question, the question is vectorized and compared to stored embeddings to find the closest semantic matches. This is where <a href="https://mdb.link/mlynn-atlas-vector-search">MongoDB Atlas Vector Search</a> comes in — with fast, efficient similarity search. To leverage Atlas Vector Search, you’ll need an Atlas account, you can start for free. You’ll need to create a database, collection, and define a vector search index. You can create one from the Atlas web console, or define an index in code.</p><pre>const { MongoClient } = require(&quot;mongodb&quot;);<br><br>// connect to your Atlas deployment<br>const uri =  &quot;&lt;connectionString&gt;&quot;;<br><br>const client = new MongoClient(uri);<br><br>async function run() {<br>   try {<br>     const database = client.db(&quot;sample_mflix&quot;);<br>     const collection = database.collection(&quot;embedded_movies&quot;);<br>    <br>     // define your Atlas Vector Search index<br>     const index = {<br>         name: &quot;vector_index&quot;,<br>         type: &quot;vectorSearch&quot;,<br>         definition: {<br>           &quot;fields&quot;: [<br>             {<br>               &quot;type&quot;: &quot;vector&quot;,<br>               &quot;numDimensions&quot;: 1536,<br>               &quot;path&quot;: &quot;plot_embedding&quot;,<br>               &quot;similarity&quot;: &quot;dotProduct&quot;,<br>               &quot;quantization&quot;: &quot;scalar&quot;<br>             }<br>           ]<br>         }<br>     }<br><br>     // run the helper method<br>     const result = await collection.createSearchIndex(index);<br>     console.log(`New search index named ${result} is building.`);<br><br>     // wait for the index to be ready to query<br>     console.log(&quot;Polling to check if the index is ready. This may take up to a minute.&quot;)<br>     let isQueryable = false;<br>     while (!isQueryable) {<br>       const cursor = collection.listSearchIndexes();<br>       for await (const index of cursor) {<br>         if (index.name === result) {<br>           if (index.queryable) {<br>             console.log(`${result} is ready for querying.`);<br>             isQueryable = true;<br>           } else {<br>             await new Promise(resolve =&gt; setTimeout(resolve, 5000));<br>           }<br>         }<br>       }<br>     }<br>   } finally {<br>     await client.close();<br>   }<br>}<br>run().catch(console.dir);</pre><p>Once you’ve created an index, loaded some documents, and created embeddings for those documents, you’re ready to test Vector Retrieval. This involves encoding the user query using the same embedding model you used to generate embeddings for your documents. What you’ll get back is a set of documents that are semantically related to the user query. These documents are then passed to the LLM as context to answer the user question.</p><h4>Stage 4: Response generation</h4><p>Retrieved chunks/documents are compiled into a prompt for the LLM. The better the context, the better the final output.</p><ul><li><strong>Prompt formatting</strong> — Structure the context clearly</li><li><strong>Explicit instructions</strong> — Tell the model what you want</li><li><strong>Source tracking</strong> — Keep receipts if citations matter</li><li><strong>Output clarity</strong> — Format for readability</li></ul><h3>Chunking in action: demo time</h3><p>To test how chunking impacts output, let’s use our RAG Chunking Explainer App. To simplify things, I’ve handled creating the original set of documents and I let you choose one of several chunking strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*spKivDPiO2QLBWn4G1s5cw.gif" /><figcaption>Demo of Various Chunking Strategies</figcaption></figure><p>Once, you’ve selected a strategy, you can view the embedding in Step 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*aR29ZtfRHS-fFeU8cOtCgQ.png" /><figcaption>Condensed, Vector Space Demonstration</figcaption></figure><p>Keep in mind, the 2d vector space representation in the app is largely fictional but will give you an idea about the process of semantic coordinate similarity. Next, it’s on to Retrieval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irxNZ4VPA3KKpKbyAJBCfA.gif" /></figure><p><strong>Example Query:</strong> “What is our time-off policy?”</p><ul><li><strong>Fixed-size chunking (200 characters):</strong> Retrieved time-off mentions, but missed policy context. Accurate, but not complete.</li><li><strong>Semantic chunking:</strong> Nailed it. Retrieved the full policy section with all relevant details. The response was rich and clear.</li></ul><p>Moral of the story? Chunking isn’t just setup… it directly shapes your results and therefore, the quality of your application.</p><p>Last stop, Generation. This enables us to test, end-to-end, the user query, and generation of response based on the configuration of our chunking strategy in the previous tabs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3opgZKwPeB2hCn3qsuI3g.gif" /></figure><h3>Best practices for chunking</h3><p>Here’s what we’ve learned works well:</p><ol><li>Start with structure — Understand your document layout</li><li>Preserve meaning — Don’t split mid-thought</li><li>Test chunk sizes — One size rarely fits all</li><li>Overlap chunks — Helps preserve context across boundaries</li><li>Tag everything — Metadata improves filtering and relevance</li><li>Use hierarchy — Nested chunking for structured content</li><li>Monitor &amp; refine — Let real results guide improvements</li></ol><h3>Conclusion</h3><p>Chunking may not be glamorous, but it’s essential. It’s the quiet force behind high-quality retrieval and generation in RAG systems. Choose wisely, experiment often, and monitor results.</p><p>Want to explore this further? <a href="https://rag-chunk-explainer.vercel.app/">Check out the interactive demo</a> and experiment with different strategies.</p><h3>Additional resources</h3><ul><li><a href="https://mdb.link/mlynn-atlas-vector-search">MongoDB Atlas Vector Search Quickstart</a></li><li><a href="https://github.com/mrlynn/ai-rag-chunking-explainer">GitHub Repo for the RAG Chunk Explainer App</a></li></ul><p><em>Originally published at </em><a href="https://www.mlynn.org/blog/rag-chunking-lifecycle"><em>https://www.mlynn.org</em></a><em> on April 7, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2da4fb2a1c12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Move a muscle, change a thought, change the world.]]></title>
            <link>https://michael-lynn.medium.com/move-a-muscle-change-a-thought-change-the-world-e862714443e?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e862714443e</guid>
            <category><![CDATA[hunger]]></category>
            <category><![CDATA[food-insecurity]]></category>
            <category><![CDATA[charity]]></category>
            <category><![CDATA[change]]></category>
            <category><![CDATA[giving]]></category>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Mon, 28 Dec 2020 15:54:08 GMT</pubDate>
            <atom:updated>2020-12-28T15:54:08.537Z</atom:updated>
            <content:encoded><![CDATA[<p>I once heard a great quote and I don’t know who is responsible for it. The quote goes something like this: God can move mountains, but you better bring a shovel.</p><figure><img alt="&lt;span&gt;Photo by &lt;a href=”https://unsplash.com/@go_pol?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyTe" src="https://cdn-images-1.medium.com/max/975/1*LK9f_fCN_rd0ffhiYqmK_A.jpeg" /><figcaption>Want to move a mountain? God can help but you’d better bring a shovel.</figcaption></figure><p>Photo by <a href="https://unsplash.com/@go_pol?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">gokhan polat</a> on <a href="https://unsplash.com/s/photos/shovel?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p><p>What this quote means to me is that belief in and reliance upon a higher power is essential, but as human beings, we must exercise our will to act. It also means that I can’t just think about things in order to make them happen. I must envision the outcome and get into action in order to effect change.</p><p>I recently took on a challenge to impact hunger by starting a food drive. The experience was so moving that I thought I’d share it with you in the hope that it may inspire you to do something similar.</p><h3>The Problem</h3><p>First, some hard facts (source <a href="https://www.feedingamerica.org/">https://www.feedingamerica.org/</a>)</p><p>Millions of children and families living in America face hunger and food insecurity every day.</p><ul><li>Due to the effects of the coronavirus pandemic, <a href="https://www.feedingamerica.org/research/coronavirus-hunger-research">more than 50 million people may experience food insecurity</a> in 2020, including a potential 17 million children.</li><li>According to the USDA’s latest <em>Household Food Insecurity in the United States</em> report, more than 35 million people in the United States struggled with hunger in 2019.</li><li>In 2018, 14.3 million American households were <a href="https://www.feedingamerica.org/hunger-in-america/food-insecurity">food insecure</a> with limited or uncertain access to enough food.</li><li>Households with children are more likely to experience food insecurity. Before the coronavirus pandemic, more than 10 million children live in food-insecure households.</li><li><a href="https://map.feedingamerica.org/">Every community in the country</a> is home to families who struggle with food insecurity including <a href="https://www.feedingamerica.org/hunger-in-america/rural-hunger-facts">rural</a> and suburban communities.</li><li>Many households that experience food insecurity do not qualify for <a href="https://www.feedingamerica.org/take-action/advocate/federal-hunger-relief-programs">federal nutrition programs</a> and need to rely on their local food banks and other hunger relief organizations for support.</li></ul><h3>The Solution(s)</h3><p>Now that you have more data on the problem, let’s look at some possible solutions. None of the following are intended to be the end-all, be-all solution to the problem of food insecurity — but let’s consider a few examples.</p><h3>Organize a food drive.</h3><p>Starting a food drive is incredibly simple. If you have the ability to communicate, you can share your intention with those with whom you are connected and ask them to join you in your mission. You don’t need a computer, or even a phone — although these things may help.</p><ol><li>The first step is to <strong>find an organization</strong> that will accept your donations. I started with a google search for <a href="https://www.google.com/search?q=foodbank+in+my+area&amp;rlz=1C5CHFA_enUS861US861&amp;oq=foodbank+in+my+area&amp;aqs=chrome..69i57j0i10i457j0i22i30l6.6534j0j7&amp;sourceid=chrome&amp;ie=UTF-8">food banks in my area</a>. This led me to the <a href="http://erafoodpantry.org/">Emergency Relief Agency of Levittown, PA</a>. Call the agency to be certain that they’re accepting donations. In light of COVID-19 — they may have restrictions of which you need to be aware. Let the agency know of your plans and let them know roughly when you will be delivering your donations. This will help them plan.</li><li><strong>Create a flyer. </strong>Don’t complicate this. You can use pen and paper if you don’t have a computer. If you do, I used a <a href="https://www.canva.com/">free service</a> to help create a message that would inspire those in my neighborhood to donate.</li><li><strong>Set up a place to receive your donations. </strong>I used several large plastic tubs with lids. and placed them on my porch. Be cognizant that your donations may be out in the elements and even though your asking for non-perishables — you want them to be safe/dry.</li><li><strong>Get the word out.</strong> I began by walking door to door in my neighborhood. I handed out a copy of the flyer — but if you don’t have copies, just let your neighbors know what you’re up to. Each and every single neighbor with whom I spoke were excited at the possibility of making an impact on this important issue. Now that your local area knows of your mission, let the world know by sharing it on social media. You may, or may not be active on social media — but this is your chance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*xiz92dCmB6VSXvihamtDhQ.png" /></figure><p>If you don’t have a <a href="https://facebook.com/">facebook</a>, <a href="https://instagram.com/">Instagram</a>, or <a href="https://twitter.com/">twitter</a> account, consider the powerful impact you may be able to have if you start using one for this purpose. This step is optional but suggested if you want to exponentially increase your impact.</p><p>Make sure you keep your donations safe. For me, that meant emptying the tubs and bringing them in nightly.</p><p>5. <strong>Deliver your donations.</strong> This probably goes without saying — but unless the donations make it safely to the agency, the impact will be zero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*tK0rIhTbeRLOu9YgiVbpdw.png" /><figcaption>The Result: 120lbs of food collected in 5 days.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*JdRcbaPz3QYYlcVp9KTHMA.png" /><figcaption>The first haul… minus a few that I picked up on the way. Over 120lbs of food delivered to the ERA in Levittown, PA.</figcaption></figure><h3>Donate in other ways</h3><p>You may not be situated in such a way that starting, organizing, and running a food drive is possible. There are other ways to contribute. Search for a reputable charitable organization. Visit their web site, look for signs that they’re reputable. Make a phone call — be sure you can get someone on the line that can talk about the results they’re experiencing. Visit the facility if you can.</p><p>The problem of food insecurity in America and around the world is mountainous. We can move this mountain if only a little… if we pick up the shovel and assume responsibility.</p><p>Will you make commit to making a difference in the world? Perhaps you’ll choose some other mountainous problem on which to impact positive change but I’d like to challenge you… today.</p><p>“Change will not come if we wait for some other person or some other time. We are the ones we’ve been waiting for. We are the change that we seek.” — <strong>Barack Obama</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e862714443e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Tips for the Beginner Hackathon Participant]]></title>
            <link>https://michael-lynn.medium.com/10-tips-for-the-beginner-hackathon-participant-6c8c598600f5?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c8c598600f5</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[hacker]]></category>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Fri, 05 Oct 2018 14:47:55 GMT</pubDate>
            <atom:updated>2018-10-05T14:47:55.420Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kuuVv5RTkr2ztgNEEYpZOw.png" /><figcaption>Hackathon in progress (VCU RAMHacks 2018) Photo Credit: Michael Lynn</figcaption></figure><p>As fall closes in, the hackathon season reaches its peak. Here’s a quick list of tips to maximize your opportunity as you plan to participate — and win your next hackathon.</p><p><strong>1.Team up early.</strong> If you already have your team picked, great. If you don&#39;t, don’t waste time. Start introducing yourself to others looking for teammates. Relationships you build at this event will be invaluable as you grow professionally.</p><p>Most successful hackathon projects have a distinct set of components. If you’re building an application, you’ll likely have a front-end, a back-end (And database), an API. Effectively leveraging a team to distribute the work will ensure a better outcome.</p><h3>Steve Rubel on Twitter</h3><p>Great things in business are not done by one person, they are done by a team of people.&quot; - Steve Jobs http://bit.ly/fDvtvw</p><p><strong>2. Ask questions.</strong> The only stupid questions are the ones you don’t ask because these go unanswered. Document the answers you get and share them with your team. Most hackathons have a team of people onsite specifically to assist you. If you don’t see them or know who they are, ask the organizers. Good mentors will be available, and ready to assist.</p><h3>Zen Moments on Twitter</h3><p>He who asks a question is a fool for five minutes he who does not ask a question remains a fool forever. ~ Chinese Proverb</p><p><strong>3. Brainstorm. </strong>Take time to nurture ideas. Write down your ideas and share them with your team. You can teach curiosity, but you can nurture creativity by dedicating time to think. No idea is a bad idea. Write them down. When all else fails, start writing.</p><h3>Avery Prometheus Rosen on Twitter</h3><p>If you&#39;re having difficulty writing something, start by writing down the reason you want to write it at all. Then elaborate.</p><p><strong>4. Communicate.</strong> Organize your team in such a way that you’ve got constant communication (usually via <a href="http://slack.com/">Slack</a>) with your teammates, organizers, and mentors. Hackathons are typically held over 1, 2 days or sometimes longer. Divide the overall time allotted and schedule regular sessions to do checkpoints with your team. Leverage many mediums: in-person, chat and share documents online. Above all, communicate with kindness and be open to ideas with which you may not initially agree.</p><h3>Kindness Matters on Twitter</h3><p>Your words carry amazing power, so when you speak, make sure you uplift someone and never put them down&quot; #KindnessMatters</p><p><strong>5. Drink water, eat healthy food.</strong> Your mental output is directly related to your nutritional input. There will likely be plenty of sweets, sugary drinks, and caffeine. Be careful to not overload on these. Try to eat <a href="https://chopra.com/articles/12-foods-to-help-you-focus">nutritious foods that will help you focus</a>.</p><h3>Denise McDermott MD on Twitter</h3><p>To keep the body in good health is a duty...otherwise we shall not be able to keep our mind strong and clear.#Buddha #OneHumanity</p><p><strong>6. API First.</strong> Build an API to expose your data. You’ll be able to iterate faster as well as experiment with different front-end platforms using a consistent data access methodology. A shameless plug — <a href="http://mongodb.com/stitch">MongoDB Stitch</a> provides a phenomenally easy way to get your data, and your API developed very quickly, efficiently so you can concentrate on other parts of your app.</p><blockquote>“If you really want to scale, build your API first “— Dave Engberg, CTO Evernote</blockquote><p><strong>7. Use source control.</strong> <a href="http://github.com/">GitHub</a> is free and provides a <a href="https://guides.github.com/activities/hello-world/">great way for you</a> to store your code assets. You’ll thank me when someone inadvertently deletes or corrupts your code in some way. git pull will save your butt.</p><h3>Chris Uehlinger on Twitter</h3><p>@b0rk `git reflog` is so awesome, it&#39;s saved my butt loads of times. I keep it in a glass box labeled &quot;BREAK IN CASE OF EMERGENCY&quot;.</p><p><strong>8. Use free services to host your project. </strong>In addition to <a href="http://github.com/">GitHub</a>, leverage free services to aid in the development, hosting and execution of your project.<strong> </strong>Another shameless plug, perhaps… <a href="http://www.mongodb.com/cloud">MongoDB Atlas</a> is a Database as a Service that starts at $0.00. This is one example — but there are more. The great thing about <a href="http://cloud.mongodb.com/">MongoDB Atlas</a> is that you can start for free and when your project takes off and you need to increase the capacity you can simply change the configuration on the fly. Consider using a static hosting service such as Netlify. <a href="http://www.netlify.com/">Netlify</a> starts for free and also has direct, continuous integration with <a href="http://www.github.com/">GitHub</a>.</p><h3>InfoQ on Twitter</h3><p>MongoDB Atlas: Database as a Service. The best way to run #MongoDB in the cloud. Start for free. https://t.co/3AiFG6WwSn @MongoDB sponsored</p><p>9. <strong>Don’t forget the demo!</strong> All of your hard work will culminate in the final demonstration. Don’t neglect planning for this portion of the hackathon. The best demos I’ve seen incorporate some sort of (very brief) slideshow, and a live demonstration of your project. Show the judges that you’ve thought about explaning your project to someone who has little or no idea what you’ve put together. Speak clearly, make sure each team member has a part to play in the demonstration. Be confident — in fact, confidence is more than 50% of your message. Engage the judges — ask them questions as you explain your work to check their level of understanding. Solicit and answer questions. If you don’t know the answer — “I don’t know, but I will find out.” is always acceptable.</p><p><strong>10. Have fun.</strong> Above all else, hackathons should be enjoyable — fun. The pressure to compete will always be there and that’s good because it will drive you to do well. However, be sure to keep this in perspective — winning is nice but the goal should be to learn, grow and increase your exposure to people, technologies, and companies.</p><h3>Michael Lynn on Twitter</h3><p>Do anything, but let it produce joy.&quot; --Walt Whitman #inspired</p><p>There you have it: 10 quick tips to help you enjoy and compete in your next hackathon. Do you have a question about hackathons, about data, building a project or anything — ask me. You can reach me on <a href="https://twitter.com/mlynn">Twitter</a>, <a href="https://www.linkedin.com/in/mlynn/">LinkedIn</a>, <a href="https://www.instagram.com/mlynnstagram/">Instagram</a> or in the comments section below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c8c598600f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Data Enabled API in 10 Minutes with MongoDB Stitch]]></title>
            <link>https://michael-lynn.medium.com/creating-a-data-enabled-api-in-10-minutes-with-mongodb-stitch-6d23578fed6d?source=rss-ca06e83644e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d23578fed6d</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[api-development]]></category>
            <dc:creator><![CDATA[Michael Lynn]]></dc:creator>
            <pubDate>Wed, 26 Sep 2018 15:45:30 GMT</pubDate>
            <atom:updated>2025-03-26T14:38:57.676Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*6CLtZEbUdqbPViengE03og.png" /><figcaption>MongoDB Stitch Data Enabled API</figcaption></figure><h3>** STITCH HAS BEEN DEPRECATED **</h3><p>Creating an API that exposes data doesn’t have to be complicated. With <a href="https://www.mongodb.com/cloud/stitch">MongoDB Stitch</a>, you can create a data enabled endpoint in about 10 minutes or less.</p><p>At the heart of the entire process is <a href="https://docs.mongodb.com/stitch/services/">MongoDB Stitch’s Services</a>. There are several from which to choose and to create a data enabled endpoint, you’ll choose the <a href="https://docs.mongodb.com/stitch/reference/service-webhooks/">HTTP Service with a Webhook</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mInla6kGCTmyn1TnpjsowQ.png" /></figure><p>When you create an HTTP Service, you’re enabling access to this service from Stitch’s serverless functions in the form of an object called context.services. More on that later when we create a serverless function attached to this service.</p><p>Name and add the service and you’ll then get to create an “Incoming Webhook”. This is the process that will be contacted when your clients request data of your API.</p><p>Call the webhook whatever you like, and set the parameters as you see below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2bpqj0jH-kscyjufwe4Jw.png" /></figure><p>We’ll create this API to respond with results to GET requests. Next up, you’ll get to create the logic in a function that will be executed whenever your API is contacted with a GET request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MgDD4BqDAdiSn236Ks9fdQ.png" /></figure><p>Before we modify this script to return data, let’s take a look at the Settings tab — this is where you’ll find the URL where your clients will reach your API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mIlLu-Dlr67nFhi8.png" /></figure><p>That’s it — you’ve configured your API. It’s not going to do anything interesting. In fact, the default responds to requests with “Hello World”. Let’s add some data.</p><p>Assuming we have a database called mydatabase and a collection of contact data called mycollection, let’s write a function for our service:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOxNU770PATNImd0RKOp-g.gif" /><figcaption>Creating a function to return data from a collection in MongoDB Stitch</figcaption></figure><p>And here’s the source:</p><pre>exports = function(payload) {<br> const mongodb = context.services.get(“mongodb-atlas”);<br> const mycollection = mongodb.db(“mydatabase”).collection(“mycollection”);<br> return mycollection.find({}).toArray();<br>};</pre><p>This exposes all documents in the database whenever a client calls the webhook URL associated with our HTTP Service. That’s it.</p><p>Let’s use PostMan to show how this works. Grab your API Endpoint URL from the service settings screen. Mine is as follows — yours will differ.</p><pre><a href="https://webhooks.mongodb-stitch.com/api/client/v2.0/app/devrel-mrmrq/service/api/incoming_webhook/webhook0">https://webhooks.mongodb-stitch.com/api/client/v2.0/app/devrel-mrmrq/service/api/incoming_webhook/webhook0</a></pre><p>Paste that into the GET URL field and hit Send, you should see something similar to the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*Zy7Q8xHCQqsZmGvOxQp_bQ.png" /></figure><p>Check out the <a href="https://github.com/mrlynn/10-min-data-api-mongodb-stitch">GitHub Repository</a> to review the code and try it yourself and review the screencast where I <a href="https://youtu.be/WBEzGFpAnhY">create a data enabled API in 10 Minutes with MongoDB Stitch</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWBEzGFpAnhY%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWBEzGFpAnhY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWBEzGFpAnhY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/965f38efed1f8970517c2dec3818d305/href">https://medium.com/media/965f38efed1f8970517c2dec3818d305/href</a></iframe><p>Want to try this for yourself? Sign up for a free <a href="http://cloud.mongodb.com/">MongoDB Atlas</a> account. Looking to leverage an API for integration with MongoDB? Read Andrew Morgan’s recent article on <a href="https://www.mongodb.com/blog/post/building-a-rest-api-with-mongodb-stitch">Building a REST API with MongoDB Stitch</a>.</p><h3>Additional Resources:</h3><ul><li><a href="http://docs.mongodb.com/stitch">MongoDB Stitch Documentation</a></li><li>Creating your first Stitch app? Start with one of the <a href="https://docs.mongodb.com/stitch/tutorials/">Stitch tutorials</a>.</li><li>Want to learn more about MongoDB Stitch? Read the <a href="https://www.mongodb.com/collateral/mongodb-stitch-serverless-platform">white paper</a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d23578fed6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>