<?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"><channel><title><![CDATA[Software Developer's Field Notes]]></title><description><![CDATA[Field notes from building applications that make sense – TypeScript (Node.js, NestJS), PHP (Symfony), Dart (Flutter), and thoughtful AI integration.]]></description><link>https://blog.spevak.eu</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1766188672049/23fad65d-145b-4d4c-b6c7-c66f7fc2d5a7.png</url><title>Software Developer&apos;s Field Notes</title><link>https://blog.spevak.eu</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 12:04:44 GMT</lastBuildDate><atom:link href="https://blog.spevak.eu/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Does Context7 improve the output of AI tools for developers?]]></title><description><![CDATA[The idea is roughly this: Tools powered by large language models receive context in the form of relevant documentation. The code they generate should then be higher quality. It should contain fewer outdated usages of the given languages, frameworks, ...]]></description><link>https://blog.spevak.eu/context7-test</link><guid isPermaLink="true">https://blog.spevak.eu/context7-test</guid><dc:creator><![CDATA[Petr Spěvák]]></dc:creator><pubDate>Sat, 20 Sep 2025 13:50:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1758376797883/c424f821-a246-455c-8546-c006d28f5e11.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>The idea is roughly this: Tools powered by large language models receive context in the form of relevant documentation. The code they generate should then be higher quality. It should contain fewer outdated usages of the given languages, frameworks, or libraries. Phantom libraries, classes, methods, and functions—often seen in proposed solutions—should disappear. The result should be even better if Context7 is told exactly which documentation to draw from.</strong></p>
<p><strong>It seems obvious. There is no reason it should work otherwise. So let’s just add Context7 to the MCP servers of our favorite AI tools (see the <a target="_blank" href="https://github.com/upstash/context7/blob/master/README.md">documentation</a>). Or is it not that clear‑cut?</strong></p>
<h3 id="heading-notes-on-my-small-test">Notes on my small test</h3>
<ul>
<li>I might have preferred TypeScript for its broad adoption and similarity to other popular C‑like languages. However, I had a PHP + Symfony + Doctrine ORM project at hand with a sufficiently large codebase, and I came up with a simple, easy‑to‑grasp task (for an LLM and for readers). It can be implemented by creating a single file without touching others—otherwise the test results would be hard to present on GitHub and to compare. Successful completion also requires some orientation in the project. The task is close to something one might actually need.<br />
In my opinion, it has significantly more value than asking an AI to code a simple tic-tac-toe game from scratch.</li>
<li>The test is not all‑encompassing. It targets a single use case across JetBrains AI Assistant, Gemini CLI, and Junie, combined with several models. Even in this scope it was time‑consuming. In practice it mainly helped me decide whether I will use Context7.</li>
</ul>
<h3 id="heading-a-few-words-about-the-articles-concept">A few words about the article’s concept</h3>
<p><strong>A standard‑length article describing the entire process and evaluating every result would not be read. The exceptions would have their favorite language model summarize it anyway. So I decided to save human effort and compute time and write it directly as a summary.</strong></p>
<h2 id="heading-what-did-i-find">What did I find?</h2>
<p><strong>TL;DR: The assumption did not hold. For current models from major providers, results with Context7 enabled were actually worse. The only improvement appeared with the oldest model tested.</strong></p>
<p>With even smaller locally hosted models, the positive effect of Context7 could be larger.</p>
<p>Results might differ if, instead of widely used frameworks like Symfony and Doctrine ORM, I targeted something more niche. I have seen some positive reports along those lines.</p>
<p><strong>I am not making a blanket claim that Context7 is useless. It just did not prove helpful under conditions close to how I typically use AI tools.</strong></p>
<h3 id="heading-prompt">Prompt</h3>
<ol>
<li><code>Create a Symfony command (ideally in ShopBundle) that deletes shopping carts (entity Cart) older than a month.</code></li>
<li><code>Create a Symfony command (ideally in ShopBundle) that deletes shopping carts (entity Cart) older than a month. use context7</code></li>
<li><strong> Same as the previous, except Context7 was pointed directly at</strong> <code>symfony-docs</code>.</li>
</ol>
<p><em>Note: You could argue the prompt could be more detailed, more specific, more precise, etc. However, you can achieve the desired result by generating boilerplate with the non-AI Symfony Maker CLI (or via the Symfony plugin in the IDE) and tweaking it within minutes. So AI generation only adds value if you just type the prompt and run it.</em></p>
<h3 id="heading-generated-solutions">Generated solutions</h3>
<p>The only result I was happy with came—perhaps surprisingly—from Gemini CLI with the Gemini 2.5 Pro model, but only <strong>without</strong> Context7. The code matched the current documentation (simpler and clearer syntax), and the core was the following SQL quer built with the Doctrine QueryBuilder:</p>
<pre><code class="lang-php">$qb-&gt;delete(Cart::class, <span class="hljs-string">'c'</span>)
    -&gt;where(<span class="hljs-string">'c.updatedAt &lt; :date'</span>)
    -&gt;setParameter(<span class="hljs-string">'date'</span>, $oneMonthAgo);
</code></pre>
<p>I saw something similar, though a bit complicated, from Junie with Claude 4 Sonnet—again only without Context7.</p>
<p>Other solutions (including 2.5 Pro with Context7) selected ORM entities into an array and then iterated with a <code>foreach</code> loop. With a large number of truly "abandoned" carts, that approach would be significantly heavier.</p>
<p>I would not infer any general ranking of models from this—that is not the point of the test. I often see GPT‑5 go beyond the literal instruction and "think like a developer". Sometimes it is useful to realize that your request does not fully match what you actually need. In this case the unsolicited add‑ons felt more like trying to outsmart me and justify the <code>foreach</code>.</p>
<p><strong>For the same tool with the same model, the Context7 variant performed worse than the baseline. That held for current top models from Google, OpenAI, and Anthropic.</strong>
<strong>Stepping down the stack, only with Gemini 2.0 Flash Lite (an older, heavily trimmed model) did Context7 show a clear improvement.</strong> This was the smallest model I could get working with Gemini CLI. I did not go further to install an even smaller local model and wire it into AI Assistant—the effort would outweigh the value of the finding.</p>
<p><strong>Pointing Context7 precisely at <code>symfony-docs</code> further degraded results for the higher‑end models. For 2.0 Flash Lite it flipped the previously positive effect into the opposite.</strong></p>
<p>It is important to note that within <strong>JetBrains AI Assistant</strong> the <strong>Gemini 2.5 Pro</strong> model behaved oddly at the time of my testing (September 14, 2025). In PhpStorm it was labeled <strong><em>Beta</em></strong> and the responses were unusually fast and low‑quality compared to typical 2.5 Pro behavior. In Android Studio the <strong><em>Beta</em></strong> label was not present and the model behaved as expected. Today the <strong><em>Beta</em></strong> label is not shown in PhpStorm either and the behavior now matches 2.5 Pro.</p>
<hr />
<p>All the generated files are available in the GitHub repo (in a transparent way, I hope): https://github.com/petrspevak/context7_test</p>
<hr />
<p>This article in Czech language: <a target="_blank" href="https://www.spevak.eu/article/context7-test">Zlepšuje Context7 výstupy AI nástrojů pro vývojáře?</a></p>
]]></content:encoded></item></channel></rss>