<?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 Johan de Bruin on Medium]]></title>
        <description><![CDATA[Stories by Johan de Bruin on Medium]]></description>
        <link>https://medium.com/@johandebruin?source=rss-55fa826bca56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bB3eHMcpcLjNPFBUj9qKOA.jpeg</url>
            <title>Stories by Johan de Bruin on Medium</title>
            <link>https://medium.com/@johandebruin?source=rss-55fa826bca56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:57:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johandebruin/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[Create a RAG Knowledge Base from Large Documents with ChatGPT and Code AnalysisExtract]]></title>
            <link>https://medium.com/@johandebruin/create-a-rag-knowledge-base-from-large-documents-with-chatgpt-and-code-analysisextract-e38266b6cd47?source=rss-55fa826bca56------2</link>
            <guid isPermaLink="false">https://medium.com/p/e38266b6cd47</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[gpt]]></category>
            <dc:creator><![CDATA[Johan de Bruin]]></dc:creator>
            <pubDate>Sat, 16 Mar 2024 16:06:20 GMT</pubDate>
            <atom:updated>2024-03-16T16:06:20.602Z</atom:updated>
            <content:encoded><![CDATA[<h3>Create a RAG Knowledge Base from Large Documents with ChatGPT and Code Analysis</h3><p>Sometimes, you may want to create a knowledge base for future queries, either to assist a custom GPT or to establish a RAG system. This knowledge base requires normalized information in a relevant structure, such as multiple JSON files with numerous meta attributes.</p><p>This article aims to take a <a href="https://arxiv.org/abs/2302.11382">research paper</a> from a diverse prompt pattern catalog, break it down into separate JSON files with uniform attributes, and compile these files into a zip folder using only ChatGPT and no external tools.</p><figure><img alt="An overview on how a PDF extracts, index, and generates the desired JSON content" src="https://cdn-images-1.medium.com/max/1024/1*iQcRsJ3OJLm7_aF39MaHrQ.png" /><figcaption>An overview on how a PDF extracts, index, and generates the desired JSON content</figcaption></figure><h3>Extraction</h3><p>The first step involves extracting the PDF files. For this, we can use a prompt similar to the following.</p><pre>Using code analysis extract each page of this PDF as a plain text <br>in a separate file</pre><p>This step is important as ChatGPT may not always be able to read the entire PDF. Now, all the text is accessible in separate text files for download.</p><figure><img alt="GPT exposing the pages as text files" src="https://cdn-images-1.medium.com/max/858/1*_od6cctzH6i-Ym--7TfwDA.png" /></figure><p>Now we ask GPT to read the extracted text files. This will load the paper content as context.</p><pre>Please read the different extracted text pages so that you can <br>answers questions about it.</pre><figure><img alt="ChatGPT Acknowleging that has read the text" src="https://cdn-images-1.medium.com/max/763/1*417OAhH5sxAfQhgIdXGLBw.png" /></figure><h3>Index</h3><p>We want GPT to index each page according to a pattern. This helps GPT identify prompt patterns and determine which parts of the original PDF to use when generating knowledge. Depending on the PDF, some patterns may require indexing without python. In this case, there are no clear headers for indexing, so manual GPT indexing is necessary.</p><pre>Create an index that maps the prompt patterns to the different<br>available pages</pre><figure><img alt="GPT Indexing the prompt patterns to the pages" src="https://cdn-images-1.medium.com/max/748/1*UKDoaXCsp3kb1L8gaMl55g.png" /></figure><h3>Generation</h3><p>I’ve discovered that the most effective way to generate content is by focusing on the specific parts you wish to produce. In my situation, I want to create a description, template, and an example using this prompt pattern.</p><p>Here are the various prompts I’ve utilized for this task.</p><pre>Now for each pattern create a small description explaining it</pre><pre>Now for each pattern create a small description on when would be <br>appropriate to use it.</pre><pre>Now for each prompt pattern provide an example using this pattern. <br>Make sure the example is the actual prompt we would provide to the LLM. <br>Make sure to use examples targeted to the lay person, like creating a <br>nutritionist expert in the persona pattern. Or generating a field trip <br>plan with the flipped interaction pattern.</pre><p>ChatGPT will promptly respond to the request and generate the desired content for each pattern listed in the index.</p><figure><img alt="ChatGPT generating a description for each prompt pattern" src="https://cdn-images-1.medium.com/max/736/1*MKrHSExBVevDy9Mf1m56aA.png" /></figure><h3>Formatting</h3><p>The final step involves compiling all this information and formatting it into JSON files. To assist with this, a prompt is provided detailing the desired JSON structure.</p><pre>Now for each pattern create a json structure using the text <br>previously generated. The structure looks like this:<br><br>{<br>   &quot;description&quot;: &quot;The small description previously generated&quot;,<br>   &quot;template&quot;: &quot;The template for the pattern&quot;,<br>   &quot;example&quot;: &quot;The example of usage of the pattern&quot;<br>}</pre><p>With this ChatGPT will start generating the JSON structures for this, it might require multiple runs until it gets all the desired content.</p><figure><img alt="ChatGPT exposing each one of the patterns as a JSON structure" src="https://cdn-images-1.medium.com/max/795/1*PKQSoefXufrRWKJ4dFs3-Q.png" /></figure><p>You can now copy and save these JSON files to your preferred knowledge base platform. Depending on your language model’s limitations and the compilation size, you may ask ChatGPT to compile these files into a zip file.</p><p>Even though this method is potent, it requires a thorough understanding of the content you’re extracting and some manual prompting. Always review the original source and ensure the output meets your expectations. You might need to adjust some prompts until you achieve the desired output.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e38266b6cd47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Prompt Patterns to Dominate Prompt Engineering]]></title>
            <link>https://medium.com/@johandebruin/5-prompt-patterns-to-dominate-prompt-engineering-2d9bac52ea56?source=rss-55fa826bca56------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d9bac52ea56</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Johan de Bruin]]></dc:creator>
            <pubDate>Sun, 28 Jan 2024 21:47:15 GMT</pubDate>
            <atom:updated>2024-01-28T21:49:47.009Z</atom:updated>
            <content:encoded><![CDATA[<p>Prompt patterns are critical because they are established through extensive contributions from the community, encompassing a wide range of texts and academic papers. The training iterations of Large Language Models (LLMs) have been adapted to recognize and utilize these commonly used patterns, enhancing their effectiveness and accuracy.</p><p>In this article, we will explore five of the most popular prompt patterns. Understanding and applying these patterns can significantly improve your productivity and efficiency when using Large Language Models (LLMs).</p><figure><img alt="A robot learning prompt engineering patterns" src="https://cdn-images-1.medium.com/max/512/1*YqC7-QBqgCn-CyJybqFXUA.png" /></figure><h3>Persona Pattern</h3><p>The Persona Pattern is straightforward yet remarkably potent. By setting a persona pattern, you instruct GPT to perform a specific task within the defined persona. The critical aspect of this pattern is its continuity; you can maintain an ongoing conversation, and the assistant (GPT) will consistently respond in the set manner while retaining the full context of the conversation history.</p><h4>Template</h4><ul><li><em>Act as a Persona X</em></li><li><em>Assign Task Y</em></li></ul><h4>Example</h4><p>Act as a medium article editor for an article about prompt engineering. Your task is to meticulously edit the provided paragraphs, enhancing their grammar, clarity, and overall readability, keeping the tone simple and direct.</p><h3>Question Refinement Pattern</h3><p>This pattern is designed to enhance your initial question or prompt. It involves requesting GPT to refine and improve your first question. Potentially, you can also ask GPT to answer the newly refined question. Employing this pattern can be crucial in uncovering key factors and details that should be provided initially to obtain a more accurate and comprehensive answer.</p><h4>Template</h4><ul><li><em>Suggest a better version of the question.</em></li><li><em>Ask me for the first question to refine.</em></li></ul><h4>Example</h4><p>Whenever I ask a question about the stock market, suggest a better version of the question that focuses on long-term investment perspectives, market analysis, and risk assessment. Ask me for the first question to refine.</p><h3>Cognitive Verifier Pattern</h3><p>This structured approach aims to improve accuracy and depth in the responses. This pattern is useful in complex or multi-faceted inquiries where a simple direct answer may not suffice. This is because the LLM is forced to provide the answer to multiple follow-up questions allowing it to combine them and improve the understanding of the original question.</p><h4>Template</h4><ul><li><em>When asked a question, follow these rules.</em></li><li><em>Generate additional questions that would help answer the question.</em></li><li><em>Combine the answers to the questions to produce a final answer of the overall question.</em></li></ul><h4>Example</h4><p>When you are asked for career advice, follow these rules. Generate a number of additional questions about the person’s interests, skills, educational background, and the type of work environment they prefer. Combine the answers to these questions to recommend career options that are likely to be fulfilling and suitable for them.</p><h3>Flipped Interaction Pattern</h3><p>The Flipped Interaction Pattern is a conversational approach where the roles in the dialogue are reversed. In this method, you instruct GPT to pose clarifying questions about a prompt to ensure it has sufficient information to provide a relevant response in your context. It’s important to establish a clear objective and a stopping condition, as GPT might otherwise continue asking an excessive number of questions, leading to a loss of focus.</p><h4>Template</h4><ul><li><em>Ask me questions to achieve X.</em></li><li><em>Continue asking questions until Condition Y is met or to fulfill the stated goal.</em></li><li><em>Ask me one question at a time (or specify two, three, etc., as needed)</em></li></ul><h4>Example</h4><p>I would like you to ask questions to help write a facebook post to advertise my product. Ask me questions until you have enough information to write the header, the body, and suggest a generated image. Ask me one question at a time. Ask me the first question.</p><h3>Few-shot Samples Pattern</h3><p>This pattern entails providing the model with a limited set of examples (known as “shots”) to teach it how to execute a specific task. It’s crucial to supply sufficient context about the expected type of response, as well as to use relevant keywords for input and output prompts. When employing this pattern, ensure that the anticipated input for the Large Language Model (LLM) is not overly ambiguous; otherwise, the model may be prone to generating inaccurate or “hallucinated” responses.</p><h4>Template</h4><ul><li><em>Give context on the kind of answer you expect</em></li><li><em>Offer queues like “input” and “output” in the context of the prompt.</em></li><li><em>Give a number of samples</em></li><li><em>Give a full input and provide the keyword indicator for the output</em></li></ul><h4>Example</h4><p>Decide if the skill type is based on the skill provided. The skill type can be hard or soft.</p><p>Skill: Natural Language Processing</p><p>Skill type: hard</p><p>Skill: Communication</p><p>Skill type: soft</p><p>Skill: Model Training and Fine-tuning</p><p>Skill type: hard</p><p>Skill: Algorithm Development</p><p>Skill type:</p><h3>Where to go from here?</h3><p>There are numerous resources available for enhancing your prompt engineering skills. For instance, consider exploring the “<a href="https://www.coursera.org/learn/prompt-engineering">Prompt Engineering for ChatGPT</a>” course on Coursera, which inspired this article. Additionally, the “<a href="https://arxiv.org/abs/2302.11382">Prompt Pattern Catalog</a>” is an academic paper that delves into a wide array of patterns, offering a more expansive understanding of this field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d9bac52ea56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microkernel Architecture in Game Development]]></title>
            <link>https://medium.com/@johandebruin/microkernel-architecture-in-game-development-64d7ecc2c1d2?source=rss-55fa826bca56------2</link>
            <guid isPermaLink="false">https://medium.com/p/64d7ecc2c1d2</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[game-design]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Johan de Bruin]]></dc:creator>
            <pubDate>Wed, 18 Jan 2023 14:28:07 GMT</pubDate>
            <atom:updated>2023-01-18T14:29:40.430Z</atom:updated>
            <content:encoded><![CDATA[<p>When developing games, especially on the client side we tend to come up with a complex library system and some sort of in-house SDK, ending to something similar to a Big Ball of Mud. This approach tends to ramp up technical debt after a couple of iterations usually requiring games to be refactored from the ground up and costing game companies millions of dollars.</p><p>A solution to this problem is establishing a strong architectural style, the one we will analyze today is the microkernel architecture, a monolithic architecture that consists of two parts; a <strong>core system</strong> and the <strong>plug-in components</strong>.</p><p>The core system consists of minimal functionality to run the system, while the plugin represents different features or domain-specific capabilities that extend the core system. The important part here is that the plug-in component allows different teams to develop new features independently while having a common framework and a clear communication contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKbyPiSU6-P44S8Xin4qBQ.jpeg" /><figcaption>Microkernel Architecture Overview</figcaption></figure><p>In game development, the core system can contain essential tools to allow plugins a common framework. Some examples could be:</p><ul><li>Plugin Registry: allows plugins to register, including some sort of contract exposure and dependencies.</li><li>Server Data Adapter: an adapter that provides a middleware between the server communication and the plugins.</li><li>State Manager: allow plugins to display a state on the screen, allowing different transitions.</li><li>Settings Manager: some plugins will be able to add new menus to the settings.</li><li>UI Components: a common set of UI components like buttons, panels, modals, etc.</li></ul><p>All these core systems don’t need to be coupled in the same project, instead, they could be their own libraries that will be bundled by some sort of <em>Barrel/Indexer Pattern</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OWKhz7pf04Fx_-IAHUynFw.jpeg" /><figcaption>Different Core Systems in Game Development</figcaption></figure><p>Where the plugins would involve more domain-specific plugins like login, main menu, store, level A, level B, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FPF2QziFU3eX-bNfz5wJEw.jpeg" /><figcaption>Different Plugins in Game Development</figcaption></figure><p>A good registry pattern is important to keep track of the current plugins in the system, and perhaps, what version you are using (if you use some sort of packaging and/or <a href="https://semver.org/">semantic versioning</a>)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8978cee9092f377682be7e6d66d0d6b/href">https://medium.com/media/c8978cee9092f377682be7e6d66d0d6b/href</a></iframe><p>Sometimes you can even have a microkernel architecture for the Editor/Designer tools, like for example a level editor that can offer the core systems in level design (like adding general props, dialogs entries, etc), and then plugins to offer very level-specific features (like a set of custom characters).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sOwNZglklS8oLFQnBvDv6Q.jpeg" /></figure><p>Finally, you need to be careful with plugin-to-plugin communication and always strive for the <a href="https://medium.com/javarevisited/uncle-bobs-advice-on-stability-and-abstraction-b96ea8623e97"><strong>Stable Dependency Principle</strong></a>.</p><p>For example, you might need the store to re-authenticate the player before they proceed to access sensible things like credit card information. This responsibility is part of the login plugin which can expose an API to allow the store to log in.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5614efe703538b382d88558521a9177/href">https://medium.com/media/b5614efe703538b382d88558521a9177/href</a></iframe><p>Note how we expose a very thin layer of logic, specifically the parts that other plugins might need, no more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64d7ecc2c1d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Coding Projects for Software Architects]]></title>
            <link>https://medium.com/@johandebruin/5-coding-examples-for-software-architects-132e0a863157?source=rss-55fa826bca56------2</link>
            <guid isPermaLink="false">https://medium.com/p/132e0a863157</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Johan de Bruin]]></dc:creator>
            <pubDate>Wed, 05 Oct 2022 21:39:58 GMT</pubDate>
            <atom:updated>2022-12-20T21:42:32.021Z</atom:updated>
            <content:encoded><![CDATA[<h4>Get hands-on experience to improve technical depth.</h4><p>Even full-time software architects needs to keep technical depth in the code base they are architecting on, this is important to <strong>correctly analyze the feasibility</strong> of the desired characteristics.</p><p>Technical Depth is mainly gathered via hands-on coding, as opposed of Technical Breath which involves studying industry standards, designs, and other external technologies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*k9vChfUarPNsfvmOM1_chA.png" /></figure><p><a href="https://www.developertoarchitect.com/lessons/lesson103.html">Mark Richards</a> offers 5 ways you can improve you depth as a software architecture, including:</p><h4>1. Implement a Feature that Nobody Depends on</h4><p>This is help to <strong>avoid becoming a bottleneck for other teams</strong>. Even if is a simple task you can benefit of getting some hands-on experience. Another idea is to avoid being the bottleneck is to <strong>refactor code</strong> to simplify a component or improve its usage.</p><h4>2. Create a Proof of Concept</h4><p>Allow to validate certain designs and how viable they are. Is important to write quality code in these proof of concepts, because often they become as a pattern reference for the rest of the team.</p><h4>3. Architecture Fitness Functions</h4><p>You can create tools to measure things like the abstractness and instability of a project. Or perhaps there is an architectural rule where you don’t allow the presentation layer access to the persistence layer and you want to automatically detect if the rule is being broken. You can hook these automatic tests with your CI tooling.</p><h4>4. Productivity Tools</h4><p>Tools like a source validation tool that ensures variables names correspond with the ubiquitous domain language. Another idea is a documentation generator to help some of your domain framework dispatch documentation to the knowledge base your company is using.</p><h4>5. Volunteer to do Code Reviews</h4><p>Allows to not only get more familiar with the codebase, but also allow you to see compliance with the project architecture principles. When you see things you are not familiar with, you should dig into the source code and research them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=132e0a863157" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>