<?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 Karthik G Kumar (KGK) on Medium]]></title>
        <description><![CDATA[Stories by Karthik G Kumar (KGK) on Medium]]></description>
        <link>https://medium.com/@karthikgkumar?source=rss-fe1b4856e245------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wjQ6yNvl3FjcyRkOgbaR7g.jpeg</url>
            <title>Stories by Karthik G Kumar (KGK) on Medium</title>
            <link>https://medium.com/@karthikgkumar?source=rss-fe1b4856e245------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:37:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@karthikgkumar/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[Why You Should Switch to uv for Your Google ADK Workflow (Mac Guide)]]></title>
            <link>https://medium.com/@karthikgkumar/why-you-should-switch-to-uv-for-your-google-adk-workflow-mac-guide-51cd6e668828?source=rss-fe1b4856e245------2</link>
            <guid isPermaLink="false">https://medium.com/p/51cd6e668828</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-adk]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Karthik G Kumar (KGK)]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 16:29:57 GMT</pubDate>
            <atom:updated>2026-02-10T16:29:57.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LBe_5MK5d7L5I6JNRQgCFA.png" /><figcaption>uv and google-adk</figcaption></figure><p>The Python ecosystem is notorious for its “dependency hell.” While built-in virtual environments (venv) exist, they often feel clunky and slow. Many of us migrated to Anaconda or Poetry to find peace, but a new contender has changed the game: <strong>uv</strong>.</p><p>Built in Rust by the team at <a href="https://astral.sh/">Astral</a>, uv is an extremely fast Python package installer and resolver. If you are working with the <strong>Google ADK (Agent Development Kit)</strong>, switching to uv isn&#39;t just about speed—it&#39;s about sanity.</p><p>Here is how to set up your Google ADK environment on macOS while avoiding common architecture pitfalls.</p><h3>🚀 Setting Up the Foundation</h3><p>Before diving into the ADK, you need to get uv onto your machine. On macOS, the installation is a simple one-liner:</p><p>Bash</p><pre>curl -LsSf https://astral.sh/uv/install.sh | sh</pre><h3>1. Python Version Management</h3><p>uv can manage Python versions directly, eliminating the need for tools like pyenv. Let’s install the latest stable version (e.g., 3.12 or 3.14 if available):</p><p>Bash</p><pre>uv python install 3.14</pre><h3>2. Project Initialization</h3><p>Instead of manually creating folders, use uv to scaffold your project:</p><p>Bash</p><pre>uv init my-adk-project<br>cd my-adk-project</pre><h3>3. Creating the Virtual Environment</h3><p>Create a dedicated environment for your ADK agents:</p><p>Bash</p><pre>uv venv --python 3.14<br>source .venv/bin/activate</pre><h3>⚠️ The “Intel vs. Apple Silicon” Trap</h3><p>A common headache for macOS developers is the architecture mismatch. If you have previously installed Python via <strong>Homebrew</strong>, you might accidentally be running an x86_64 (Intel) binary on an arm64 (Apple Silicon) Mac, or vice-versa. This leads to cryptic &quot;Library not loaded&quot; errors when running heavy SDKs like Google ADK.</p><h3>How to Diagnose</h3><p>Check which Python versions uv sees:</p><p>Bash</p><pre>uv python list --only-installed</pre><p>Then, verify the architecture of your specific path:</p><p>Bash</p><pre>/usr/local/bin/python3.14 -c &quot;import platform; print(platform.machine())&quot;</pre><blockquote><strong><em>Pro Tip:</em></strong><em> If you find yourself in a version mismatch, “pin” your project to the correct, verified version to ensure consistency across your team:</em></blockquote><pre>uv python pin 3.14</pre><h3>🛠 Integrating Google ADK</h3><p>With your environment stabilized, it’s time to bring in the Google ADK.</p><h3>Adding Dependencies</h3><p>Instead of pip install, use uv add. This automatically updates your pyproject.toml and ensures your lockfile is synced.</p><p>Bash</p><pre>uv add google-adk</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ZRLO7jUhNMReoR7sh0_zQ.png" /><figcaption>pyproject.toml</figcaption></figure><p>Your pyproject.toml will now look like this, acting as the single source of truth for your project:</p><p><strong>KeyValueName</strong>my-adk-project</p><p><strong>Dependencies</strong>google-adk &gt;= 0.x.x</p><p><strong>Environment</strong>Managed by uv</p><h3>Running ADK Commands</h3><p>uv run is the preferred way to execute commands. It ensures that the google-adk package is actually available in the current context before execution.</p><ul><li><strong>Create a new Agent:</strong></li></ul><pre>uv run adk create &lt;adk-agent-name&gt;</pre><ul><li><strong>Launch the Web UI:</strong></li></ul><pre>uv run adk web</pre><ul><li><strong>Run an Agent in the CLI:</strong></li></ul><pre>uv run adk run &lt;agents_folder&gt;</pre><h3>💡 Why This Matter</h3><p>Using uv with Google ADK provides three main benefits:</p><ul><li><strong>Speed:</strong> Rust-backed resolution means your environment is ready in milliseconds.</li><li><strong>Reproducibility:</strong> The uv.lock file ensures that every developer on your team uses the exact same version of the ADK.</li><li><strong>Isolation:</strong> No more polluting your system Python or dealing with slow Anaconda metadata solves.</li></ul><h3>External Resources</h3><ul><li><a href="https://docs.astral.sh/uv/">Official uv Documentation</a></li><li><a href="https://google.github.io/adk-docs/get-started/">Google ADK GitHub Repository</a> (Check for specific plugin requirements)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51cd6e668828" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I ACE’d my first Google cloud Certification (GCP ACE)!!]]></title>
            <link>https://medium.com/@karthikgkumar/how-i-aced-my-first-google-cloud-certification-gcp-ace-12b73d407be3?source=rss-fe1b4856e245------2</link>
            <guid isPermaLink="false">https://medium.com/p/12b73d407be3</guid>
            <category><![CDATA[ace]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Karthik G Kumar (KGK)]]></dc:creator>
            <pubDate>Fri, 17 Oct 2025 10:30:05 GMT</pubDate>
            <atom:updated>2025-10-17T10:30:05.645Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide is specific to Google Cloudpartner companies! (having access to skillboost and vouchers)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rd0QcsCk9XneHX1dkubYEw.jpeg" /></figure><p>I recently got certified as an <strong>Associate Cloud Engineer</strong> by <strong>Google Cloud</strong>. This is a 2-hour examination that tests your foundational knowledge. The exam is recommended for Google Cloud beginners.</p><p>In this post, I detail my journey of preparation. My company, <strong>SADA</strong> (acquired by <strong>Insight</strong>), is a Google partner company — hence there’s a strong focus on GCP. Fortunately, there are plenty of resources available online for preparation.</p><p>Note that I’ve separated the content into two parts: one for <strong>Google partner companies</strong>, and another for <strong>individuals interested in taking the exam</strong>.</p><p>Attaching the syllabus that’s common for everyone.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//services.google.com/fh/files/misc/v4.0_associate_cloud_engineer_exam_guide_english.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cc426ceac40a3ff91872a29ea420c1d/href">https://medium.com/media/8cc426ceac40a3ff91872a29ea420c1d/href</a></iframe><p><strong>LINK:</strong> <a href="https://services.google.com/fh/files/misc/v4.0_associate_cloud_engineer_exam_guide_english.pdf">https://services.google.com/fh/files/misc/v4.0_associate_cloud_engineer_exam_guide_english.pdf</a></p><h3>Google Partner Companies (or who has access to skillboost and Qwiklabs)</h3><p>It was very useful to use <a href="https://partner.cloudskillsboost.google/paths/69"><strong>Skillsboost</strong> </a>(sign in using partner email) and <a href="https://partner.cloudskillsboost.google/focuses/11600"><strong>Qwiklabs</strong> </a>— the hands-on labs let you try Google Cloud for free and experiment with real services. This is essential when you’re learning: you don’t yet know everything, you’re trying to understand concepts, and <strong>it’s impossible to master every service in just one week</strong>. So take your time and learn gradually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*486ijWMtVI583bgWfGWUBA.png" /><figcaption>Skillsboost Learning path</figcaption></figure><p>Start with implementation in labs and ingest the information slowly. This process will probably take <strong>2–3 weeks</strong>, and at most <strong>one month</strong>.</p><p><strong>ACE Learning Path Breakdown (updated as of Oct 16, they keep changing it)</strong></p><p>I felt courses 2,3,4 were important for building out the concepts. You also get the course materials by google. I build a tracker to keep my progress.</p><p>People can reach out to me for the tracker!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0HpOCJwVGarCsf7SQnHPQA.png" /><figcaption>ACE Tracker</figcaption></figure><p>Very important: you should have hands-on experience in GCP. I especially recommend practicing with <strong>GKE</strong>, <strong>VM creation</strong>, <strong>VPC</strong>, <strong>subnets</strong>, <strong>firewalls</strong>, <strong>IAM</strong>, <strong>billing</strong>, <strong>Cloud Storage buckets</strong>, <strong>Cloud Run</strong>, <strong>Cloud Functions</strong>, and <strong>App Engine</strong>.</p><p>I completed three labs listed in this document to get the exam voucher. Please note that this voucher is available only to partner companies; otherwise, you must pay to take the exam.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//services.google.com/fh/files/misc/pck_cloud_engineer_one_pager.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/86c45af217631b28417a9b623c14931d/href">https://medium.com/media/86c45af217631b28417a9b623c14931d/href</a></iframe><p>The <strong>challenge labs</strong> are not easy to tackle, so give yourself enough time for them. If you search online, you’ll find shortcuts to complete the labs — but I <strong>don’t recommend using them</strong>. Try to solve them on your own unless you’re stuck for 2–3 days; in that case, feel free to reach out to me.</p><p>When you receive the <strong>exam voucher</strong>, it’s important to register for the exam within <strong>4 weeks</strong>, otherwise it will expire. So make sure you book the exam as soon as possible and choose convenient dates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Uc-1vPSplvSrMuk_apOjA.png" /><figcaption>Voucher</figcaption></figure><p>There’s definitely a lot to cover since <strong>Google has updated the syllabus</strong>. I recommend taking the exam <strong>at a test center</strong> rather than online — many of my seniors and people online have advised the same due to various inconveniences with the online option. Still, choose whichever mode works best for you.</p><p>The <strong>Udemy course</strong> I followed really helped me prepare for the exam. Honestly, the instructor’s explanations are excellent and very helpful. The course is missing a few topics since Google recently updated the syllabus, but as of now, it’s still <strong>the best resource available online</strong>.</p><p>🔗<a href="https://www.udemy.com/course/google-cloud-certification-associate-cloud-engineer/"> Udemy — Google Associate Cloud Engineer</a></p><p><strong>Link:</strong></p><p>Whatever he says becomes a question in your mind — that’s how effective the instructor is! In the <strong>last week</strong>, it’s important to <strong>test your knowledge</strong> using <strong>Udemy mock exams</strong>:<br> 🔗 <a href="https://www.udemy.com/course/latest-gcp-ace-google-associate-cloud-engineer-practice-exams-tests/">Udemy — Google Associate Cloud Engineer Practice Exams</a></p><p>In 2023, many questions came directly from these mock exams (some even called it “learning from dumps”). However, with the <strong>updated syllabus</strong>, only about <strong>15 questions</strong> get repeated — but the <strong>question pattern remains the same</strong>.</p><p>There’s also <strong>SkillCertPro</strong> practice exams, which are highly recommended online, but I personally have experience only with the Udemy ones.</p><p>🔗<a href="https://skillcertpro.com/product/google-cloud-certified-associate-cloud-engineer-practice-exam-set/">SkillCert-Google Associate Cloud Engineer Practice Exams</a></p><p>If you consistently score <strong>80–90%</strong>, you can confidently attempt the real exam. It’s widely discussed that <strong>70%</strong> is the pass mark, though Google hasn’t provided any official information on this.</p><p>The questions are mostly <strong>scenario-based</strong>, and recent ones focus more on <strong>AI</strong> and <strong>security</strong>. When I say AI and security, I mean <strong>practical scenarios</strong> like attaching GPUs, running ML pipelines from on-prem to cloud, etc.</p><p><strong>Google CLI commands</strong> are also very important — especially <strong>GKE cluster commands</strong>, gcloud auth commands, and <strong>service account authentication</strong>. Don’t try to study everything in depth; focus on <strong>repeated and pattern-based questions</strong>.</p><p>🧠 Example question:</p><p><strong>You are managing the backend services for a new mobile app, QuickBuy, which allows users to make instant purchases from various online retailers. Recently, some users have reported an issue where their purchases are failing. After investigating, you discover that the problem stems from a Service Account that lacks the necessary permissions to complete the purchase process. You resolve the issue by updating the Service Account’s permissions. However, you want to ensure that you are alerted if this issue happens again in the future. What should you do?</strong></p><ul><li><strong>A. In the Log Viewer, filter the logs on severity ‘Error’ and the name of the Service Account.</strong></li><li><strong>B. Create a sink to BigQuery to export all the logs. Create a Data Studio dashboard on the exported logs.</strong></li><li><strong>C. Create a custom log-based metric for the specific error to be used in an Alerting Policy.</strong></li><li><strong>D. Grant Project Owner access to the Service Account.</strong></li></ul><p>A is incorrect because filtering the logs on severity ‘Error’ and the Service Account name in the Log Viewer allows you to manually identify occurrences of the error but does not provide an automated alert mechanism. B is incorrect because creating a sink to BigQuery to export all the logs and creating a Data Studio dashboard adds complexity without directly addressing the need for real-time alerts. <strong>C is correct</strong> because creating a custom log-based metric for the specific error allows the system to recognize and track the specific issue related to the Service Account. D is incorrect because granting Project Owner access to the Service Account provides the account with extensive permissions beyond what it needs, violating the principle of least privilege.</p><p><strong><em>Syllabus Breakdown</em></strong></p><p><strong>Section 1: Setting up a Cloud Solution Environment (~23%)</strong></p><p><strong>Key focus:</strong> Foundation setup — accounts, projects, and billing.</p><ul><li>Create and organize resource hierarchies (organizations, folders, projects) — Understand the core principles.</li><li>Manage IAM roles, users, and groups in Cloud Identity — Lots of questions in this area.</li><li>Enable APIs, set up Cloud Observability, and manage quotas.(1 or 2 questions only)</li><li>Configure networking, billing, and budgets/alerts (Important topic)</li><li>Use Cloud Asset Inventory and Gemini Cloud Assist for analysis (Google is trying to introduce these questions but haven’t seen in the latest exams)</li></ul><p><strong>Section 2: Planning and Implementing a Cloud Solution (~30%)</strong> <strong>(VERY IMPORTANT — Please study all the topics)</strong></p><p><strong>Key focus:</strong> Deploying compute, storage, and networking infrastructure.</p><p><strong>2.1 Compute</strong></p><ul><li>Choose between Compute Engine, GKE, Cloud Run, etc.</li><li>Configure VMs, disks, SSH, autoscaling, OS Login, VM Manager.</li><li>Deploy containerized apps on GKE or serverless apps via Cloud Run / Functions.</li></ul><p><strong>2.2 Storage &amp; Data</strong></p><ul><li>Deploy Cloud SQL, BigQuery, Firestore, Spanner, Bigtable, AlloyDB, Dataflow, Pub/Sub, etc.</li><li>Use Cloud Storage tiers and lifecycle rules.</li><li>Handle multi-region redundancy and data loading.</li></ul><p><strong>2.3 Networking</strong></p><ul><li>Design VPCs, subnets, firewalls (Cloud NGFW), and load balancers.</li><li>Configure VPNs, VPC Peering, Interconnect, and Service Tiers.</li><li>Use Tags, service accounts, and security policies.</li></ul><p><strong>2.4 Infrastructure as Code</strong></p><ul><li>Use Terraform, Config Connector, Helm, or Fabric FAST.</li><li>Manage deployment state, versioning, and automation. (Didn’t see any questions — only name of the tools to be studied)</li></ul><p><strong>Section 3: Ensuring Successful Operation (~27%)</strong></p><p><strong>Key focus:</strong> Monitoring, troubleshooting, and maintaining workloads.</p><p>3.1 Compute</p><ul><li>Manage VMs, snapshots, GKE nodes/pods, Cloud Run traffic, autoscaling.</li><li>Update and deploy new app versions.</li></ul><p><strong>3.2 Storage &amp; Data</strong></p><ul><li>Manage Cloud Storage objects, lifecycle rules, and database backups.</li><li>Run queries, monitor Dataflow/BigQuery jobs, and estimate costs.</li></ul><p><strong>3.3 Networking</strong></p><ul><li>Modify VPCs, add subnets, configure DNS/NAT, static IPs, and routes.</li></ul><p>3.4 Monitoring &amp; Logging</p><ul><li>Create Cloud Monitoring alerts and custom metrics.</li><li>Use Cloud Logging, Trace, Profiler, Query Insights, Ops Agent, and Prometheus.</li><li>Leverage Gemini Cloud Assist and Active Assist for optimization.</li></ul><p><strong>Section 4: Configuring Access and Security (~20%)</strong></p><p><strong>Key focus:</strong> IAM and service account security.</p><ul><li>Create and manage IAM policies, roles (basic, predefined, custom).</li><li>Create and assign service accounts with least privilege.</li><li>Manage impersonation, short-lived credentials, and GKE integrations.</li></ul><p>With this preparation, you can definitely <strong>ACE the exam!</strong></p><p>What’s next after this?<br> You can aim for a <strong>Professional-level certification</strong> — Google offers several of them.</p><p><a href="http://cloud.google.com/learn/certification?hl=en">Certifications | Google Cloud</a></p><p>I wish you all the best in your <strong>GCP journey</strong>!</p><p>💡 <strong>Pro tip:</strong> Don’t cram for the exam. Focus on truly understanding the concepts — be able to explain a service to a friend. Also, use mock exams to identify <strong>edge cases</strong> or <strong>concepts you might have missed</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12b73d407be3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you should use a combination of SQLAlchemy and Sqlite3? (1/2)]]></title>
            <link>https://python.plainenglish.io/why-you-should-use-a-combination-of-sqlalchemy-and-sqlite3-1-2-6c5d781da408?source=rss-fe1b4856e245------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c5d781da408</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[sqlalchemy]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Karthik G Kumar (KGK)]]></dc:creator>
            <pubDate>Sat, 16 Aug 2025 10:14:55 GMT</pubDate>
            <atom:updated>2025-08-25T00:31:49.356Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why should you use a combination of SQLAlchemy and SQLite3? (1/2)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y83cMD-PeJL600gjakXp6w.png" /></figure><p>Vibecoding makes the SDLC better, boosting delivery time significantly for smaller projects — especially if you’re building a Python backend. A combination of <strong>FastAPI + SQLite </strong>or <strong>FastAPI + SQLAlchemy</strong> is what AI often recommends for beginner-level projects,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-AdpdLeqMFNhLvSEfL1AQ.png" /><figcaption>Performace comparison (image rights credited to Melih Colpan)</figcaption></figure><p>That’s why I’m planning a two-part blog series to introduce sqlite3 and SQLAlchemy, so you know what goes under the hood in your perfect AI-generated code.</p><p>sqlite3 is a file-based database, and Python ships with a built-in module called sqlite3 to interact with it. The SQLite engine itself is written in <strong>C</strong> and fully supports integration with Python code. The catch? You have to enter raw SQL strings into it—manually.</p><p>That comes with some <strong>downsides</strong>:</p><ul><li><a href="https://www.securityjourney.com/post/how-to-prevent-sql-injection-vulnerabilities-how-prepared-statements-work"><strong>SQL injection risks</strong> </a>if you don’t use parameters properly.</li><li><strong>Verbose queries</strong> that clutter your Python code.</li><li><strong>Harder refactoring</strong> when schema changes.</li><li><strong>No built-in migrations</strong>, making database evolution painful — If you want to change your database, this is going to be hard.</li></ul><pre>import sqlite3<br><br># Connect to SQLite (creates file if it doesn&#39;t exist)<br>conn = sqlite3.connect(&quot;todo.db&quot;)<br>cursor = conn.cursor()<br><br># Create table if it doesn&#39;t exist, makes id primary key and auto increment<br>cursor.execute(&quot;&quot;&quot;<br>CREATE TABLE IF NOT EXISTS todos (<br>    task_id INTEGER PRIMARY KEY AUTOINCREMENT,<br>    task_name TEXT NOT NULL,<br>    task_status TEXT NOT NULL<br>)<br>&quot;&quot;&quot;)<br><br># Insert data (safe parameterized query)<br>#Notice that the &#39;?&#39; is in the place of the values. This is in order to avoid SQL injections<br>cursor.execute(&quot;INSERT INTO users (task_name, task_status) VALUES (?, ?)&quot;, (&quot;Buy groceries&quot;, &quot;pending&quot;))<br>cursor.execute(&quot;INSERT INTO users (task_name, task_status) VALUES (?, ?)&quot;, (&quot;Clean the house&quot;, &quot;completed&quot;))<br><br># Commit changes and close connection<br>conn.commit()<br>conn.close()<br><br>print(&quot;Data inserted successfully!&quot;)</pre><p><strong>sqlite3.connect(&quot;todo.db&quot;)</strong>:</p><ul><li>Opens a connection to a database file named todo.db.</li><li>If the file doesn’t exist, SQLite automatically <strong>creates</strong> it.</li></ul><p><strong>conn.cursor()</strong>:</p><ul><li>Creates a <em>cursor object</em> used to send SQL commands and retrieve results from the database.</li></ul><p><strong>CREATE TABLE IF NOT EXISTS</strong>: Prevents errors if the table already exists.</p><p><strong>id INTEGER PRIMARY KEY AUTOINCREMENT</strong>:</p><ul><li>Each new row gets a unique integer ID automatically.</li></ul><p><strong>task_name TEXT NOT NULL</strong>:</p><ul><li>Name is required and must be text.</li></ul><p><strong>task_status TEXT NOT NULL</strong>:</p><ul><li>Age is required and must be a text.</li><li>The <strong>? placeholders</strong> are replaced with actual values at runtime.</li><li>This is <strong>parameterized SQL</strong> — it prevents <strong>SQL injection</strong> because values are passed separately from the query string.</li><li>Each call inserts one new record into the todo table.</li></ul><p><strong>conn.commit()</strong>:</p><ul><li>Saves all changes to the database file.</li></ul><p><strong>conn.close()</strong>:</p><ul><li>Closes the connection, freeing resources.</li></ul><p>Now Let’s do a hands-on to get familiar with Sqlite3,. Open your text editor.</p><h3>Step 1: Create Schema</h3><p>We created the table schema above. Now we will insert the data.</p><h3>Step 2: Insert sample data</h3><p>We’ll start with three example tasks.<br> Since task_id is auto-generated, we only insert task_name and task_status.</p><pre>## Sample data<br>todo_list = [<br>    (&quot;Buy groceries&quot;, &quot;pending&quot;),<br>    (&quot;Clean the house&quot;, &quot;completed&quot;),<br>    (&quot;Finish homework&quot;, &quot;in-progress&quot;)<br>]<br><br>conn = sqlite3.connect(&quot;todo.db&quot;)<br>cursor = conn.cursor()<br># For loop to insert data<br>for task_name, task_status in todo_list:<br>    cursor.execute(&quot;&quot;&quot;<br>    INSERT INTO todos (task_name, task_status)<br>    VALUES (?, ?)<br>    &quot;&quot;&quot;, (task_name, task_status))<br><br>conn.commit()<br>conn.close()<br>print(&quot;Sample data inserted.&quot;)</pre><h3>Step 3: CRUD Functions</h3><p>CRUD stands for <strong>Create, Read, Update, Delete</strong> — the core operations for any database.</p><h3>Create</h3><pre>def add_task(task_name, task_status):<br>    conn = sqlite3.connect(&quot;todo.db&quot;)<br>    cursor = conn.cursor()<br>    cursor.execute(&quot;&quot;&quot;<br>    INSERT INTO todos (task_name, task_status)<br>    VALUES (?, ?)<br>    &quot;&quot;&quot;, (task_name, task_status))<br>    conn.commit()<br>    conn.close()<br>    print(&quot;Task added successfully.&quot;)</pre><h3>Read</h3><pre>def get_all_tasks():<br>    conn = sqlite3.connect(&quot;todo.db&quot;)<br>    cursor = conn.cursor()<br>    cursor.execute(&quot;SELECT * FROM todos&quot;)<br>    rows = cursor.fetchall()<br>    conn.close()<br>    return rows</pre><h3>Read One</h3><pre>def get_task(task_id):<br>    conn = sqlite3.connect(&quot;todo.db&quot;)<br>    cursor = conn.cursor()<br>    cursor.execute(&quot;SELECT * FROM todos WHERE task_id = ?&quot;, (task_id,))<br>    row = cursor.fetchone()<br>    conn.close()<br>    return row</pre><h3>Update</h3><pre>def update_task(task_id, task_name=None, task_status=None):<br>    conn = sqlite3.connect(&quot;todo.db&quot;)<br>    cursor = conn.cursor()<br>    if task_name:<br>        cursor.execute(&quot;UPDATE todos SET task_name = ? WHERE task_id = ?&quot;, (task_name, task_id))<br>    if task_status:<br>        cursor.execute(&quot;UPDATE todos SET task_status = ? WHERE task_id = ?&quot;, (task_status, task_id))<br>    conn.commit()<br>    conn.close()<br>    print(&quot;Task updated successfully.&quot;)</pre><h3>Delete</h3><pre>def delete_task(task_id):<br>    conn = sqlite3.connect(&quot;todo.db&quot;)<br>    cursor = conn.cursor()<br>    cursor.execute(&quot;DELETE FROM todos WHERE task_id = ?&quot;, (task_id,))<br>    conn.commit()<br>    conn.close()<br>    print(&quot;Task deleted successfully.&quot;)</pre><h3>Step 4: Example Usage</h3><p>Now let’s see it all in action.</p><pre># Add a new task<br>add_task(&quot;Go jogging&quot;, &quot;pending&quot;)<br><br># View all tasks<br>print(get_all_tasks())<br><br># Get a specific task<br>print(get_task(2))<br><br># Update task status<br>update_task(3, task_status=&quot;completed&quot;)<br><br># Delete a task<br>delete_task(1)<br><br># View updated list<br>print(get_all_tasks())</pre><p>Let’s see how to access the database and query on it to see if the data has been inserted or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ULWYI469JODePQ-rleJOw.png" /><figcaption>Query from db</figcaption></figure><pre>sqlite3 todo.db <br>.tables<br><br>SELECT * FROM todos;<br><br>.q</pre><p>Hurray! You have reached the milestone of mastering sqlite DB.</p><p>💡 <strong>Next Step:</strong><br> In Part 2 of this series, I’ll take this exact todos table and rewrite it using <strong>SQLAlchemy</strong>, so you can see how much cleaner and more maintainable it gets — and why it’s worth learning early in your Python backend journey.</p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c5d781da408" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/why-you-should-use-a-combination-of-sqlalchemy-and-sqlite3-1-2-6c5d781da408">Why you should use a combination of SQLAlchemy and Sqlite3? (1/2)</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Journey of setting up the first NSDC (AI/Datascience) Community in Kerala]]></title>
            <link>https://medium.com/@karthikgkumar/journey-of-setting-up-the-first-nsdc-ai-datascience-community-in-kerala-20ab5d88a8ce?source=rss-fe1b4856e245------2</link>
            <guid isPermaLink="false">https://medium.com/p/20ab5d88a8ce</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nsdc]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[community]]></category>
            <dc:creator><![CDATA[Karthik G Kumar (KGK)]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 16:26:46 GMT</pubDate>
            <atom:updated>2025-04-19T16:26:46.548Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*jwbUDG7FwwA68_95la6Usg.png" /></figure><p>Have you ever thought about creating ML/AI communities in your college? This is something I would love my network to know about.</p><p>In November 2023, I established the <a href="https://www.linkedin.com/company/nsdc-mec/">NSDC MEC</a> chapter at my college, Model Engineering College, Kochi with the incredible support of <a href="https://www.linkedin.com/in/emily-rothenberg/">Emily Rothenberg</a> and <a href="https://www.linkedin.com/in/florencehudson/">Florence Hudson</a>. In this blog, I’m sharing my experience in setting up this club and how this community is successfully thriving in the college.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*dnfJ32zOBGEhqCfwzDnK-A.png" /><figcaption>Florence Hudson, Founder of NSDC</figcaption></figure><p>So, what is NSDC?<br>The NSDC: National Student Data Corps — Chapter Central | Northeast Big Data Innovation Hub (<a href="http://nebigdatahub.org/">nebigdatahub.org</a>), an initiative by the <a href="https://www.linkedin.com/company/northeast-big-data-innovation-hub/">Northeast Big Data Innovation Hub</a>, aims to build a community of data science learners and educators. It provides resources, mentorship, and opportunities to students interested in data science and related fields. The NSDC focuses on promoting data literacy and skills through various programs, workshops, and events, fostering a collaborative environment for students to learn and grow in the field of data science.</p><p>I set up NSDC in my third year. This would, in fact, be my fourth community idea that I had proposed. Each time I failed, I was getting better at setting up the next one. My very first idea was MECenger, a college newsletter. The idea was good, but we didn’t have many resources to collect what was happening on the campus. So, we quickly lost momentum. The second was a social community called ASCII, in which I was able to rope in teammates and made it to the final stage. As our college already has 40+ communities, it’s very hard to set up a new community if we fail to justify the mission. My third idea was a community chapter of GFG, but we had a similar DSA club, so that didn’t work out. Hence, learning from all my past experiences, I looked into some potential AI communities, and NSDC was one of them. I had also worked immensely under other college clubs during my initial days, providing me with rich experience, especially in FOSSMEC, where I was given the freedom to execute any ideas. FOSSMEC had given me all the experience to successfully start another community. Hence, I would say consistency is the key. Others may not know the hardships in finding new things, but it’s important that we keep reflecting on these, and when bad times come, keep believing in yourself and push forward.</p><p>The story of NSDC MEC starts in Nov 2023 with it’s inauguration: I had invited Dr. Bindu Krishnan, Senior Data Scientist at IBM, for the inauguration and all the college teachers for it. As it was our first event, there was no amount raised. Our treasurer, D Krishnadas was the reason the event went without any monetary issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*nDLvECNaYyE6Fv5V9STvGw.png" /><figcaption>Inauguration Ceremony</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*3X-cd1dI6e3YClvgGtbXvg.png" /><figcaption>Our first team</figcaption></figure><p>It’s important to convince the team mates in starting something new. But I was fortunate to have the best team working with me.</p><p>Our second event was a competition called “Win with AI,” which we set up in collaboration with IHRD to conduct. It was quite successful, and we were able to raise the funding for the club. The next event was a short-term training program for NLP in collaboration with ICFOSS, which had researchers and students from all over Kerala. This was another successful event, raising our funding even more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*1lMQ8fvqvZ9m6HMrsWGz8g.png" /><figcaption>NLP session</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*77VwlDCG4xQCyrl_-vdFKg.png" /></figure><p>With this, I was stepping into my fourth year, and I got an internship as an AI developer at a startup. Hence, conducting large-scale events was out of scope. So, I decided to scale up the team and mentor them so that I could sit back, let them lead, and focus more on internal aspects. Hence, we became a 30-member team from a 14-member team. I had formed a division of an AI team and a research team focusing on projects and research. I’d be very happy if someday NSDC can bring in an innovative product. I have shared my experience and resources from AI internships and a research internship at Oklahoma. I have laid the foundation, and it’s up to the future team to lead the next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*hss4CdDesmKlHZiInTVs4g.png" /></figure><p>And we had introduced a talk series with Arun George Mathew, Sales Lead from Google. We also had other speakers in our next lineup, but it didn’t happen because of our college timing and my placement schedules.<br> On a successful note, I was able to meet with the Python community Kochi at PyCon in Bengaluru and was able to establish a connection. With that, we were able to set up Python meetups on our campus and at the ENTRI office in Kochi. We had other competitions and research paper work happening in our community. I’m always happy to connect with eager people who are interested in building AI products and research.<br> I would like to thank my staff advisor Dr. Sony P for always believing in me and saying yes to whatever ideas I proposed. I would also like to thank my teammates who believed in me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sTGMa-O9hzxMz-rYihWjpQ.jpeg" /><figcaption>Core Handover</figcaption></figure><p>The journey was amazing, and as I say goodbye to MEC, I am leaving a special mark of NSDC MEC with it. I’m sure Suhana will be able to lead the next team successfully. I wish all the best to the future team leads. I wrote this blog post to serve as a reminder to the upcoming leads and all student leaders to believe in yourself and push forward. Experience defines you and builds you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ESw-EXaJ96D9Swa8VDDo9Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4zSaSd2L05ZgSoMdxtXyg.jpeg" /></figure><p>As I move on to the next journey in my life, NSDC will hold a special place in my heart.</p><p>For people who want to know more about us, visit us <a href="https://nsdc.mec.ac.in/">https://nsdc.mec.ac.in/</a>.</p><p>Also Linktree: <a href="https://linktr.ee/nsdcmec">NSDC MEC Linktree</a><br><br>You can also reach out to us for specific queries: <a href="/service/mailto:nsdc@mec.ac.in">nsdc@mec.ac.in</a></p><p>You can connect with me: <a href="https://www.linkedin.com/in/karthik-g-kumar/">https://www.linkedin.com/in/karthik-g-kumar/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20ab5d88a8ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Millennium Fellowship Campus Director Interview Guide]]></title>
            <link>https://medium.com/@karthikgkumar/millennium-fellowship-campus-director-interview-guide-89a9811cfeb0?source=rss-fe1b4856e245------2</link>
            <guid isPermaLink="false">https://medium.com/p/89a9811cfeb0</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[millennium-fellowship]]></category>
            <category><![CDATA[sustainable-development]]></category>
            <category><![CDATA[student-community]]></category>
            <dc:creator><![CDATA[Karthik G Kumar (KGK)]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 12:55:17 GMT</pubDate>
            <atom:updated>2025-04-16T12:55:17.649Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*06GmwO8T0YdxzP94" /></figure><p>Millennium Fellowship is a semester-long leadership development program, initiated by the United Nations Academic Impact and Millennium Campus Network for undergraduate students.</p><p>Through this program, students from various parts of the world work towards achieving the Sustainable Development Goals of the <a href="https://sustainabledevelopment.un.org/post2015/transformingourworld">2030 Agenda for Sustainable Development,</a> adopted by all United Nations Member States in 2015.</p><p>I am proud to have been the Campus Lead of Millennium Fellowship during my first year, leading 26 Millennium Fellows of 2022 Cohort. For those who are unfamiliar with the Millennium Fellowship, I recommend reading the blog written by my senior Niranjana, which covers all application procedures for both rounds.</p><p><a href="https://medium.com/munners-daily/millennium-fellowship-the-how-and-why-cf6f2b5e78c5">https://medium.com/munners-daily/millennium-fellowship-the-how-and-why-cf6f2b5e78c5</a></p><p><strong>As a guide for campus director interviews, I have compiled a list of questions to help shape your leadership skills. The answers should be based on your experiences, and if you have conducted any large events, you should definitely add them to your responses.</strong></p><h3>1. Introduce yourself</h3><p>When introducing yourself, it’s best to use the third person. Practice this question thoroughly.</p><p>Sample Answer</p><p>Thank you for giving me this opportunity to introduce. Karthik G Kumar is a first-year computer science student at Government Model Engineering College. He was born and brought up in Kerala. He has a keen interest in technology and social activities. He loves to share his knowledge and mentor others.👨‍🏫 His dream is to provide educational opportunities to the underprivileged ones. He is a Data Analyst and an aspiring Data Scientist. A charismatic Karthik will never fail to impress you with two W’s ie Words and Work.✨ He is passionate on solving real-world problems with his technical skills. He loves networking with new people, anchoring, speaking and mentoring. He always keep one quote dear to his heart.</p><blockquote><em>“The more I want to get something done the less I call it work”.</em></blockquote><p>He is a creative and hard-working person who constantly likes to learn new things and explore new cultures through language, food, and music. He likes to see himself as an optimist.</p><h3>2. Why do you want to be Campus Director?</h3><p>Focus on your leadership capabilities when answering this question.</p><p>Sample Answer</p><p>This is a great opportunity for me, and I believe that I have a strong sense of leadership. I always strive for the best and try to make everything perfect. I am committed to my work and don’t procrastinate. I would like to connect with similar people from other campuses and learn from them. That’s why I’m interested in becoming the Campus Director. I also want to work on a team, learn soft skills, gain real-world leadership experience, improve my communication, time management, and responsibility skills. I can network with many people and create more friendships and bonds.</p><h3>3. An instance where you worked along with someone as you have to work with two Campus Directors if you are getting selected.</h3><p>Sample Answer</p><p>Collaboration and mutual support are paramount for a team. I was a team leader for a pitching competition where we needed to create an idea, study the revenue model, and pitch it. There were times when one of us couldn’t be present physically and mentally, and other times we had a lot going on in our college and personal lives, making it hard to keep up. Good teamwork ensured that our project was submitted on time. When I did something right, they would congratulate me, and when something was wrong, they would say, “Let’s fix it.” It was a great experience.</p><h3>4. An instance of a conflict you had in the team.</h3><p>Sample Answer</p><p>We needed to submit an idea for a competition under the Kerala startup council, and my team discussed an idea and came to the conclusion that we would submit an idea about virtual reality for anxiety disorder. One team member wanted to cancel this idea at the very last moment, and he said he would quit if we didn’t change the idea. The issue got bigger because we didn’t have time to research a new topic and create a presentation. However, the other team members rejected his idea, and he went along with us. As the project continued, he became very uncomfortable and tried to initiate fights, and one day he said he wanted to leave the group because he couldn’t keep up with his studies. But as a leader, it was my duty to get to know what his problems were and think of a suitable solution. As we both sat down to have a good conversation, things got resolved quickly and he was willing to go with the project.</p><h3>5. What will you do to make an interactive community?</h3><p>Sample Answer</p><p>To make an interactive community, I would focus on creating an open and inclusive environment where everyone can share their ideas and opinions. I would organize team-building activities, encourage open communication, and promote collaboration. I would also try to create a sense of belonging by recognizing everyone’s contributions and making sure everyone feels valued and appreciated.</p><h3>6. How will you network and complete the tasks?<a href="https://karthikgkumar.netlify.app/blog/millennium-fellowship/#6-how-will-you-network-and-complete-the-tasks">#</a></h3><p>Sample Answer</p><p>To network and complete the tasks, I would use a variety of tools, such as social media, email, and phone calls, to communicate with my team and other Campus Directors. I would also prioritize tasks based on their importance and set clear deadlines to ensure that everything gets done on time. Additionally, I would delegate tasks to other team members based on their strengths and interests, which would help to ensure that everyone is engaged and motivated.</p><p>These are the list of some additional questions.</p><p>1. What are your greatest strengths?<br>2. Tell me about something you did — or failed to do — that you now feel a little ashamed of.<br>3. Where do you see yourself five years from now?<br>4. Tell me a situation when your work was criticised.<br>5. Who has inspired you in your life and why?</p><h3>Final Thoughts</h3><p>It’s really a great opportunity for everyone to be part of Millennium Fellowship. With a leadership position like Campus Director, it will immensely boost your resume.</p><p><em>Originally published at </em><a href="https://karthikgkumar.netlify.app/blog/millennium-fellowship/"><em>https://karthikgkumar.netlify.app</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89a9811cfeb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Effective Prompting]]></title>
            <link>https://medium.com/@karthikgkumar/a-beginners-guide-to-effective-prompting-aac40b9152d2?source=rss-fe1b4856e245------2</link>
            <guid isPermaLink="false">https://medium.com/p/aac40b9152d2</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Karthik G Kumar (KGK)]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 19:06:25 GMT</pubDate>
            <atom:updated>2024-12-31T19:06:25.978Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IbE_gFSpKc5dJROt" /><figcaption>Photo by <a href="https://unsplash.com/@omilaev?utm_source=medium&amp;utm_medium=referral">Igor Omilaev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the age of AI-powered communication, large language models (LLMs) like OpenAI’s GPT-4, Google’s LaMDA, and Anthropic Claude have become invaluable tools for creativity, problem-solving, and innovation. But the true power of these models lies in <strong>how you ask them to perform a task</strong> — this is where <strong>prompting</strong> comes in.</p><p>Whether you’re a writer exploring new ideas, a developer automating workflows, or someone curious about the potential of AI, understanding the art and science of prompting is your first step to unlocking the possibilities of LLMs.</p><h3>What Is Prompting?</h3><p>Simply put, prompting is the process of giving instructions to a language model to get a desired response. Effective prompts are not just random questions — they are thoughtfully crafted inputs that leverage specific principles to guide the model’s behavior.</p><h3>The Basics of Effective Prompting</h3><p>Crafting a good prompt involves four fundamental elements tailored to the task at hand:</p><ol><li><strong>Instruction:</strong><br> Clearly state the action or task you want the model to perform. This provides a framework for the model’s response.</li><li><strong>Context:</strong><br> Supply any external information or background that helps the model understand the task better. Context can be critical for improving accuracy.</li><li><strong>Input Data:</strong><br> Include the specific text, question, or information you want the model to analyze or act upon.</li><li><strong>Output Indicator:</strong><br> Define the type or format of the output you’re expecting. This helps the model structure its response in a way that aligns with your needs.</li></ol><p>Here’s an example:</p><p><strong><em>Prompt:</em></strong><em><br> Classify the text into neutral, negative, or positive.<br> Text: I think the food was okay.<br> Sentiment:</em></p><p><strong>Analysis of the Example:</strong></p><ul><li><strong>Instruction:</strong> “Classify the text into neutral, negative, or positive.”</li><li><strong>Input Data:</strong> “I think the food was okay.”</li><li><strong>Output Indicator:</strong> “Sentiment.”</li><li><strong>(Optional) Context:</strong> You could add details like “This is a customer feedback review.”</li></ul><p>Not all tasks require all four elements. The key is to include the elements that best communicate your intent to the model.</p><h3>Why Does Prompt Engineering Matter?</h3><p>LLMs are incredibly powerful, but their effectiveness is influenced by the quality of the prompts they receive. A poorly structured prompt can lead to ambiguous or irrelevant responses, while a clear, well-thought-out prompt ensures that the model delivers accurate and meaningful results.</p><h3>How LLMs Work (Simplified)</h3><p>Understanding the mechanics of LLMs can enhance your ability to design effective prompts. These models use a Transformer-based neural network to process and generate text. Two key features stand out:</p><ol><li><strong>Self-attention:</strong><br> LLMs analyze relationships between words in the input, focusing on the most relevant parts to generate coherent and contextually accurate responses.</li><li><strong>Positional encoding:</strong><br> The models consider word order to maintain logical flow and consistency in their outputs.</li></ol><h4>Training: Pre-training and Fine-tuning</h4><ul><li><strong>Pre-training:</strong> The model learns language patterns by processing vast datasets, like books and web pages.</li><li><strong>Fine-tuning:</strong> It undergoes specialized training to improve its performance on specific tasks or domains.</li></ul><p>When you provide a prompt, the LLM predicts the most likely next word (or sequence of words) based on its training, generating an output tailored to your input.</p><h3>Building Better Prompts</h3><p>Now that you understand the principles and mechanics, let’s dive into some practical examples and types of prompts you can use.</p><h4>1. Instructional Prompts</h4><p>Guide the model with direct instructions.</p><ul><li><em>Prompt:</em> Summarize this article in three sentences.</li></ul><h4>2. Contextual Prompts</h4><p>Add context to guide the response.</p><ul><li><em>Prompt:</em><br> <em>You are an AI assistant. Summarize this article in three sentences: [insert article text].</em></li></ul><h4>3. Step-by-Step Prompts</h4><p>Encourage logical reasoning or detailed problem-solving.</p><ul><li><em>Prompt:</em> Solve 5 + 3 × 8 + 5 step by step.</li></ul><h4>Prompt Types in Action</h4><p>Here’s how combining different elements can refine the output:</p><ol><li><strong>Zero-shot Prompting:</strong></li></ol><p>Rely on the model’s general knowledge.</p><blockquote>Input: Write a short poem about rain.</blockquote><p><strong>2. Few-shot Prompting:</strong><br> Include examples to guide the model.</p><blockquote><em>Input:</em> Write a product review like this:</blockquote><blockquote>Example: “I love this phone! The battery life is amazing. Now write one for a camera:</blockquote><p><strong>3. Conversational Prompts:</strong><br> Enable interactive exchanges.</p><blockquote><em>Input:</em> How are you today?</blockquote><p><strong>4. Creative Prompts:</strong><br> Inspire imaginative responses.</p><blockquote><em>Input:</em> Describe a city in the clouds.</blockquote><h3>Why Context Window Matters</h3><p>The <strong>context window</strong> defines how much input data a model can consider at once. For example:</p><ul><li><strong>Claude 2</strong> handles up to 100,000 tokens (~75,000 words).</li><li><strong>GPT-4-turbo</strong> handles up to 128,000 tokens (~96,000 words).</li></ul><p>This capability allows models to process and generate complex outputs for tasks like summarizing books or engaging in deep conversations.</p><h3>Start Experimenting Today</h3><p>Prompting is both an art and a science, and the best way to learn is by doing. Experiment with different types of prompts, refine your approach, and discover the different possibilities these tools offer.</p><p><strong>Ready to dive in? Start prompting today!</strong></p><p>We will look into different prompt engineering techniques in the next blog!</p><p><strong>Sources</strong></p><ol><li>Speech and Language Processing Daniel Jurafsky and James H. Martin Pearson 2/e, 2013</li><li>Unlocking the Secrets of Prompt Engineering Gilbert Mizrahi Packt 1/e, 2023</li><li>Prompt Engineering Ian Khan Wiley 1/e, 2024</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aac40b9152d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>