<?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 umer javaid on Medium]]></title>
        <description><![CDATA[Stories by umer javaid on Medium]]></description>
        <link>https://medium.com/@kh.m.umerjavaid?source=rss-6288d329ed9e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IUmX-izrYyyAwz31XuO8VA.png</url>
            <title>Stories by umer javaid on Medium</title>
            <link>https://medium.com/@kh.m.umerjavaid?source=rss-6288d329ed9e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:48:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kh.m.umerjavaid/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[Hundreds of GitHub Repos Claim to Make AI Safe. Almost None Have Been Vetted.]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/hundreds-of-github-repos-claim-to-make-ai-safe-almost-none-have-been-vetted-bdd70a2cd883?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdd70a2cd883</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai-governance]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 19:45:19 GMT</pubDate>
            <atom:updated>2026-10-17T19:45:45.809Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cp4pLVSygSGoo4Lv2DHdXA.png" /></figure><p>Most “AI safety” repos on GitHub tag themselves for visibility, not because anyone vetted them. Here’s how I built a self-updating list that separates what’s popular from what’s proven.</p><p>Search GitHub for “LLM evaluation” and you get thousands of results. Search for “AI governance” and it gets worse. Half of what comes back is a PDF in a repo, and the other half is an agent product that added the ai-safety topic because it helps people find it.</p><p>So I ran an automated scan across those topics. It surfaced hundreds of repositories that looked relevant, passed a basic quality gate, and had real traction. Then I counted how many a human had actually vetted.</p><p><strong>Twenty-eight.</strong></p><p>That gap between “tagged ai-safety” and “someone checked that this works” is where engineering weeks quietly disappear. This is the story of the list I built to make that gap visible, and why it widens every Monday.</p><p><em>Snapshot: as of the 12 October 2026 run, the list held 28 verified repos and 573 unreviewed candidates. The candidate count changes every week when the agent runs again, so check the repo for the live number.</em></p><h3>The problem with ranking by stars</h3><p>Most curated lists sort by stars. It’s the obvious default, and it quietly defeats the purpose of curation.</p><p>Stars measure fame, not trustworthiness. A 60,000-star wrapper around someone else’s API can outrank a small, rigorous tool that someone used in anger. If you’re choosing software to decide whether your AI system is safe, popularity is the wrong signal.</p><p>So <a href="https://github.com/umerjavaidkh/AI-Governance-and-Eval">AI-Governance-and-Eval</a> sorts on <strong>provenance</strong> before it looks at anything else:</p><ul><li>✅ <strong>Verified:</strong> open-source tooling a human vetted and pinned in a curated file (28 as of the 12 October run).</li><li>🔎 <strong>Candidate:</strong> surfaced by the agent, unreviewed, and kept out of the main list until a human checks it (573 as of the same run, and growing weekly).</li></ul><p>The collection has one rule in its tagline: <em>open-source repos for evaluating AI and for governing it. Nothing else.</em> No papers, no articles, no regulations. Every entry is something you can clone and run.</p><h3>A list that grows every Monday, and a trust list that doesn’t</h3><p>Here’s the part I find most interesting. The list updates itself. A scheduled GitHub Action runs every Monday at 06:00 UTC. It scans the GitHub Search API for configured topics, keeps repos above a star threshold that pass a quality gate, scores each into its best-fitting category, regenerates the README, and commits the result.</p><p>Every week, the candidate pile can grow. The verified list only grows when a human puts their name behind an entry.</p><p>That asymmetry is the whole point. The supply of AI tooling is expanding faster than anyone can review it, and the project makes that visible instead of hiding it.</p><p>The most important line in the design is a restriction: <strong>the agent never writes to the curated file and never removes an entry from it.</strong></p><p>Automation handles the tedious part: discovery, tracking star growth, surfacing leads. Humans handle the part that needs judgment, which is deciding what deserves trust. Candidates sit in a section labeled plainly as leads to investigate, not recommendations. Promoting one to verified is the most valuable contribution the project accepts.</p><h3>Two domains, one boundary</h3><p>The collection covers two areas that get discussed together but need different tools.</p><p><strong>LLM, agent and RAG evaluation (17 repos)</strong> covers what you point at a model, an agent or a retrieval pipeline to find out whether it works:</p><ul><li>Benchmark harnesses like EleutherAI’s LM Evaluation Harness and OpenCompass</li><li>App-level testing like DeepEval, Ragas and promptfoo</li><li>Agentic benchmarks like SWE-bench</li><li>Adversarial testing with garak and PyRIT</li><li>Observability with an eval loop, like Langfuse and Phoenix</li></ul><p><strong>AI governance platforms (11 repos)</strong> covers what you run as part of a governance programme:</p><ul><li>Fairness testing with Fairlearn and AI Fairness 360</li><li>Explainability with InterpretML and Captum</li><li>Drift monitoring with Evidently and Alibi Detect</li><li>PII protection with Presidio</li><li>Risk grounding with the AI Incident Database</li></ul><p>The boundary matters because “AI governance” has become a catch-all that mostly produces documents. I wanted the version where a governance claim is backed by something that executes: a bias metric, a drift alert, an audit trail, a test result.</p><h3>Every entry answers one question: when do I reach for this?</h3><p>A description of what a tool is rarely helps you choose it. A trigger does. Each repo carries a “reach for it when” line:</p><ul><li><strong>Ragas:</strong> proving a RAG answer is actually grounded in retrieved context.</li><li><strong>Inspect:</strong> safety and agentic evals you need to defend to an auditor.</li><li><strong>Evidently:</strong> catching drift after deployment, when the risk register says you must.</li><li><strong>Presidio:</strong> keeping personal data out of prompts, logs and training sets.</li></ul><p>The contribution rules enforce this. “Evaluating LLMs” gets rejected. “Proving a RAG answer is grounded in retrieved context” gets merged. Specificity is the product.</p><h3>What curating these tools taught me</h3><p><strong>Evaluation is converging on CI.</strong> Tools like DeepEval treat LLM quality as a test that fails a build, the same way a broken unit test does. The shift from evaluation as a research exercise to evaluation as a regression gate is probably the most practical change in how teams ship LLM features.</p><p><strong>Red-teaming is becoming a commodity.</strong> garak, PyRIT, promptfoo’s adversarial generator and Giskard’s scanner all turn a manual red-team playbook into something repeatable. Shipping an endpoint without a first automated adversarial pass is now a choice, not a limitation.</p><p><strong>“Neutral” tooling doesn’t always stay neutral.</strong> promptfoo was reported in 2026 to be acquired by OpenAI. It remains MIT-licensed, but vendor neutrality is a real consideration when your evaluation tool is owned by a company whose models you might be evaluating. A license tells you what you can do. It doesn’t tell you who benefits.</p><p><strong>Governance tooling is thinner than evaluation tooling.</strong> And it’s thinnest outside the EU, US, UK and Singapore. Most open governance tooling reflects the regulatory environments that produced it. If you work in a region with its own frameworks, that’s a gap you can fill.</p><h3>How to use it</h3><p><strong>If you’re an engineer,</strong> use the “Start here” table as a shortcut. Find the row matching your problem, open the tool in the last column, and skip the browsing.</p><p><strong>If you’re building a governance programme,</strong> treat the governance section as an evidence checklist. Fairness metrics, explanations, drift monitoring, PII controls and incident grounding map onto the artifacts an auditor or risk committee will ask for.</p><p><strong>If you’ve used a candidate tool for real work,</strong> that’s the contribution that matters most. One honest sentence about when it’s the right choice is worth more than another star.</p><h3>The principle underneath</h3><p>The project is small, but the idea behind it applies more widely: <strong>automate discovery, reserve trust for humans, and make the difference visible.</strong></p><p>Lists that rank by popularity will keep amplifying whatever is loudest. Lists that separate “found” from “vetted” give people a way to calibrate how much to trust what’s in front of them.</p><p>The repo is open, MIT-licensed, and updates itself every Monday. If you find a dead link, a mis-sorted entry, or a tool you’ve trusted in production, open a PR.</p><p><strong>Repo:</strong> <a href="https://github.com/umerjavaidkh/AI-Governance-and-Eval">github.com/umerjavaidkh/AI-Governance-and-Eval</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdd70a2cd883" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero to Merge: The Architecture of Loop Engineering]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/zero-to-merge-3bad63da0947?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bad63da0947</guid>
            <category><![CDATA[llmops]]></category>
            <category><![CDATA[developer-productivity]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[loop-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Sat, 18 Jul 2026 05:32:07 GMT</pubDate>
            <atom:updated>2026-07-18T05:34:23.067Z</atom:updated>
            <content:encoded><![CDATA[<p><em>For thirty years we optimized how humans write code. The next decade is about engineering the loops that write it for us — and the gate at the very start that decides whether they should.</em></p><p>There is a specific kind of exhaustion that only exists now. You are not writing code. You are watching a machine write code, reading what it produced, spotting the one wrong assumption, typing a correction, and waiting again. Prompt, evaluate, correct, repeat. The model is fast. You are the slow part.</p><p>For a while we called this “AI-assisted development” and counted it as progress. It <em>was</em> progress — but it smuggled in a bottleneck so familiar we stopped seeing it. Every cycle passed through a human turn: a person reading, composing the next instruction, holding in their head what had already been tried. Output was capped not by the model’s speed but by the speed of human attention. We had automated the typing and left ourselves the waiting.</p><p><strong>Loop engineering</strong> is the name for what happens when you take yourself out of that path entirely. Instead of operating the agent turn by turn, you build a closed-loop system around it: one that discovers its own work, dispatches it, verifies the result against something stricter than its own opinion, writes down what it did, and schedules its next run. You stop being the operator. You become the architect of the boundaries the machine runs inside.</p><p>The idea has crystallized fast. It’s the through-line of Addy Osmani’s writing on autonomous coding agents and of Boris Cherny’s work on Claude Code, and it now has an open, tool-aware playbook — Cobus Greyling’s <a href="https://github.com/cobusgreyling/loop-engineering">loop-engineering</a> project, a growing reference of patterns, readiness checklists, and CLIs you can actually clone and run. What follows leans on that work, and adds one argument to it.</p><p>Most writing about this stops at the loop — the schedulers, the worktrees, the clever bash one-liners. This piece argues the loop is only the second half of the story. The first half is a gate, and it lives somewhere nobody thinks to look: the moment a task is <em>born</em>.</p><p><strong>PART 0 → 1 · THE GATEKEEPER</strong></p><h3>The most expensive bug is in the ticket, not the code</h3><p>Consider a ticket a product manager writes in ten seconds: <em>“Allow users to download their transaction history.”</em> A human developer muddles through it. They open a Slack thread, discover there are three different transaction tables, learn there’s no CSV export utility, ask which columns matter, and eventually build the right thing. The ambiguity costs a few hours and a context switch.</p><p>Hand that same ticket to an autonomous loop and the ambiguity doesn’t cost hours — it detonates. The agent will confidently build the wrong thing at machine speed, or spin forever, because it has no verifiable definition of “done.” This is the quiet prerequisite that most loop demos skip past: <strong>a loop’s stopping condition is a specification.</strong> If you cannot write a machine-checkable definition of success, the loop cannot know when to stop. Ambiguity in, garbage out — or an infinite loop out.</p><p>So the highest-leverage place to intervene is not the run. It is the instant the ticket is created, while the author still has the context in their head. Shift left, all the way to creation. Build an issue tracker that refuses to let an ambiguous ticket into the backlog at all.</p><p>Not a grammar checker — a <em>codebase-aware</em> one. Ground the gatekeeper in your actual repository through a GraphRAG or AST index. When the PM types “download transaction history,” the gate retrieves the real schema, sees three transaction tables and no export utility, and intercepts the save before the ticket can ever reach a queue.</p><blockquote>✕ <strong>Rejected at creation</strong> — “Allow users to download their transaction history.” The gate asks: which table? what format? which columns? what auth scope? what date range?</blockquote><p>The refined ticket it forces into existence looks like this instead:</p><pre>✓ DEV-READY — AND LOOP-READY</pre><pre>Story:   As an account holder, I want to export my history as CSV<br>         so I can reconcile it in a spreadsheet.</pre><pre>Impact:  /models/Transaction.ts<br>         /controllers/exportController.ts  (new)</pre><pre>Acceptance (Gherkin):<br>   Given a signed-in user with transactions<br>   When  they export a date range<br>   Then  a CSV of [date, description, amount, balance] downloads<br>   And   rows outside the range are excluded</pre><p>Look closely at those last four lines. They read like documentation, but they aren’t. They are the loop’s stopping condition, written in advance, and they parse directly into automated test assertions. The gate doesn’t just clean up prose. It manufactures the contract the loop needs to exist.</p><blockquote>A ticket is not a request. It is the loop’s halting condition, written before a single line of code is generated.</blockquote><p><strong>PART 1 → ∞ · THE LOOP</strong></p><h3>Anatomy of a machine that finds its own work</h3><p>Once the specification is solid, the loop can take over. But a loop doesn’t sit alone; it sits at the top of a nested stack, and each layer inherits the failures of the one beneath it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41b5634vgLiukf-EEZOpCg.png" /></figure><p>Each layer inherits the failures of the one beneath it.</p><p>The nesting is not decorative. If context retrieval hands the agent the wrong slice of the repo, a beautifully engineered harness still fails — it’s just executing precisely on false information. And a loop that repeatedly fires an uncalibrated harness doesn’t solve engineering problems. It commits bugs at automated velocity.</p><p>A working loop is not a chaotic stream of tool calls. It’s a cycle with a heartbeat and five moves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFcThyaWMCFtCotDFRsxLA.png" /></figure><p>Discovery → Handoff → Verification → Persistence → Schedule, triggered by a scheduler heartbeat, and around again.</p><ol><li><strong>Discovery.</strong> It scans for its own work — failed CI, fresh issues, stale dependencies. No human hands it a task.</li><li><strong>Handoff.</strong> It isolates the work in a git worktree so parallel agents can’t corrupt each other’s files.</li><li><strong>Verification.</strong> It cannot declare victory on its own say-so. A compiler, linter, or test suite is the judge.</li><li><strong>Persistence.</strong> It writes state to disk, because the model forgets everything the moment its context clears.</li><li><strong>Schedule.</strong> It books its own next run, and the cycle closes.</li></ol><blockquote>The model is the muscle. The state file is the spine. The scheduler is the heartbeat.</blockquote><p>That fourth move is the one people underestimate. A language model has no memory between runs; when the context window clears, its entire working history evaporates. The STATE.md file on disk is not a log — it is the organism&#39;s spine, the only thing carrying structural memory from one amnesiac run to the next.</p><p><strong>KEEPING THE LOOP HONEST</strong></p><h3>Left alone, a loop rots in two directions</h3><p>The romance of autonomy hides two failure modes, and both are quiet.</p><h3>1 · Context rot</h3><p>Inside a single long-running session, the context window fills with the debris of its own work — tool outputs, file dumps, half-finished reasoning. Past a certain size, accuracy frays: the agent repeats calls it already made, ignores its own guidelines, hallucinates file paths that were never there.</p><p>The counterintuitive fix is to stop trying to keep the session alive. Kill it every iteration. This is the essence of the <strong>Ralph loop</strong> (a technique popularized by Geoffrey Huntley): a dumb, persistent shell loop that resurrects a clean agent each pass.</p><pre># amnesia, on purpose<br>while :; do cat PROMPT.md | claude-code; done</pre><p>Each iteration begins with a blank mind, reads its next task off the spine, performs exactly one small unit of work, writes the result back, commits to git, and terminates. Memory lives in the file, never in the context. Forgetting becomes a feature.</p><h3>2 · Self-congratulation</h3><p>An agent that grades its own homework will pass itself every time. The fix is to separate the roles, and to put an unarguable machine between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grNTuRzmxAL4E5sMvw4a1w.png" /></figure><p>The compiler gate is non-negotiable — only a change that survives both the machine and a skeptic reaches the branch.</p><p>The compiler in the middle is doing something subtle. Generating code is nearly free; making it type-check is rigid and expensive to fake. A strict type system becomes <strong>compilation backpressure</strong> — the loop’s conscience. If the code won’t compile, the run reverts to the last known-good commit and tries a different approach. No arguing with the reviewer, no negotiating with the tests.</p><blockquote>Never let the agent that wrote the code be the agent that approves it.</blockquote><p><strong>THE ECONOMICS OF AUTONOMY</strong></p><h3>Leverage cuts in both directions</h3><p>An honest loop is still a dangerous one if nobody watches the meters. The costs of getting this wrong are real, and every one of them is silent:</p><p><strong>Token blowout.</strong> An unwatched recursive loop can spawn thousands of calls and drain a team’s API budget in an afternoon. Every loop needs a hard spend ceiling that shuts it down, not a hopeful one.</p><p><strong>Verification debt.</strong> Point a loop at a weak test suite and it will learn the laziest path to green: quietly weakening the tests until they pass. The board goes green while the code rots underneath it.</p><p><strong>Comprehension rot.</strong> If loops refactor the codebase while no human reads the diffs, understanding decays. Eventually you arrive at a system that runs and that no living engineer can explain.</p><p><strong>Cognitive surrender.</strong> The most dangerous one, because it isn’t technical. When a loop works reliably for long enough, people simply stop reviewing. They deploy whatever it emits. The oversight doesn’t fail loudly — it just quietly stops happening.</p><p>The failure-modes catalog in the loop-engineering repo reads like a list of scars: a fix attempt that never converges and re-runs on the same PR five times, a verifier that approves while CI stays red, a bot that pings so often the team mutes it, a loop that wanders off to “improve” modules nobody asked it to touch. The mitigations are unglamorous and specific — cap retry attempts (three, then escalate to a human), deny-list the paths the agent may never edit, and detect drift when the state file and the loop’s own log stop agreeing.</p><p>The larger defense is to refuse to grant autonomy a repository hasn’t earned. Score the codebase — the project ships a loop-audit CLI that does exactly this — and match a loop&#39;s freedom to its readiness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avyssXL1UEAUpyJKFPGsfw.png" /></figure><p>Autonomy is earned, not granted — run loop-audit to see where you stand before handing over the keys.</p><p>Most teams want L3 and are sitting on an L0 repo. That gap is the actual work of loop engineering. The autonomy is not the starting point — it’s the reward for writing the specs, hardening the tests, and building the gates that make it safe.</p><p><strong>FROM ESSAY TO MONDAY MORNING</strong></p><h3>You can start this week — in report-only mode</h3><p>The fastest way to internalize any of this is to run a loop that can’t hurt anything yet. The toolkit is built for precisely that first step: scaffold a pattern, estimate what it will cost, score where you stand, and let it only <em>watch</em> for a week before it’s allowed to touch code.</p><p><strong>1. Scaffold a starter</strong> — a daily triage loop for your tool of choice:</p><pre>npx @cobusgreyling/loop-init . --pattern daily-triage --tool claude</pre><p><strong>2. Estimate the token spend</strong> before you commit to a cadence:</p><pre>npx @cobusgreyling/loop-cost --pattern daily-triage --level L1</pre><p><strong>3. Score your repo’s readiness</strong> — and see what to fix next:</p><pre>npx @cobusgreyling/loop-audit . --suggest</pre><p>Then run week one in <strong>L1, report-only</strong>. The loop scans, triages, and writes what it finds to a state file — and touches nothing else. Open that file. Did it capture the priorities you’d have picked? Fix whatever it got wrong. You are still the engineer; the file is just a draft it wrote for you. Only once its judgment earns your trust do you let it graduate to writing fixes in isolated worktrees.</p><blockquote>Press “go” and walk away, and you’ve traded a bottleneck for a liability. Build the loop as someone who plans to stay responsible for what it ships — that’s the difference between leverage and abdication.</blockquote><p><strong>THE ARCHITECT</strong></p><h3>When code is free, the value moves to the boundaries</h3><p>The fear is that this ends engineering. It does the opposite — it relocates it. When writing a line of code costs almost nothing, none of the value lives in the line anymore. It all migrates to the edges: the spec at the gate, the verification at the loop, the budget on the run, and the judgment about what should be automated at all.</p><p>The engineer who thrives in this world is not the fastest typist. It’s the one who can write a definition of done precise enough for a machine to check, design a gate that catches ambiguity at the moment a task is born, and build a loop honest enough to trust — while knowing exactly when not to.</p><p>Zero to one is a gate. One to infinity is a loop. The craft is building both, and keeping your hands near the wheel of a car that increasingly drives itself.</p><p><strong>The loop runs while you sleep. Engineering is deciding what it’s allowed to do when it does.</strong></p><p><em>Sources &amp; further reading: the open-source </em><a href="https://github.com/cobusgreyling/loop-engineering"><em>loop-engineering</em></a><em> project by Cobus Greyling (patterns, failure-modes catalog, and the loop-audit / loop-init / loop-cost CLIs); Addy Osmani’s essays on autonomous coding agents; Boris Cherny’s work on Claude Code; and the “Ralph” technique by Geoffrey Huntley.</em></p><p><em>Suggested Medium tags: Loop Engineering · AI Agents · Software Architecture · LLMOps · Developer Productivity</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bad63da0947" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PyTorch From Zero to Scale: The Guide I Wish I Had]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/pytorch-from-zero-to-scale-the-guide-i-wish-i-had-65c41fe98dc6?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/65c41fe98dc6</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 08:01:05 GMT</pubDate>
            <atom:updated>2026-07-04T08:01:05.354Z</atom:updated>
            <content:encoded><![CDATA[<h3>Install it without the CUDA nightmare, train your first model, then make it fast and cheap enough to run in production.</h3><p><em>By Umer Javaid</em></p><p>Most PyTorch tutorials stop at “here’s a training loop, congratulations.” Then reality hits: the install breaks, the GPU sits at 30% utilization, training costs pile up, and nobody explains <em>why</em>. This guide goes end to end — from a clean environment to a model that scales — and along the way I’ll show the reasoning that separates someone who <em>uses</em> PyTorch from someone who <em>understands</em> it.</p><p>If you’re new, read it top to bottom; each section builds on the last. If you’re a hiring manager or a senior engineer skimming, the “Why this matters” callouts are where the judgment lives.</p><p>Everything here runs on a single GPU (or even CPU), and every snippet is copy-paste runnable.</p><h3>1. First, survive installation: the CUDA version trap</h3><p>Before any deep learning, you have to get PyTorch talking to your GPU — and this is where more beginners quit than at any other step. You run the obvious command:</p><pre>pip install torch torchvision torchaudio</pre><p>No errors. Feels great. Then:</p><pre>import torch<br>print(torch.cuda.is_available())   # False  😤</pre><p>Or worse, a runtime explosion like <em>“The NVIDIA driver on your system is too old.”</em> You Google it, and the internet tells you to upgrade drivers, downgrade PyTorch, and reinstall CUDA from scratch. Most of that advice is wrong.</p><p><strong>Here’s the mental model that fixes 90% of these problems.</strong></p><p>There are three different “CUDA” things, and people constantly confuse them:</p><ol><li><strong>The NVIDIA driver</strong> — lives on your machine, ships a <em>driver API</em> version. Check it with nvidia-smi (top-right corner).</li><li><strong>The CUDA runtime that PyTorch bundles</strong> — PyTorch wheels ship their <em>own</em> CUDA runtime. You do <strong>not</strong> need a system-wide CUDA toolkit installed for PyTorch to work.</li><li><strong>The system CUDA toolkit</strong> (nvcc) — only needed if you&#39;re compiling custom CUDA kernels. For 95% of users, irrelevant.</li></ol><p>The pip install torch default sometimes grabs a build compiled against a CUDA version your driver doesn&#39;t support — or a CPU-only build. The error message blames your driver, but the real fix is to install the PyTorch wheel that matches your driver&#39;s capability.</p><p><strong>The one-command escape.</strong> Check your driver’s max CUDA version with nvidia-smi, then install the matching wheel from PyTorch&#39;s official index. For a modern driver supporting CUDA 12.4:</p><pre>pip install torch torchvision torchaudio \<br>  --index-url https://download.pytorch.org/whl/cu124</pre><blockquote><strong><em>Why this matters (for the skim readers):</em></strong><em> The driver is </em>backward compatible<em> — a newer driver runs older CUDA runtimes fine. So the fix is almost never “upgrade the driver.” It’s “install the PyTorch build that targets a CUDA version ≤ what your driver supports.” Knowing this saves hours and signals you actually understand the stack instead of copy-pasting Stack Overflow.</em></blockquote><p>Verify properly — don’t just trust is_available():</p><pre>import torch</pre><pre>print(&quot;PyTorch:&quot;, torch.__version__)<br>print(&quot;CUDA available:&quot;, torch.cuda.is_available())<br>if torch.cuda.is_available():<br>    print(&quot;Device:&quot;, torch.cuda.get_device_name(0))<br>    print(&quot;CUDA build:&quot;, torch.version.cuda)     # runtime PyTorch was built with<br>    print(&quot;Capability:&quot;, torch.cuda.get_device_capability(0))</pre><p>On Apple Silicon there’s no CUDA at all — you use the Metal backend instead:</p><pre>device = (<br>    &quot;cuda&quot; if torch.cuda.is_available()<br>    else &quot;mps&quot; if torch.backends.mps.is_available()<br>    else &quot;cpu&quot;<br>)</pre><p>That single device string is what we&#39;ll use everywhere below, so the same code runs on an NVIDIA GPU, a Mac, or a laptop CPU.</p><h3>2. Tensors and autograd: the two ideas everything is built on</h3><p>You can’t reason about performance later if you don’t understand what’s actually moving through memory. PyTorch is really just two things wearing a trench coat: <strong>tensors</strong> (n-dimensional arrays that live on a device) and <strong>autograd</strong> (automatic differentiation that records operations so it can compute gradients).</p><pre>import torch</pre><pre># A tensor is data + a device + a dtype.<br>x = torch.randn(3, 4, device=device, dtype=torch.float32)<br>print(x.shape, x.device, x.dtype)</pre><pre># Moving between devices is explicit — and it costs time.<br>y = x.cpu()          # GPU -&gt; CPU copy<br>z = y.to(device)     # CPU -&gt; GPU copy</pre><p>The moment you set requires_grad=True, PyTorch starts building a graph behind the scenes:</p><pre>w = torch.tensor([2.0], requires_grad=True)<br>b = torch.tensor([1.0], requires_grad=True)<br>x = torch.tensor([3.0])</pre><pre>loss = (w * x + b - 10.0) ** 2   # forward pass builds the graph<br>loss.backward()                  # backward pass fills in .grad</pre><pre>print(w.grad)   # d(loss)/dw<br>print(b.grad)   # d(loss)/db</pre><p>That’s the whole magic. Every layer, optimizer, and fancy architecture is built on backward() walking that graph in reverse.</p><blockquote><strong><em>Why this matters:</em></strong><em> Two of the most common (and expensive) bugs in real training come straight from misunderstanding autograd. First, forgetting </em><em>optimizer.zero_grad() — gradients </em>accumulate<em> by default, so skipping it silently corrupts training. Second, holding onto tensors that still carry graph history inside a logging list, which leaks GPU memory until you OOM. When you can explain </em>why<em> </em><em>zero_grad exists, you&#39;re past the tutorial stage.</em></blockquote><p>Two habits worth building now:</p><pre># 1. Detach when you only want the value, not the graph.<br>running_loss += loss.detach().item()</pre><pre># 2. Disable autograd entirely during evaluation — saves memory and time.<br>with torch.no_grad():<br>    preds = model(val_batch)</pre><h3>3. Your first real model: a clean, honest training loop</h3><p>Let’s train an actual classifier. I’ll use a small MLP on FashionMNIST so it runs anywhere in under a minute, but the <em>structure</em> is identical to what you’d use for a ResNet or a transformer. Notice how every piece maps to a concept from Section 2.</p><pre>import torch<br>import torch.nn as nn<br>from torch.utils.data import DataLoader<br>from torchvision import datasets, transforms</pre><pre>device = (<br>    &quot;cuda&quot; if torch.cuda.is_available()<br>    else &quot;mps&quot; if torch.backends.mps.is_available()<br>    else &quot;cpu&quot;<br>)</pre><pre># --- Data ---<br>tfm = transforms.Compose([<br>    transforms.ToTensor(),<br>    transforms.Normalize((0.5,), (0.5,)),<br>])<br>train_ds = datasets.FashionMNIST(root=&quot;./data&quot;, train=True,  download=True, transform=tfm)<br>test_ds  = datasets.FashionMNIST(root=&quot;./data&quot;, train=False, download=True, transform=tfm)</pre><pre>train_loader = DataLoader(train_ds, batch_size=128, shuffle=True,<br>                          num_workers=4, pin_memory=True)<br>test_loader  = DataLoader(test_ds,  batch_size=256, shuffle=False,<br>                          num_workers=4, pin_memory=True)</pre><pre># --- Model ---<br>class MLP(nn.Module):<br>    def __init__(self, in_dim=28 * 28, hidden=256, classes=10):<br>        super().__init__()<br>        self.net = nn.Sequential(<br>            nn.Flatten(),<br>            nn.Linear(in_dim, hidden),<br>            nn.ReLU(),<br>            nn.Dropout(0.2),<br>            nn.Linear(hidden, classes),<br>        )</pre><pre>    def forward(self, x):<br>        return self.net(x)</pre><pre>model = MLP().to(device)<br>criterion = nn.CrossEntropyLoss()<br>optimizer = torch.optim.AdamW(model.parameters(), lr=3e-4)</pre><p>The loop itself. Read the comments — they’re the four moves that repeat forever in deep learning:</p><pre>def train_one_epoch(model, loader, criterion, optimizer, device):<br>    model.train()<br>    running_loss = 0.0<br>    for images, labels in loader:<br>        images, labels = images.to(device), labels.to(device)</pre><pre>        optimizer.zero_grad()          # 1. clear old gradients<br>        outputs = model(images)        # 2. forward<br>        loss = criterion(outputs, labels)<br>        loss.backward()                # 3. backward (autograd)<br>        optimizer.step()               # 4. update weights</pre><pre>        running_loss += loss.item() * images.size(0)<br>    return running_loss / len(loader.dataset)<br></pre><pre>@torch.no_grad()<br>def evaluate(model, loader, device):<br>    model.eval()<br>    correct = total = 0<br>    for images, labels in loader:<br>        images, labels = images.to(device), labels.to(device)<br>        preds = model(images).argmax(dim=1)<br>        correct += (preds == labels).sum().item()<br>        total += labels.size(0)<br>    return correct / total<br></pre><pre>for epoch in range(5):<br>    loss = train_one_epoch(model, train_loader, criterion, optimizer, device)<br>    acc = evaluate(model, test_loader, device)<br>    print(f&quot;epoch {epoch+1}  loss {loss:.4f}  test_acc {acc:.4f}&quot;)</pre><p>If you understand these ~40 lines, you understand 80% of PyTorch training code in the wild. Everything else is a bigger model, more data, or a fancier optimizer plugged into this exact skeleton.</p><blockquote><strong><em>Why this matters:</em></strong><em> Notice </em><em>pin_memory=True and </em><em>num_workers=4 in the DataLoader — those aren&#39;t decoration. On a GPU, data loading is frequently the bottleneck, and a starved GPU is money on fire. The </em><em>@torch.no_grad() decorator on </em><em>evaluate is the same idea: don&#39;t pay for gradient machinery you won&#39;t use. Small choices, real cost. This is the bridge to the next two sections.</em></blockquote><h3>4. Scaling up: bigger models, same laptop</h3><p>“At scale” doesn’t have to mean a 64-GPU cluster. The first wins come from using the <em>one</em> GPU you have properly. Here are the techniques in rough order of return-on-effort.</p><h3>4.1 Mixed precision (the highest-leverage two lines in deep learning)</h3><p>Modern GPUs run half-precision (FP16/BF16) math dramatically faster than FP32, and use roughly half the memory. PyTorch’s automatic mixed precision (AMP) handles the numerically-risky parts for you:</p><pre>from torch.amp import autocast, GradScaler</pre><pre>scaler = GradScaler(device=&quot;cuda&quot;)</pre><pre>def train_amp(model, loader, criterion, optimizer, device):<br>    model.train()<br>    for images, labels in loader:<br>        images, labels = images.to(device), labels.to(device)<br>        optimizer.zero_grad()</pre><pre>        with autocast(device_type=&quot;cuda&quot;, dtype=torch.float16):<br>            outputs = model(images)<br>            loss = criterion(outputs, labels)</pre><pre>        scaler.scale(loss).backward()   # scale loss to avoid FP16 underflow<br>        scaler.step(optimizer)<br>        scaler.update()</pre><p>Typical result on a real model: <strong>1.5–3× faster training and ~40% less memory</strong>, often with no measurable accuracy loss. That extra memory headroom lets you increase batch size, which speeds things up further. This is usually the single best hour you’ll spend optimizing.</p><h3>4.2 Let the compiler help: torch.compile</h3><p>One line wraps your model in a JIT compiler that fuses operations and cuts Python overhead:</p><pre>model = torch.compile(model)   # PyTorch 2.x</pre><p>The first batch is slow (it’s compiling); every batch after is faster. Gains vary from negligible to 2×+ depending on the model.</p><h3>4.3 Squeeze the DataLoader</h3><p>A GPU waiting on data is the most common invisible bottleneck. Cheap wins:</p><pre>train_loader = DataLoader(<br>    train_ds,<br>    batch_size=256,<br>    shuffle=True,<br>    num_workers=8,          # parallel CPU workers feeding the GPU<br>    pin_memory=True,        # faster host-&gt;device transfer<br>    persistent_workers=True,# don&#39;t respawn workers every epoch<br>    prefetch_factor=4,      # stage batches ahead of time<br>)</pre><h3>4.4 Multi-GPU when you actually need it: DistributedDataParallel</h3><p>When one GPU truly isn’t enough, the modern answer is <strong>DDP</strong> (not the old DataParallel). Each GPU runs its own process on a shard of the data, and gradients are synchronized after each backward pass. The training logic barely changes:</p><pre># train_ddp.py  — launched with: torchrun --nproc_per_node=4 train_ddp.py<br>import os, torch<br>import torch.distributed as dist<br>from torch.nn.parallel import DistributedDataParallel as DDP<br>from torch.utils.data.distributed import DistributedSampler</pre><pre>def main():<br>    dist.init_process_group(backend=&quot;nccl&quot;)<br>    rank = int(os.environ[&quot;LOCAL_RANK&quot;])<br>    torch.cuda.set_device(rank)</pre><pre>    model = MLP().to(rank)<br>    model = DDP(model, device_ids=[rank])</pre><pre>    sampler = DistributedSampler(train_ds)   # each rank sees a unique shard<br>    loader = DataLoader(train_ds, batch_size=128, sampler=sampler,<br>                        num_workers=4, pin_memory=True)</pre><pre>    optimizer = torch.optim.AdamW(model.parameters(), lr=3e-4)<br>    criterion = torch.nn.CrossEntropyLoss()</pre><pre>    for epoch in range(5):<br>        sampler.set_epoch(epoch)             # reshuffle correctly across ranks<br>        for images, labels in loader:<br>            images, labels = images.to(rank), labels.to(rank)<br>            optimizer.zero_grad()<br>            loss = criterion(model(images), labels)<br>            loss.backward()<br>            optimizer.step()</pre><pre>    dist.destroy_process_group()</pre><pre>if __name__ == &quot;__main__&quot;:<br>    main()</pre><blockquote><strong><em>Why this matters:</em></strong><em> The instinct of a junior engineer facing “too slow” is to ask for a bigger GPU. The instinct of a senior one is to ask </em>where the time is actually going<em> — and usually find it’s data loading or FP32 waste before it’s raw compute. DDP is powerful, but reaching for it before you’ve turned on AMP and fixed your DataLoader is spending cluster money to paper over a config problem. Which is exactly why the next section exists.</em></blockquote><h3>5. Don’t guess — profile: where your money is actually going</h3><p>This is the part almost nobody teaches, and it’s where you stop draining your budget on the wrong thing. <strong>A “fancy” architecture is often just too heavy for your data and hardware, and profiling is how you prove it</strong> instead of arguing about it.</p><h3>5.1 The built-in PyTorch profiler</h3><pre>from torch.profiler import profile, record_function, ProfilerActivity</pre><pre>model.eval()<br>inputs = torch.randn(256, 1, 28, 28, device=device)</pre><pre>with profile(<br>    activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],<br>    record_shapes=True,<br>    profile_memory=True,<br>) as prof:<br>    with record_function(&quot;model_inference&quot;):<br>        with torch.no_grad():<br>            model(inputs)</pre><pre># Sort by GPU time to find the real hotspots.<br>print(prof.key_averages().table(sort_by=&quot;cuda_time_total&quot;, row_limit=15))</pre><p>You’ll get a table with columns like Self CUDA %, CUDA total, and memory usage per operator. <strong>Reading it is a skill in itself:</strong></p><ul><li><strong>Self CUDA time</strong> — time spent <em>inside</em> an op, not its children. High self-time ops are your true hotspots and your first optimization targets.</li><li><strong>A giant gap between total CPU time and total CUDA time</strong> usually means the GPU is <em>idle</em>, waiting on the CPU or the data pipeline — a scheduling/loading problem, not a compute one.</li><li><strong>aten::copy_ or </strong><strong>to dominating</strong> means you&#39;re shuffling tensors between devices too often. Move less, or move it once.</li><li><strong>Memory column spiking</strong> points at where to apply AMP, gradient checkpointing, or a smaller batch.</li></ul><p>Export a trace and open it in chrome://tracing or Perfetto for a visual timeline:</p><pre>prof.export_chrome_trace(&quot;trace.json&quot;)</pre><h3>5.2 The one-liner version: PyTorch Lightning’s profiler</h3><p>If you use <a href="https://lightning.ai/">PyTorch Lightning</a>, you get profiling for the cost of a single argument — great for a quick read on where a training step spends its time:</p><pre>from lightning import Trainer</pre><pre>trainer = Trainer(profiler=&quot;simple&quot;)     # or &quot;advanced&quot;, or PyTorchProfiler(...)<br>trainer.fit(model, train_loader)</pre><p>The <strong>“simple”</strong> profiler prints a table of the mean duration and total time for each stage of the training loop — run_training_epoch, training_step, optimizer_step, get_train_batch, and so on. How you read that table is the whole game:</p><ul><li>If <strong>get_train_batch</strong> (data fetching) is a large share of each step, your GPU is starving — fix the DataLoader (Section 4.3) before anything else.</li><li>If <strong>training_step</strong> dominates and the model is already lean, that&#39;s genuine compute — reach for AMP or torch.compile.</li><li>If <strong>validation_step</strong> is disproportionately large, check that you&#39;re under no_grad and not accidentally running it too often.</li><li>If the <strong>total time</strong> is enormous but per-step time is small, you’re simply running too many steps/epochs — early stopping or a smaller model may match accuracy for a fraction of the cost.</li></ul><blockquote><strong><em>Why this matters:</em></strong><em> This is the mindset the reference articles were circling around — </em>train without draining your pocket.<em> The point isn’t to worship the biggest model; it’s to right-size the model to the data and hardware, and profiling is the evidence. Being able to open a profiler table and say “we’re data-bound, not compute-bound, so a bigger GPU won’t help — fix the loader” is precisely the kind of judgment that reads as senior in an interview or a code review.</em></blockquote><h3>6. Habits that make PyTorch code production-grade</h3><p>A few things that rarely appear in tutorials but always appear in good codebases:</p><p><strong>Reproducibility — seed everything.</strong></p><pre>import random, numpy as np, torch</pre><pre>def set_seed(seed=42):<br>    random.seed(seed); np.random.seed(seed); torch.manual_seed(seed)<br>    torch.cuda.manual_seed_all(seed)</pre><p><strong>Checkpoint the full state, not just weights</strong> — so you can actually resume:</p><pre>torch.save({<br>    &quot;epoch&quot;: epoch,<br>    &quot;model&quot;: model.state_dict(),<br>    &quot;optimizer&quot;: optimizer.state_dict(),<br>    &quot;scaler&quot;: scaler.state_dict(),   # if using AMP<br>}, &quot;checkpoint.pt&quot;)</pre><p><strong>Separate the model definition from the training script.</strong> A model.py you can import, and a train.py that orchestrates. It makes your work reviewable — and reviewability is a career skill, not just a coding one.</p><p><strong>Log metrics somewhere real</strong> (TensorBoard, Weights &amp; Biases, or MLflow) instead of print. Interviewers notice when your experiments are tracked.</p><h3>7. A 30-day path to learning this fast</h3><p>If you’re starting out, resist the urge to jump straight to transformers. Depth compounds; breadth-first flailing doesn’t.</p><ul><li><strong>Week 1 — Foundations.</strong> Tensors, autograd, and the training loop from Sections 2–3. Rebuild the FashionMNIST classifier from memory, no copy-pasting.</li><li><strong>Week 2 — Real architectures.</strong> Swap the MLP for a small CNN, then fine-tune a pretrained ResNet with torchvision.models. Learn transfer learning — it&#39;s how most real work actually gets done.</li><li><strong>Week 3 — Make it fast.</strong> Add AMP, torch.compile, and a tuned DataLoader. Profile before and after and <em>write down the numbers.</em> That before/after delta is portfolio gold.</li><li><strong>Week 4 — Scale and ship.</strong> Run a DDP job across two GPUs (rent them by the hour), add checkpointing and experiment tracking, and package it as a clean repo with a README.</li></ul><p>By the end you won’t just “know PyTorch” — you’ll have a repository that demonstrates you can take a model from a notebook to something efficient and scalable. That artifact is worth more than any certificate.</p><h3>Closing thought</h3><p>The gap between a beginner and a strong practitioner isn’t knowing more layer types. It’s understanding what happens under the hood — where memory goes, where time goes, where money goes — and making deliberate choices about it. Install cleanly, understand autograd, write an honest loop, then <em>measure before you optimize.</em></p><p>Do that, and you’ll train better models on smaller budgets than people running ten times your hardware. That’s the whole game.</p><p><em>If this was useful, follow along — I write about making machine learning practical, efficient, and production-ready. Questions and corrections welcome.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65c41fe98dc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to CRUD in Neo4j]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/a-practical-guide-to-crud-in-neo4j-8a3f6dff82b4?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a3f6dff82b4</guid>
            <category><![CDATA[graph-database]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cypher]]></category>
            <category><![CDATA[neo4j]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 11:38:45 GMT</pubDate>
            <atom:updated>2026-07-02T11:38:45.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8G8d7NF3dkWgEioarwzBUg.png" /></figure><p>Create, query, update, and delete data in a graph database using Cypher.</p><p>Relational databases store data in rows and tables. Graph databases like <strong>Neo4j</strong> store data as <em>nodes</em> connected by <em>relationships</em> — which makes them a natural fit for anything where connections matter: social networks, recommendation engines, fraud detection, and knowledge graphs.</p><p>In this guide we’ll walk through the four operations at the heart of any database — <strong>Create, Read, Update, Delete (CRUD)</strong> — using Neo4j’s query language, <strong>Cypher</strong>. By the end you’ll be able to build a small graph, ask questions of it, change it, and clean it up.</p><blockquote>All the queries below run in the Neo4j Browser, Neo4j Aura, or through any Neo4j driver. If you’ve loaded the built-in :play movies dataset, most of these will feel familiar.</blockquote><h3>The Building Blocks: Nodes and Relationships</h3><p>Before writing queries, it helps to know how Cypher describes a graph visually in text:</p><ul><li><strong>Nodes</strong> are written in parentheses: (p:Person) — here p is a variable and Person is a label.</li><li><strong>Properties</strong> live inside curly braces: (p:Person {name: &#39;Kevin Bacon&#39;, born: 1958}).</li><li><strong>Relationships</strong> are drawn as arrows with square brackets: (p)-[:ACTED_IN]-&gt;(m:Movie).</li></ul><p>Read that last line out loud and it makes sense: a <em>Person</em> <em>acted in</em> a <em>Movie</em>. That readability is Cypher’s superpower.</p><h3>1. Create — Adding Nodes and Relationships</h3><p>The CREATE clause makes new nodes. Let&#39;s add a movie and an actor.</p><pre>CREATE (m:Movie {title: &#39;Get Out&#39;, released: 2017,<br>                 tagline: &#39;Just because you&#39;re invited, doesn&#39;t mean you&#39;re welcome.&#39;})<br>RETURN m</pre><p>To create a relationship, match the nodes you want to connect (or create them inline) and draw the arrow between them:</p><pre>MATCH (p:Person {name: &#39;Daniel Kaluuya&#39;})<br>MATCH (m:Movie {title: &#39;Get Out&#39;})<br>CREATE (p)-[:ACTED_IN {roles: [&#39;Chris&#39;]}]-&gt;(m)<br>RETURN p, m</pre><h3>MERGE: create only if it doesn’t already exist</h3><p>CREATE always makes a new node — run it twice and you get duplicates. When you want &quot;create it if missing, otherwise reuse it,&quot; use MERGE:</p><pre>MERGE (m:Movie {title: &#39;Rocketman&#39;})<br>ON CREATE SET m.createdAt = datetime()<br>ON MATCH  SET m.updatedAt = datetime()<br>SET m.tagline  = &#39;The Only Way to Tell His Story is to Live His Fantasy.&#39;,<br>    m.released = 2019<br>RETURN m</pre><p>The ON CREATE block runs only when the node is brand new; ON MATCH runs only when it already existed. This is the standard pattern for safe, repeatable &quot;upserts.&quot;</p><h3>2. Read — Querying the Graph</h3><p>Reading is done with MATCH to describe a pattern and RETURN to choose what comes back.</p><p>Find a single property:</p><pre>MATCH (p:Person {name: &#39;Kevin Bacon&#39;})<br>RETURN p.born</pre><p>Follow a relationship — who directed <em>Cloud Atlas</em>?</p><pre>MATCH (m:Movie {title: &#39;Cloud Atlas&#39;})&lt;-[:DIRECTED]-(p:Person)<br>RETURN p.name</pre><p>Note the arrow direction: &lt;-[:DIRECTED]- reads &quot;was directed by.&quot;</p><h3>Filtering with WHERE</h3><p>The WHERE clause filters your matches. It uses dot notation (p.born), and property names are case-sensitive.</p><pre>MATCH (p:Person)-[:ACTED_IN]-&gt;(m:Movie)<br>WHERE m.title = &#39;As Good as It Gets&#39; AND p.born &gt; 1960<br>RETURN p.name</pre><blockquote><strong>Common beginner mistake:</strong> access properties with a dot, not a colon. Write p.born, never p:born. A colon is reserved for labels like :Person.</blockquote><h3>3. Update — Changing Existing Data</h3><p>Use SET to add or overwrite properties. To change more than one property, separate them with <strong>commas</strong> — not AND:</p><pre>MATCH (m:Movie {title: &#39;Get Out&#39;})<br>SET m.tagline  = &#39;Gripping, scary, witty and timely!&#39;,<br>    m.released = 2017<br>RETURN m.title, m.tagline, m.released</pre><p>You can also add a new label to an existing node with SET:</p><pre>MATCH (p:Person {name: &#39;Jordan Peele&#39;})<br>SET p:Director<br>RETURN labels(p)</pre><p>And remove a property or label with REMOVE:</p><pre>MATCH (m:Movie {title: &#39;Get Out&#39;})<br>REMOVE m.tagline<br>RETURN m</pre><h3>4. Delete — Removing Data</h3><p>DELETE removes nodes and relationships. The catch: <strong>you cannot delete a node that still has relationships</strong> attached — Neo4j protects you from leaving dangling arrows.</p><p>Delete a relationship only:</p><pre>MATCH (p:Person {name: &#39;Daniel Kaluuya&#39;})-[r:ACTED_IN]-&gt;(m:Movie {title: &#39;Get Out&#39;})<br>DELETE r</pre><p>To remove a node <em>and</em> all its relationships in one shot, use DETACH DELETE:</p><pre>MATCH (m:Movie {title: &#39;Get Out&#39;})<br>DETACH DELETE m</pre><blockquote><strong>Handle with care:</strong> the query below deletes your entire database. Only run it on scratch data.</blockquote><pre>MATCH (n)<br>DETACH DELETE n</pre><h3>Quick Reference</h3><p>OperationClausePurposeCreateCREATE / MERGEAdd nodes &amp; relationships (MERGE = create-if-missing)ReadMATCH … WHERE … RETURNFind and return dataUpdateSET / REMOVEChange properties and labelsDeleteDELETE / DETACH DELETERemove relationships and nodes</p><h3>Gotchas Worth Memorizing</h3><ul><li>Use a <strong>dot</strong> for properties (m.title) and a <strong>colon</strong> for labels (:Movie).</li><li>Separate multiple SET assignments with <strong>commas</strong>, not AND.</li><li>Property and label names are <strong>case-sensitive</strong>: born ≠ Born.</li><li>Prefer MERGE over CREATE when a node might already exist, to avoid duplicates.</li><li>Reach for DETACH DELETE when a node still has relationships.</li></ul><h3>Wrapping Up</h3><p>That’s the full CRUD lifecycle in Neo4j: CREATE/MERGE to build your graph, MATCH to explore it, SET to evolve it, and DELETE to tidy up. Cypher&#39;s pattern syntax means your queries look like the graph they describe — once that clicks, working with connected data starts to feel less like writing SQL and more like drawing a picture.</p><p>The best next step is to open the Neo4j Browser, load the sample movie graph with :play movies, and try each query above against real data. Change a title, follow a relationship, break something, and fix it. That&#39;s how the patterns stick.</p><p><em>Happy graphing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a3f6dff82b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run the Neo4j MCP Server Locally with Docker (No Codespaces Needed)]]></title>
            <link>https://pub.towardsai.net/run-the-neo4j-mcp-server-locally-with-docker-no-codespaces-needed-b9a3792562ef?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9a3792562ef</guid>
            <category><![CDATA[model-context-protocol]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[graph-database]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 06:50:27 GMT</pubDate>
            <atom:updated>2026-07-01T07:18:39.437Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zWzUJVc_Khke_qTIVkQAQA.png" /></figure><h4><em>A 30-minute, copy-paste guide to running Neo4j’s official MCP server on your own machine, connecting it to VS Code, and using it to explore a graph — completely free.</em></h4><p>Neo4j’s GraphAcademy course <em>“Developing with Neo4j MCP Tools”</em> is excellent, but it assumes you’ll run everything inside a GitHub Codespace. Codespaces have a monthly free limit, and once you hit it you’re stuck — unless you self-host.</p><p>Good news: you don’t need Codespaces at all. The MCP server is just a small program, and you can run the whole stack locally with Docker in about half an hour. This guide walks through exactly that, and along the way you’ll pick up how MCP actually fits together.</p><p>Everything below has been tested end-to-end.</p><h3>What you’ll build</h3><pre>VS Code (host)  ──HTTP /mcp + auth──►  neo4j-mcp (server)  ──Bolt──►  Neo4j (database)</pre><p>Three separate pieces — and understanding the split is half the battle:</p><ul><li><strong>Host</strong> — your MCP client (VS Code, Claude Desktop, Cursor). It speaks MCP and knows nothing about Neo4j.</li><li><strong>MCP server</strong> — neo4j-mcp, the bridge. It turns MCP tool calls like read-cypher into real Bolt queries.</li><li><strong>Database</strong> — Neo4j itself.</li></ul><p>A common misconception: there is <strong>no remote “MCP database” somewhere in the cloud</strong>. The MCP server is a program <em>you</em> run. It connects out to whatever database you point it at.</p><h3>Prerequisites (5 minutes)</h3><ul><li><strong>Docker Desktop</strong> installed and running — check with docker --version</li><li><strong>VS Code</strong> with MCP support — <a href="https://code.visualstudio.com/">code.visualstudio.com</a></li><li>A terminal</li></ul><p>That’s it. No local Python, no Neo4j install — Docker handles both.</p><h3>Step 1 — Create the Docker stack (5 minutes)</h3><p>Make a project folder and drop in a docker-compose.yml:</p><pre>services:<br>  neo4j:<br>    image: neo4j:5.26<br>    container_name: neo4j<br>    ports:<br>      - &quot;7474:7474&quot;          # Neo4j Browser  -&gt; http://localhost:7474<br>      - &quot;7687:7687&quot;          # Bolt<br>    environment:<br>      NEO4J_AUTH: &quot;neo4j/password123&quot;<br>      NEO4J_PLUGINS: &#39;[&quot;apoc&quot;,&quot;graph-data-science&quot;]&#39;   # needed for get-schema + GDS tool<br>    volumes:<br>      - neo4j_data:/data<br>    healthcheck:<br>      test: [&quot;CMD-SHELL&quot;, &quot;cypher-shell -u neo4j -p password123 &#39;RETURN 1&#39; || exit 1&quot;]<br>      interval: 10s<br>      timeout: 10s<br>      retries: 12<br>      start_period: 30s</pre><pre>  neo4j-mcp:<br>    build:<br>      context: &quot;https://github.com/neo4j/mcp.git#v1.5.2&quot;   # builds the official server from source<br>    container_name: neo4j-mcp<br>    depends_on:<br>      neo4j:<br>        condition: service_healthy<br>    ports:<br>      - &quot;8000:8000&quot;          # MCP endpoint -&gt; <a href="http://localhost:8000/mcp">http://localhost:8000/mcp</a><br>    environment:<br>      NEO4J_URI: &quot;bolt://neo4j:7687&quot;<br>      NEO4J_DATABASE: &quot;neo4j&quot;<br>      NEO4J_TRANSPORT_MODE: &quot;http&quot;     # networked service, not a stdio subprocess<br>      NEO4J_MCP_HTTP_HOST: &quot;0.0.0.0&quot;   # bind all interfaces so the host can reach it<br>      NEO4J_MCP_HTTP_PORT: &quot;8000&quot;      # must be &gt;1024 (container runs as non-root)</pre><pre>volumes:<br>  neo4j_data:</pre><p><strong>Two things worth knowing here:</strong></p><ul><li><strong>http transport, not </strong><strong>stdio.</strong> The course runs the server in <em>stdio</em> mode, where the host launches the server as a child process. We instead run it as a standalone HTTP service — closer to how you&#39;d deploy it for real, and it lets any client connect over a URL.</li><li><strong>Why these exact values matter:</strong> the container runs as a non-root user, so it <em>cannot</em> bind a port below 1024 (hence 8000, not 80). And in HTTP mode the server refuses NEO4J_USERNAME/NEO4J_PASSWORD env vars on purpose — credentials arrive per request via HTTP Basic Auth. That&#39;s the production auth model, so we leave them off.</li></ul><h3>Step 2 — Bring it up (5 minutes, mostly waiting)</h3><pre>docker compose up -d --build</pre><p>First run pulls the Neo4j image, builds the Go MCP server, and downloads the APOC + GDS plugins. Give it a minute, then check both containers are up:</p><pre>docker compose ps</pre><p>Wait until neo4j shows (healthy).</p><h3>Step 3 — Verify the server (5 minutes)</h3><p>The MCP endpoint is http://localhost:8000/mcp. Don&#39;t open it in a browser — you&#39;ll get Method Not Allowed: only POST is supported, which is actually a <em>good sign</em> (the server is up; browsers just send GET).</p><p>Test it properly with curl. First, confirm auth is enforced:</p><pre>curl -i -X POST http://localhost:8000/mcp        # expect 401 Unauthorized</pre><p>Now list the tools, authenticating with the database credentials (neo4j:password123):</p><pre>curl -s -u neo4j:password123 -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;tools/list&quot;,&quot;id&quot;:1}&#39; \<br>  http://localhost:8000/mcp</pre><p>You should see: get-schema, read-cypher, write-cypher.</p><h3>The “why do I only see 3 tools?” gotcha</h3><p>The course lists <strong>four</strong> tools — the fourth is list-gds-procedures. If it&#39;s missing, don&#39;t panic. That tool is registered <em>lazily during the MCP </em><em>initialize handshake</em>, and only if Graph Data Science is installed. A bare tools/list curl skips initialize, so it never appears that way.</p><p>Send an initialize request first, then list again:</p><pre>curl -s -u neo4j:password123 -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;initialize&quot;,&quot;params&quot;:{&quot;protocolVersion&quot;:&quot;2024-11-05&quot;,&quot;capabilities&quot;:{},&quot;clientInfo&quot;:{&quot;name&quot;:&quot;t&quot;,&quot;version&quot;:&quot;1&quot;}},&quot;id&quot;:1}&#39; \<br>  http://localhost:8000/mcp</pre><pre>curl -s -u neo4j:password123 -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;tools/list&quot;,&quot;id&quot;:2}&#39; \<br>  <a href="http://localhost:8000/mcp">http://localhost:8000/mcp</a></pre><p>Now all <strong>four</strong> appear. (Real MCP clients like VS Code do the initialize step automatically — this only bites you with raw curl.)</p><h3>Step 4 — Connect VS Code (5 minutes)</h3><p>In your project, create .vscode/mcp.json:</p><pre>{<br>    &quot;servers&quot;: {<br>        &quot;neo4j&quot;: {<br>            &quot;type&quot;: &quot;http&quot;,<br>            &quot;url&quot;: &quot;http://localhost:8000/mcp&quot;,<br>            &quot;headers&quot;: {<br>                &quot;Authorization&quot;: &quot;Basic bmVvNGo6cGFzc3dvcmQxMjM=&quot;<br>            }<br>        }<br>    }<br>}</pre><p>That Authorization value is just base64 of neo4j:password123. If you change the password, regenerate it:</p><pre>printf &#39;neo4j:yourpassword&#39; | base64</pre><blockquote><em>⚠️ </em><strong><em>Most common mistake:</em></strong><em> using the course’s </em>stdio<em> config (</em><em>&quot;type&quot;: &quot;stdio&quot;, &quot;command&quot;: &quot;neo4j-mcp&quot;) with this Docker setup. That tells VS Code to launch a local binary you don&#39;t have. For the containerized server you must use the </em><strong><em>http</em></strong><em> config above.</em></blockquote><p>Then in VS Code: Cmd/Ctrl + Shift + P → <strong>MCP: List Servers</strong> → select <strong>neo4j</strong> → <strong>Start Server</strong>. Open Chat in <strong>Agent mode</strong> (Cmd/Ctrl + Shift + I) and ask:</p><blockquote><em>Which MCP tools are available? List their ID and description.</em></blockquote><p>You’ll get all four tools back.</p><h3>Step 5 — Actually use it (5 minutes)</h3><p>Your local database is empty, so let’s point a second, throwaway MCP container at Neo4j’s public <strong>movies</strong> demo database — the same dataset the course uses — on a different port. This leaves your main stack untouched:</p><pre>docker run --rm -d --name mcp-movies \<br>  -e NEO4J_URI=&quot;neo4j+s://demo.neo4jlabs.com&quot; \<br>  -e NEO4J_DATABASE=&quot;recommendations&quot; \<br>  -e NEO4J_TRANSPORT_MODE=&quot;http&quot; \<br>  -e NEO4J_MCP_HTTP_HOST=&quot;0.0.0.0&quot; \<br>  -e NEO4J_MCP_HTTP_PORT=&quot;8001&quot; \<br>  -p 8001:8001 \<br>  &lt;your-project-name&gt;-neo4j-mcp</pre><p>(The image name is whatever docker compose built — check docker images; it looks like yourfolder-neo4j-mcp.)</p><p><strong>Read the schema</strong> — what relationships does a User have?</p><pre>curl -s -u recommendations:recommendations -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;tools/call&quot;,&quot;params&quot;:{&quot;name&quot;:&quot;read-cypher&quot;,&quot;arguments&quot;:{&quot;query&quot;:&quot;MATCH (u:User)-[r]-&gt;() RETURN DISTINCT type(r) AS rel&quot;}},&quot;id&quot;:2}&#39; \<br>  http://localhost:8001/mcp</pre><p>Result: RATED — i.e. (:User)-[:RATED]-&gt;(:Movie).</p><p><strong>Generate a query</strong> — the highest-rated movie (note the non-null guard, since not every movie has a rating):</p><pre>curl -s -u recommendations:recommendations -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;tools/call&quot;,&quot;params&quot;:{&quot;name&quot;:&quot;read-cypher&quot;,&quot;arguments&quot;:{&quot;query&quot;:&quot;MATCH (m:Movie) WHERE m.imdbRating IS NOT NULL RETURN m.title AS title, m.imdbRating AS rating ORDER BY m.imdbRating DESC LIMIT 1&quot;}},&quot;id&quot;:3}&#39; \<br>  http://localhost:8001/mcp</pre><p>When you’re done with the demo:</p><pre>docker stop mcp-movies</pre><h3>Step 6 — Build a real app on top (bonus, 5 minutes)</h3><p>The course’s capstone is “vibe coding” a Python CLI that returns the top 5 movies in a genre. Here’s a clean, dependency-light version. The genre is passed as a <strong>query parameter</strong> (never string-concatenated) and the query filters out null ratings:</p><pre>import os, sys<br>from neo4j import GraphDatabase</pre><pre>QUERY = &quot;&quot;&quot;<br>MATCH (m:Movie)-[:IN_GENRE]-&gt;(:Genre {name: $genre})<br>WHERE m.imdbRating IS NOT NULL<br>RETURN m.title AS title, m.imdbRating AS rating<br>ORDER BY m.imdbRating DESC<br>LIMIT 5<br>&quot;&quot;&quot;</pre><pre>def main():<br>    uri = os.environ[&quot;NEO4J_URI&quot;]<br>    user = os.environ[&quot;NEO4J_USERNAME&quot;]<br>    pwd = os.environ[&quot;NEO4J_PASSWORD&quot;]<br>    db = os.environ.get(&quot;NEO4J_DATABASE&quot;, &quot;neo4j&quot;)</pre><pre>    genre = input(&quot;Enter a movie genre: &quot;).strip()<br>    with GraphDatabase.driver(uri, auth=(user, pwd)) as driver:<br>        driver.verify_connectivity()<br>        records, _, _ = driver.execute_query(QUERY, genre=genre, database_=db)</pre><pre>    print(f&quot;\nTop {len(records)} &#39;{genre}&#39; movies:&quot;)<br>    for i, r in enumerate(records, 1):<br>        print(f&quot;  {i}. {r[&#39;title&#39;]} ({r[&#39;rating&#39;]})&quot;)</pre><pre>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>Run it against the demo database:</p><pre>pip install neo4j<br>export NEO4J_URI=&quot;neo4j+s://demo.neo4jlabs.com&quot;<br>export NEO4J_USERNAME=&quot;recommendations&quot;<br>export NEO4J_PASSWORD=&quot;recommendations&quot;<br>export NEO4J_DATABASE=&quot;recommendations&quot;<br>python3 movie_recommender.py      # then type: Mystery</pre><h3>Wrapping up</h3><p>In about 30 minutes you’ve stood up the full Neo4j MCP stack locally — no Codespaces, no cloud bill:</p><ul><li>Neo4j (with APOC + GDS) and the official neo4j-mcp server, both in Docker</li><li>The MCP server running as an authenticated HTTP service</li><li>VS Code connected to it in Agent mode</li><li>Real queries through the MCP tools, plus a small Python app on top</li></ul><h3>Why this matters</h3><p>It’s tempting to see this as just “avoiding a paywall,” but the self-hosted setup teaches something more useful. MCP is quietly becoming the standard way AI agents reach real systems — databases, APIs, internal tools — and the interesting engineering questions live exactly where we ended up: <em>How is the server transported? How are requests authenticated? What stops an agent from running a destructive query?</em></p><p>Running the server yourself over HTTP, with per-request auth and a read-only switch, surfaces those questions in a way a pre-baked cloud sandbox hides. As more teams put agents in front of production data, the ability to run an MCP server as a controlled, observable service — rather than a mystery box someone else hosts — stops being a nice-to-have. The 30 minutes you spent here map directly onto how you’d deploy the same server behind a gateway with TLS and a secrets manager for real.</p><h3>Troubleshooting cheat sheet</h3><p>SymptomCause / FixMethod Not Allowed in browserYou sent a GET. The endpoint is POST-only — use curl or a client.401 UnauthorizedMissing/wrong Basic Auth. Use the DB username:password.Only 3 tools listedSend an initialize request first; ensure APOC + GDS are installed.get-schema errorsAPOC not installed — add it to NEO4J_PLUGINS.MCP server won&#39;t start, complains about username/passwordYou set NEO4J_USERNAME/PASSWORD in HTTP mode. Remove them.VS Code says server &quot;requires interaction to start&quot;Your mcp.json is using the stdio config. Switch to the http config.Permission denied binding portKeep NEO4J_MCP_HTTP_PORT above 1024 (container is non-root).</p><h3>Where to go next</h3><ul><li><a href="https://neo4j.com/docs/mcp/current/">Neo4j MCP server docs</a></li><li><a href="https://github.com/neo4j/mcp">Neo4j MCP repository</a></li><li><a href="https://modelcontextprotocol.io/">Official MCP specification</a></li></ul><p><em>Happy graphing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9a3792562ef" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/run-the-neo4j-mcp-server-locally-with-docker-no-codespaces-needed-b9a3792562ef">Run the Neo4j MCP Server Locally with Docker (No Codespaces Needed)</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Flat Chunks to a Living Knowledge Graph: Why I Rebuilt My RAG System From Scratch]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/from-flat-chunks-to-a-living-knowledge-graph-why-i-rebuilt-my-rag-system-from-scratch-0ee1f6baae26?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ee1f6baae26</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[knowledge-graph-rag]]></category>
            <category><![CDATA[genrative-ai]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 13:13:29 GMT</pubDate>
            <atom:updated>2026-07-01T08:08:03.302Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3IwhBi2T4s8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3IwhBi2T4s8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3IwhBi2T4s8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e19a2d620d390c37180c76ca49a82c65/href">https://medium.com/media/e19a2d620d390c37180c76ca49a82c65/href</a></iframe><h3>From Flat Chunks to a Living Knowledge Graph: Why I Rebuilt My RAG System From Scratch</h3><p>There’s a moment every engineer eventually encounters. You build something that works, users love it, search quality is good, latency is acceptable, and the architecture feels clean. Then you discover a problem your system was never designed to solve.</p><p>That’s exactly what happened to me.</p><h3>The RAG System That Wasn’t Supposed to Fail</h3><p>A few years ago, I built a retrieval system for an Arabic educational platform. The content wasn’t simple text — we were dealing with massive teacher-guide PDFs containing stories, exercises, learning objectives, visual diagrams, tables, Arabic text, assessment material, and educational metadata.</p><p>To make retrieval work, I went deep on enrichment. Every chunk entering Azure AI Search was tagged with extensive metadata: page numbers, book page labels, content type, story position, skills, learning objectives, difficulty level, related exercises, and character references.</p><p>A single chunk looked something like this:</p><pre>{<br>  &quot;Page&quot;: 136,<br>  &quot;BookPageNumber&quot;: &quot;66&quot;,<br>  &quot;ContentType&quot;: &quot;tasnif_story&quot;,<br>  &quot;StoryPosition&quot;: &quot;start&quot;,<br>  &quot;Language&quot;: &quot;ar&quot;<br>}</pre><p>The result was surprisingly effective. Keyword search worked. Vector search worked. Semantic search worked. In many cases, the metadata was so detailed that you could almost reconstruct the original page without opening the PDF.</p><p>For a while, I thought I had solved the problem. I hadn’t.</p><h3>The Question That Broke Everything</h3><p>One day I started noticing a pattern. A concept introduced briefly in Chapter 3 might be fully explained in Chapter 7. A student asks a question whose answer requires information from both locations — and my system only retrieves one.</p><p>Not because the information wasn’t there. Because the system had no idea those two concepts were related.</p><p>The retrieval engine knew everything about individual chunks and almost nothing about relationships. Every chunk lived alone: no hierarchy, no context, no connections — just vectors floating in space.</p><p>That was the first crack.</p><h3>Then the Real Problems Appeared</h3><p>As the system evolved, three limitations became impossible to ignore.</p><h3>1. Knowledge Had No Structure</h3><p>Documents are not collections of independent chunks — they’re hierarchies. A section belongs to a chapter, a chapter belongs to a book, and a concept references another concept. Traditional RAG flattens all of this into embeddings, and the structure disappears.</p><h3>2. RBAC Became Ugly</h3><p>Some content needed role-based restrictions: teachers could access certain materials, students could not. Enforcing that at the retrieval layer felt increasingly unnatural. The search engine could filter documents, but permissions weren’t part of the knowledge model itself — they were external rules, and external rules eventually drift.</p><h3>3. Analytics Was a Dead End</h3><p>Then came structured questions, like:</p><blockquote>Which customers placed the most orders last quarter?</blockquote><blockquote>What’s the average score across exercises in Unit 4?</blockquote><p>These aren’t retrieval problems — they’re aggregation problems. A vector database can retrieve relevant text, but it cannot naturally answer relational business questions.</p><p>At that point I realized I wasn’t trying to build a better search engine. I was trying to build a knowledge system.</p><h3>The Realization: Documents Are Graphs</h3><p>The breakthrough wasn’t GraphRAG. The breakthrough was realizing that documents are already graphs.</p><p>Think about a textbook. A chapter references another chapter. A concept elaborates on a previous concept. An exercise depends on a prerequisite. A glossary term appears across multiple sections. Those relationships exist whether we model them or not — traditional RAG simply ignores them.</p><p>I decided to stop ignoring them.</p><h3>Rebuilding Everything Around Neo4j</h3><p>Instead of storing isolated chunks, I rebuilt the ingestion pipeline around a graph. The hierarchy became explicit:</p><pre>Document<br> └── Chapter<br>      └── Section<br>           └── Page<br>                └── Region</pre><p>Now retrieval wasn’t just similarity search — it became graph navigation. A question could begin in Chapter 3 and traverse into Chapter 7 through actual relationships. The system could finally follow context instead of guessing it.</p><h3>Teaching the Graph Relationships</h3><p>Hierarchy alone wasn’t enough. I wanted the graph to understand meaning, so I introduced a second enrichment layer:</p><ul><li><strong>Semantic similarity</strong> — embedding comparisons create SEMANTICALLY_SIMILAR relationships.</li><li><strong>Entity relationships</strong> — named entities generate SHARES_ENTITY connections.</li><li><strong>Topic clustering</strong> — concepts belonging to similar themes receive SAME_CATEGORY edges.</li><li><strong>LLM-based reasoning</strong> — the expensive but interesting layer. Using LLM evaluation, the system identifies relationships such as ELABORATES, CONTRADICTS, and PREREQUISITE_OF.</li></ul><p>Now the graph doesn’t just know that two sections are similar — it knows <em>how</em> they’re related. That distinction matters.</p><p>Architecture diagram by the author</p><h3>One Graph, Two Worlds</h3><p>At this point I encountered another realization: why maintain separate systems for documents and business data? Neo4j can model both, so I added a second retrieval path.</p><h3>Unstructured Agent</h3><p>Handles PDFs, policies, manuals, and educational content using graph traversal, semantic retrieval, and relationship reasoning.</p><h3>Structured Agent</h3><p>Handles customers, orders, products, and relational datasets using schema-aware Text-to-Cypher, aggregations, and native graph queries.</p><p>For testing, I loaded the classic Northwind dataset. The same graph could answer <em>“What does the compliance manual say about whistleblowing?”</em> and <em>“Which customers generated the highest revenue this quarter?”</em> through a single interface.</p><p>That was the moment the architecture started feeling different.</p><h3>The Most Important Architectural Decision</h3><p>Ironically, retrieval wasn’t the hardest problem — routing was. When a user submits a question, the system first decides: is this a document question, a structured query, or a hybrid query?</p><p>Choosing the wrong retrieval strategy can completely derail an otherwise capable system. A perfect answer from the wrong agent is impossible. A mediocre answer from the correct agent can still improve. Routing became the most critical component in the entire architecture.</p><h3>Why RBAC Belongs Inside the Graph</h3><p>One design choice I would absolutely keep: permissions are modeled as graph relationships, not middleware, not API filters, and not application logic.</p><p>If a user doesn’t have a path to a knowledge graph, the traversal simply cannot happen — no special case, no hidden filtering, no after-the-fact enforcement. The graph itself defines what is reachable. That makes security far easier to reason about.</p><h3>What Building This Changed My Mind About</h3><h3>Flat RAG Isn’t Wrong</h3><p>It solves a real problem, and for many use cases, it’s enough. The issue isn’t retrieval quality — the issue is missing context.</p><h3>GraphRAG Isn’t a Replacement</h3><p>This was my biggest misconception. GraphRAG doesn’t replace vector search — it gives vector search structure. Vectors answer “what is similar?” Graphs answer “how is it related?” You need both.</p><h3>Text-to-Cypher Is Underrated</h3><p>Most attention in the RAG ecosystem goes toward embeddings, but schema-aware query generation is incredibly powerful, especially when users ask analytical questions. Transforming natural language into graph queries opens an entirely different category of applications.</p><h3>What’s Next</h3><p>This project is still evolving. It’s not a finished enterprise platform — it’s an experiment that grew into an architecture. Today it supports:</p><ul><li>Graph-based document retrieval</li><li>Semantic enrichment</li><li>Structured business queries</li><li>Role-based access control</li><li>Hybrid retrieval workflows</li></ul><p>The long-term goal is larger. Imagine an organization where policies connect to operational data, documentation links directly to customer activity, knowledge spans departments instead of repositories, and structured and unstructured information become one graph. That’s the direction I’m building toward — not a better search engine, but a connected knowledge system.</p><h3>Final Thoughts</h3><p>The biggest lesson from this project was surprisingly simple: the problem with most RAG systems isn’t retrieval, it’s isolation. Chunks are isolated. Documents are isolated. Data sources are isolated.</p><p>The moment relationships become first-class citizens, retrieval starts looking a lot more like reasoning. And that’s where things get interesting. We’re getting there.</p><p>The full source code is open and available on <a href="http://github.com/umerjavaidkh/agentic_graph_rag">GitHub</a>. Built with FastAPI, Neo4j, LangGraph, and OpenAI.</p><p>Knowledge Graph RAG Neo4j RAG Machine Learning Generative AI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ee1f6baae26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenAI to Z Challenge: Mining Multi-Source Geospatial Data for Discovery — My Journey Through…]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/openai-to-z-challenge-mining-multi-source-geospatial-data-for-discovery-my-journey-through-e6324467a62e?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6324467a62e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[competition]]></category>
            <category><![CDATA[kaggle]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Sat, 24 May 2025 12:14:47 GMT</pubDate>
            <atom:updated>2025-05-24T12:29:02.548Z</atom:updated>
            <content:encoded><![CDATA[<h3>OpenAI to Z Challenge: Mining Multi-Source Geospatial Data for Discovery — My Journey Through Checkpoint 1</h3><p><em>By Kh.M. Umer Javaid</em></p><p>In my previous article, I shared how I embarked on the OpenAI to Z Challenge by exploring single geospatial datasets and harnessing OpenAI’s GPT models to describe terrain features in plain language. Now, in <strong>Checkpoint 1 — An Early Explorer</strong>, I push forward by mining insights from multiple independent data sources, generating candidate anomaly footprints, and leveraging AI to propose new research hypotheses.</p><h3>Why This Matters</h3><p>Now that I’m fully immersed in the challenge, I’ve realized how invaluable Kaggle notebooks are. They allow you to import and use libraries on the fly, which makes the workflow much smoother. The challenge provides various checkpoints along the way to ensure you’re on the right track and progressing steadily — I’ve been following those closely.</p><p>What I’ve truly come to appreciate through this process is how to work with different AI models effectively. The real challenge of this project isn’t simply about applying a pre-existing dataset to a known problem. Instead, it’s about <strong>gathering data from scratch</strong>, applying <strong>reliable methodologies</strong>, and <strong>building a solution from the ground up</strong>. The ultimate goal is to scale this approach to cover the vast Amazon forest and detect archaeological sites — a complex and rewarding endeavor.</p><p>What follows may seem a bit tedious, but it’s essential to document each step for <strong>Checkpoint 1</strong> — a foundational milestone that sets the stage for future explorations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRCGG6lRR62ewdJTi8TNGg.png" /></figure><p>Combining multi-source geospatial data — such as LiDAR point clouds, satellite imagery, and land use polygons — with powerful language models opens exciting pathways to discover ecological and geological patterns otherwise hidden in complex datasets. This fusion of remote sensing and AI can transform how we understand landscapes and their dynamics.</p><h3>Step 1: Loading Two Independent Public Data Sources</h3><p>I began by working with:</p><p><strong>GEDI LiDAR Dataset</strong> (NASA’s Global Ecosystem Dynamics Investigation): detailed canopy height information from spaceborne LiDAR.</p><p><strong>MapBiomas Amazonia Polygons</strong>: a comprehensive land cover polygon dataset for the Amazon region.</p><p>Using the Google Earth Engine Python API, I loaded these datasets:</p><pre>GEDI_DATASET_ID = &#39;LARSE/GEDI/GEDI02_A_002_MONTHLY&#39;<br>POLYGON_DATASET_ID = &#39;projects/mapbiomas-raisg/AMAZONIA/collection7/integration&#39;</pre><pre>gedi = ee.ImageCollection(GEDI_DATASET_ID).filterDate(&#39;2023-01-01&#39;, &#39;2023-12-31&#39;).filterBounds(ee.Geometry.Point([-60, -3]))<br>polygons = ee.FeatureCollection(POLYGON_DATASET_ID)</pre><pre>print(f&quot;📡 GEDI Dataset: {GEDI_DATASET_ID}&quot;)<br>print(f&quot;🗺️ Polygon Dataset: {POLYGON_DATASET_ID}&quot;)</pre><h3>Step 2: Generating Five Candidate “Anomaly” Footprints</h3><p>To simulate environmental anomalies (e.g., unusual vegetation patches), I created five jittered center points:</p><pre>import random<br>random.seed(42)</pre><pre>center_points = [<br>    (-3.0039, -56.9997),<br>    (-3.0041, -57.0000),<br>    (-3.0037, -57.0002),<br>    (-3.0044, -56.9997),<br>    (-3.0043, -57.0000)<br>]</pre><pre>center_points_jittered = []<br>for lat, lon in center_points:<br>    lat_j = lat + random.uniform(-0.00045, 0.00045)  # ±50m<br>    lon_j = lon + random.uniform(-0.00045, 0.00045)  # ±50m<br>    center_points_jittered.append((lat_j, lon_j))</pre><pre>for i, (lat, lon) in enumerate(center_points_jittered, 1):<br>    print(f&quot;Footprint {i}: Center=({lat:.6f}, {lon:.6f}), Radius=5000m&quot;)</pre><p>This ensures consistent but slightly variable footprints with each run.</p><h3>Step 3: Logging Datasets and OpenAI Prompts</h3><p>Transparency matters! I logged dataset IDs and prompts used:</p><p>GEDI Dataset: LARSE/GEDI/GEDI02_A_002_MONTHLY</p><p>Polygon Dataset: projects/mapbiomas-raisg/AMAZONIA/collection7/integration</p><p>Sample GPT prompt:</p><pre>You are analyzing LiDAR-derived elevation data:<br>- Min: 0.00 m<br>- Max: 104.00 m<br>- Mean: 50.87 m<br>Describe the surface terrain in plain English.</pre><h3>Step 4: Mining Insights and Proposing Hypotheses</h3><p>Combining terrain and canopy data, GPT generated three insightful hypotheses:</p><p><strong>Biodiversity patterns linked to canopy height and terrain features</strong></p><p><strong>Soil erosion risks associated with slope gradients</strong></p><p><strong>Hydrological impacts influenced by elevation and vegetation structure</strong></p><p>These hypotheses offer promising avenues for ecological and geological exploration.</p><h3><strong>Happy to complete all the check points and getting the desired result — motivation ~ </strong>continues!<strong> …</strong></h3><h3><strong>Links:</strong></h3><p><a href="https://medium.com/@kh.m.umerjavaid/future-proofing-my-tech-career-combining-mobile-development-and-ai-in-the-openai-to-z-challenge-c3aa3977be05">My First Article on the OpenAI to Z Challenge</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6324467a62e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Future-Proofing My Tech Career: Combining Mobile Development and AI in the OpenAI to Z Challenge]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/future-proofing-my-tech-career-combining-mobile-development-and-ai-in-the-openai-to-z-challenge-c3aa3977be05?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3aa3977be05</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[challenge]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Fri, 16 May 2025 13:24:47 GMT</pubDate>
            <atom:updated>2025-05-24T12:41:36.131Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday, I received an email about the <strong>OpenAI to Z Challenge</strong> — and it sparked a chain of thoughts. I had just completed the well-known “Titanic: Machine Learning from Disaster” problem on Kaggle, and found myself at a crossroads: <em>Should I take on this new challenge?</em> After reflecting on my experience and aspirations, the answer became clear — <strong>yes</strong>.</p><p>Let me share why.</p><h3>A Solid Foundation in Tech, A Renewed Passion for AI</h3><p>I bring over <strong>8 years of experience as a mobile developer</strong>, having worked on various projects in <strong>fintech, e-commerce, banking, and government sectors</strong>. My background is rich with hands-on experience building scalable, user-focused apps that solve real-world problems.</p><p>During the COVID-19 pandemic, like many of us, I took the opportunity to learn something new. I dove into the acclaimed book <strong>“Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow”</strong>, which helped me build a solid foundation in machine learning. That book opened my eyes to the beautiful complexity behind AI — models, formulas, the mathematics under the hood.</p><p>It taught me an important lesson: <strong>You can’t truly solve a problem dynamically without understanding your model deeply.</strong> While tweaking parameters in libraries might get you through common tasks, <strong>in-depth understanding is inevitable</strong> for meaningful innovation.</p><h3>Re-entering the AI Space Through the OpenAI to Z Challenge</h3><p>Now, after a long gap, I’m stepping back into the world of AI and machine learning — with purpose, passion, and the OpenAI to Z Challenge as my launchpad.</p><p>Yes, I’m still a beginner in the professional AI world, but I’m not letting that hold me back. I’ve decided to <strong>participate wholeheartedly</strong>, learn as much as I can, and document this entire journey. This is more than a competition — <strong>it’s a transformation</strong>.</p><h3>The Challenge: Unlocking Hidden Archaeological Sites in the Amazon</h3><p>As I explored the challenge details, one problem caught my attention: the vast <strong>Amazon forest</strong>, spanning over <strong>6 million square kilometers</strong>, possibly holding countless <strong>undiscovered archaeological sites</strong>.</p><p>Manual efforts alone cannot map this out — <strong>it’s simply too massive and complex</strong>. But <strong>AI can help</strong>. With advances in satellite imaging, LiDAR data, and deep learning models, we now have the tools to uncover these secrets.</p><p>It’s time to leverage this data and put machine learning to the test — to predict locations, identify patterns, and make discoveries that were once deemed impossible.</p><h3>My Plan</h3><p>Here’s how I plan to tackle this:</p><ul><li>✅ <strong>Research</strong> existing small-scale projects and methodologies used for archaeological site detection.</li><li>✅ <strong>Evaluate</strong> the performance of various models and techniques on similar datasets.</li><li>✅ <strong>Select</strong> a combination of models that yield meaningful results.</li><li>✅ <strong>Develop</strong> the solution within a Kaggle notebook, using best practices and adhering to the judging criteria.</li><li>✅ <strong>Document</strong> the entire process — from ideation to results — to share with the community.</li><li>✅ <strong>Join a team</strong>, if possible, to collaborate, exchange ideas, and accelerate learning.</li></ul><h3>Why This Journey Matters</h3><p>This isn’t just about one competition. This is about <strong>embracing the future</strong>. I see this as the beginning of a <strong>career transformation</strong>, a pivot from mobile development into AI — a field that will shape every industry in the coming years.</p><p>I hope my journey inspires others who, like me, have solid tech experience but have been away from machine learning for some time. <strong>It’s never too late to start again.</strong></p><h3>Let’s Connect</h3><p>I’m open to collaborating and learning from others. If you’re also participating in the challenge — or if you’re experienced in similar projects — let’s connect. Together, we can push the boundaries of what’s possible.</p><p>Thanks for reading. I’ll be posting updates as I progress through the challenge. Your support means a lot.</p><p>#FinalThoughts<br> Whether I win or not doesn’t matter. What matters is that I’m <strong>stepping into the arena</strong> and <strong>embracing change</strong> — and that’s a victory in itself.</p><h4><a href="https://medium.com/p/e6324467a62e">OpenAI to Z Challenge: Mining Multi-Source Geospatial Data</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3aa3977be05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add Uber Car Animation in Flutter App ? Part 2]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/how-to-add-uber-car-animation-in-flutter-app-part-2-9befd69e020e?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9befd69e020e</guid>
            <category><![CDATA[uber-app-clone]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[demo]]></category>
            <category><![CDATA[google-maps]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Sat, 29 Aug 2020 12:11:17 GMT</pubDate>
            <atom:updated>2020-08-29T15:12:10.474Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@kh.m.umerjavaid/how-to-add-uber-car-animation-in-flutter-app-android-studio-part-1-8348bbc69a6f?source=your_stories_page---------------------------">How to Add Uber Car Animation in Flutter App ? Part </a>2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JauJBYMXRhZhR0bZlP9uww.jpeg" /></figure><h4>Starting point of app.</h4><pre>GetIt getIt = GetIt.instance;<br>getIt.registerSingleton(LocationProvider());</pre><p>GetIt used to register the LocationProvider to access any where in the app.</p><pre>home: MyHomePage(title: ‘Flutter Demo’), </pre><p>is actual page containing map and other functionality.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46ad0d2b4a5349dd6c3598102a2d90d8/href">https://medium.com/media/46ad0d2b4a5349dd6c3598102a2d90d8/href</a></iframe><blockquote>To build the UI of homepage, I have used stack view. In stack layout two containers shown based upon condition.</blockquote><blockquote>if user location or center marker yet not return by the api, show loading container to the user else render map with custom style</blockquote><p>when google map loads, its calls following callback</p><pre>void _onMapCreated(GoogleMapController mycontroller) {        _controller = mycontroller;<br> mycontroller.setMapStyle(_mapStyle);<br> mapLoading = false;    <br> _getUserLocationName(center);    mapsPresenter.requestNearbyCabs(center); <br>}</pre><blockquote>from the call back we have request the presenter to show near by cabs. Presenter creates a Json message and ask the simulator to provide near by fake cars. When cars are shown to screen . User can add pick up and drop location by clicking the request layout.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e74e1be894d1128a1063d254cc5b3bd/href">https://medium.com/media/4e74e1be894d1128a1063d254cc5b3bd/href</a></iframe><p>PickAndDropLayout created as a widget in separate class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e89b316bfd8529246daf5d3c162807c/href">https://medium.com/media/0e89b316bfd8529246daf5d3c162807c/href</a></iframe><pre>Prediction p = await getPaceOverlay(context);                          if (p != null) {                            <br>PlacesDetailsResponse detail = await _places.getDetailsByPlaceId(p.placeId);                               final lat = detail.result.geometry.location.lat;                            final lng = detail.result.geometry.location.lng;                            widget.pickupLocation = LatLng(lat, lng);                            widget._onPickLocation(widget.pickupLocation);<br>}</pre><p>Pickup and Drop locations are obtained from Prediction api.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/157b0dcb2558d373840ef9df6830264a/href">https://medium.com/media/157b0dcb2558d373840ef9df6830264a/href</a></iframe><p>All the communication that happens between Simulator and Homepage is done by through a MapsPresenter and MapsView</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eeebbe243a8b5b9b98188e6631fe45ea/href">https://medium.com/media/eeebbe243a8b5b9b98188e6631fe45ea/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cec3467433a9e5814c8c2b53362622a/href">https://medium.com/media/8cec3467433a9e5814c8c2b53362622a/href</a></iframe><p>LocationProvider provides the location related services.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/154464373a8d47ceba8ee2fe8bc45cea/href">https://medium.com/media/154464373a8d47ceba8ee2fe8bc45cea/href</a></iframe><p>Poly line and Cab animations are performed in a separate class .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/919b3ce6f251beaaef4e74e56e1dd558/href">https://medium.com/media/919b3ce6f251beaaef4e74e56e1dd558/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b76c80cb142dcdabedefc26c7ed1e44/href">https://medium.com/media/0b76c80cb142dcdabedefc26c7ed1e44/href</a></iframe><p>Here is complete code in MVP architecture with separate widgets and utils classes you can visit.</p><h4><a href="https://github.com/umerjavaidkh/uber_lyft_app">My repo Github link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9befd69e020e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add Uber Car Animation in Flutter App Android Studio? Part 1]]></title>
            <link>https://medium.com/@kh.m.umerjavaid/how-to-add-uber-car-animation-in-flutter-app-android-studio-part-1-8348bbc69a6f?source=rss-6288d329ed9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8348bbc69a6f</guid>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[uber]]></category>
            <category><![CDATA[lyft]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mvp]]></category>
            <dc:creator><![CDATA[umer javaid]]></dc:creator>
            <pubDate>Sun, 23 Aug 2020 22:33:32 GMT</pubDate>
            <atom:updated>2020-08-29T12:54:04.411Z</atom:updated>
            <content:encoded><![CDATA[<p>We all know about ride sharing apps like Uber, Lyft and Careem. You can find lot of resources about them on Github, Medium and other, mostly they are for Android or iOS. I am going to develop that concept in Flutter with a simulator acting as sever!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6jEkU33NDbuSnbtj" /><figcaption>Photo by <a href="https://unsplash.com/@thoughtcatalog?utm_source=medium&amp;utm_medium=referral">Thought Catalog</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><em>We will discuss the below in this blog, i am considering you have some knowledge of Flutter before! We are going through following steps.</em></p><ul><li>Setting up Google Map</li><li>Adding auto complete layout and functionality</li><li>Displaying nearby Cabs with the help of Simulator</li><li>Adding the Origin and Destination marker and drawing a path between the Origin and Destination on the map</li><li>Moving the car icon towards pickup on map with animation</li><li>Project Source Code and What next?</li></ul><h3>Setting up Google Map</h3><p><a href="https://codelabs.developers.google.com/codelabs/google-maps-in-flutter/#6">You can also find a every details about setting Google Map here</a></p><p><strong>Getting an API key and enabling :</strong></p><p>Visit the <a href="https://cloud.google.com/console/google/maps-apis/overview">Google Cloud Platform Console</a>.</p><p><strong>Adding API key in the Android project:</strong></p><p>Open the AndroidManifest.xml file of your Android project and add your API key in the meta-data tag under application tag;</p><pre>&lt;application&gt; &lt;meta-data android:name=”com.google.android.geo.API_KEY” android:value=”PASTE_YOUR_API_KEY_HERE” /&gt; … &lt;/application&gt;</pre><p><strong>Adding API key in the iOS project:</strong></p><pre>@UIApplicationMain<br>@objc class AppDelegate: FlutterAppDelegate {  </pre><pre>override func application(   <br> _ application: UIApplication,    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?  ) -&gt; Bool { </pre><pre>  GMSServices.provideAPIKey(&quot;your_key_here&quot;) </pre><pre>   GeneratedPluginRegistrant.register(with: self) <br>   return super.application(application, didFinishLaunchingWithOptions: launchOptions) <br> }<br>}</pre><p>On iOS, you also need to add a setting to the app’s <strong>Info.plist</strong> file (<a href="https://gist.github.com/kenzieschmoll/e3c35fa3578fd17119384b26c2474fec">ios/Runner/Info.plist</a>).</p><p>Add a boolean property with the key io.flutter.embedded_views_preview and the value true:</p><pre>&lt;key&gt;io.flutter.embedded_views_preview&lt;/key&gt;<br>&lt;true/&gt;</pre><p><strong>Adding API key in the lib project:</strong></p><p>Just create a constant class and add key as a String for now!</p><pre>class   Constants{  <br>    static const kGoogleApiKey = &quot;your_key_here&quot;;<br>}</pre><p><strong>Add Google Map library in pubspec.yaml file:</strong></p><pre>dependencies:<br>  ...<br>  google_maps_flutter: ^0.4.0</pre><h3>Adding a GoogleMap widget</h3><p>Now you are ready to add a GoogleMap widget! Run <strong>flutter clean</strong> to make sure the API key changes are picked up on the next build. Then, add a GoogleMap widget that covers the entire screen:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df515923a3de59dfece08088a5485767/href">https://medium.com/media/df515923a3de59dfece08088a5485767/href</a></iframe><h4>Styling the map like uber app:</h4><pre>rootBundle.loadString(&#39;assets/map_style.txt&#39;).then((string) {      _mapStyle = string;    });</pre><p><a href="https://github.com/umerjavaidkh/uber_lyft_app/blob/master/assets/map_style.txt">you can find json of map</a></p><p>place it in assets folder and load by code above. Its my first blog if you find any thing confusing feel free to ask!</p><h3><strong>final demo will be look like this</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WRp686xdFbGW3nGfu4am0A.jpeg" /></figure><h4><a href="https://github.com/umerjavaidkh/uber_lyft_app.git"><em>Github Repo link</em></a></h4><h4><a href="https://medium.com/@kh.m.umerjavaid/how-to-add-uber-car-animation-in-flutter-app-part-2-9befd69e020e">Part 2 link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8348bbc69a6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>