{
  "source_file": "0930",
  "source_platform": "个人博客",
  "author": "Jason Liu",
  "title_listed": "Stopped Using RAG",
  "keywords": "RAG,编码Agent,Cline",
  "domain": "大模型算法",
  "content_type": "观点文章",
  "is_paid_flag": "否",
  "url": "https://jxnl.co/writing/2025/09/11/why-i-stopped-using-rag-for-coding-agents-and-you-should-too/",
  "publish_date": "2025-09",
  "corpus_stage": "推理部署",
  "notes": "为何编码Agent放弃RAG",
  "id": "936c323f0da8",
  "collected_at": "2026-10-02T14:29:28",
  "title": "Why I Stopped Using RAG for Coding Agents (And You Should Too) - Jason Liu",
  "body_markdown": "Why I Stopped Using RAG for Coding Agents (And You Should Too)\n¶\nI hosted a discussion with Nik Pash, head of AI at Cline, about his viral essay \"Why I No Longer Recommend RAG for Autonomous Coding Agents.\" We explored why embedding-based retrieval systems are being abandoned by leading coding agent companies in favor of more direct, agentic approaches to code exploration.\nWhy are coding agent companies moving away from embedding-based RAG?\n¶\nNik's journey with RAG began when he built Vault, a popular open-source project for ingesting documents and creating knowledge bases. Despite his extensive experience optimizing RAG pipelines, he's now actively against using embedding-based RAG for coding agents.\nThe fundamental issue is that embedding search creates unnecessary complexity for coding agents. Code is inherently logical and structured, making it more suitable for direct exploration rather than vector similarity search. As Nik explained:\n\"At Cline, I became the number one advocate against using RAG, even though RAG has been my bread and butter for so long. I'm just actively anti-RAG at Cline, and I think in general for any coding agent company.\"\nThis shift isn't unique to Cline - Boris from Cloud Code shared similar experiences on the Latent Space podcast, noting that they tried RAG but found it disappointing and ultimately abandoned it in favor of agentic exploration.\nKey Takeaway:\nDespite the massive investment in vector databases and embedding technologies, leading coding agent companies have discovered that direct code exploration produces better results than embedding-based retrieval for coding tasks.\nHow do coding agents navigate codebases without RAG?\n¶\nInstead of embedding search, modern coding agents like Cline use a \"plan and act\" paradigm that mimics how senior engineers actually explore codebases:\nFirst, they examine the folder structure and file names\nThey read files in their entirety to understand imports and dependencies\nThey use tools like grep to search for specific patterns\nThey build an understanding through agentic discovery\nThis approach maintains what Cline calls \"narrative integrity\" - allowing the agent to follow a coherent thought process rather than jumping between disconnected code chunks retrieved by similarity search.\n\"When you show a senior engineer a new codebase, what do they do? They look at the folder structure, they look at the names of the folders, they look at the files, they might read in a file and see 'okay, this file imports this other file, let's go check out what this other file has.' And then you generally build an understanding using this agentic discovery approach.\"\nThe agent first gathers all necessary information in a \"plan mode,\" then switches to \"act mode\" to implement the solution. This pattern is becoming increasingly common across coding agents, with Cloud Code recently adding a similar plan and act paradigm.\nKey Takeaway:\nModern coding agents work best when they can explore code like humans do - reading entire files, following imports, and building a coherent understanding rather than relying on embedding search to surface relevant code snippets.\nWhat are the problems with embedding-based RAG for code?\n¶\nEmbedding-based RAG creates several significant challenges for coding agents:\nSecurity concerns:\nIndexing your entire codebase is a security risk, as embeddings can be reverse-engineered to recover the original content.\nMaintenance overhead:\nEmbeddings need to be stored, updated, and maintained, creating additional complexity.\nDistraction for the agent:\nEven with perfect chunking algorithms, the agent receives disconnected code snippets from across the codebase, making it harder to build a coherent understanding.\nResource drain:\nOptimizing RAG pipelines becomes a \"black hole\" that consumes endless resources for marginal improvements.\nNik described this as \"schizophrenic mind map of 4-dimensional clustered embeddings floating around in its head\" - a source of distraction rather than help for the coding agent.\nWhen Pinecone responded to Nik's article with a proposal for \"agentic RAG,\" he viewed it as \"slapping 'agentic' on top of an outdated solution\" that just adds more complexity to an already complex system.\nKey Takeaway:\nEmbedding-based RAG creates unnecessary complexity, security risks, and maintenance overhead while actually reducing the agent's ability to understand code coherently.\nWhen might RAG still make sense for coding agents?\n¶\nDespite his strong stance against RAG for high-quality coding agents, Nik acknowledged some scenarios where it might still be appropriate:\nCost optimization:\nIf your business model requires minimizing token usage (e.g., offering a $20/month subscription), RAG can reduce costs by avoiding loading entire files into context.\nPerfunctory performance:\nWhen you need basic functionality rather than high-quality intelligence, RAG can provide adequate results with lower token consumption.\nHigh-volume, low-stakes tasks:\nFor tasks like reviewing thousands of PRs where the cost of full context processing can't be justified.\nNik noted that Cursor employs this strategy to support their $20/month subscription model, while Cline takes a different approach:\n\"From the very beginning at Cline, we were just 'bring your own API keys' and use Cline however you like. We go full context-heavy and don't take any shortcuts around context. And we find that it works just so much better for agent coding.\"\nKey Takeaway:\nRAG may still be appropriate when optimizing for cost rather than quality, but for serious engineering teams working on production code, the full context approach produces significantly better results.\nHow do coding agents maintain context in long-running tasks?\n¶\nFor managing context in long-running tasks, Cline offers several approaches:\nCompacting with slash commands:\nUsers can use \"/sum\" to compact the conversation.\nTask handoff with \"/new task\":\nThis creates a summary of everything done so far, as if handing off to a new engineer, and starts a fresh context window.\nAlgorithmic context management:\nCline previously used an algorithmic approach to remove duplicate file reads while maintaining narrative integrity.\nInterestingly, Nik noted that simple summarization is proving more effective than complex context management strategies:\n\"What we're finding now is that actually summarization just works better. In our internal testing, you can have these long-running tasks with resets of the context window many times over with just a very detailed summary.\"\nThis aligns with the \"bitter lesson\" in AI - that simpler approaches often outperform complex engineered solutions as models improve. Cline is also experimenting with to-do lists as a way to help agents track progress across context resets.\nKey Takeaway:\nSimple summarization is proving more effective than complex context management strategies for maintaining agent performance across context window limitations.\nWhat's the \"bitter lesson\" for AI application developers?\n¶\nThe\n\"bitter lesson\" in AI\n, as Nik describes it, is that the application layer is shrinking over time. With traditional ML, developers needed extensive code to make models useful, but with modern LLMs, the amount of code required is decreasing:\n\"The bitter lesson to me, what it really means, is that this application layer is just shrinking over time. Every day it's just growing smaller and smaller.\"\nInstead of trying to maintain complex systems like RAG pipelines, Nik recommends embracing this trend:\n\"Just throw it all out. Let the model do its job. Stop trying to get in the way of the model. It's almost like cleaning a mirror and letting more light shine through.\"\nThis pattern extends beyond RAG to other areas:\nFast API:\nSimilar principles apply to API design\nStatic analysis tools:\nCompanies like Codegen spent years building knowledge graphs for code, only to abandon them for simpler approaches\nMulti-agents:\nNik suspects that complex multi-agent systems may follow the same pattern\nKey Takeaway:\nAs AI models improve, complex application layers often become unnecessary overhead. The most effective approach is often to simplify and let the model's capabilities shine through rather than building elaborate systems around them. This aligns with the\nContext Engineering principles\nof designing simple, effective tool responses rather than complex retrieval systems.\nWhat about multi-agent approaches for coding tasks?\n¶\nWhen asked about questions people aren't asking in the coding agent world, Nik raised an interesting point about multi-agent systems:\n\"What's better - a team of geniuses working together, or a bunch of solo geniuses working separately in isolation?\"\nHe believes solo geniuses often produce breakthroughs, and this applies to coding agents as well. Despite the appeal of multi-agent systems like Auto-GPT and Crew AI, which promised to overcome context window limitations by having multiple agents collaborate, Nik remains skeptical:\n\"It just never worked. It was just a fast way to burn a whole bunch of tokens and get nowhere.\"\nHe sees parallels between the RAG narrative and the current excitement around multi-agents, suggesting the industry may be repeating the same pattern of unnecessary complexity:\n\"I'm kind of on the side of keeping it single-threaded, keeping it one agent. For things like read-only it might make sense if you're just gathering things in context, but even there... Anthropic uses multi-agents in their research mode, OpenAI doesn't, and OpenAI just works so much better for me.\"\nKey Takeaway:\nDespite the appeal of multi-agent systems, single-agent approaches may prove more effective for coding tasks, following the same pattern we've seen with RAG - simpler approaches often win as model capabilities improve.\nHow do tools and interfaces affect coding agent performance?\n¶\nCline and other coding agents provide both specialized tools (read file, search directory) and general-purpose tools (terminal access). Nik explained that this hybrid approach serves several purposes:\nUX considerations:\nSpecialized tools allow for custom interfaces that improve the user experience\nPermission management:\nSpecialized tools enable fine-grained access controls\nError reduction:\nSpecialized tools reduce the surface area for potential errors\nHowever, Nik acknowledged that this might be transitional:\n\"We have considered internally, what if we just only use the terminal tool and the agent would figure things out from there? I think eventually we might move in that direction, but for the time being it is helpful to have this little sandbox for the agent.\"\nFor model selection, Nik noted that Cline users often employ different models for different phases:\n\"A common pattern a lot of people use is they use a very large context window model like Gemini Pro 2.5 for the planning phase, and then for the act phase, once they've come up with a plan, read in all of the files into context, and come up with a very solid plan, then for the execution phase they switch to Sonnet.\"\nKey Takeaway:\nWhile specialized tools currently provide UX benefits and safety guardrails, the industry may eventually move toward simpler interfaces as models become more capable. Different models excel at different phases of the coding process, with large context models for planning and specialized coding models for execution.\nHow do coding agents handle memory and knowledge management?\n¶\nFor persistent knowledge, Cline offers several approaches:\nClient Rules:\nFiles containing knowledge or instructions that Cline should know for every task, similar to a memory system\nWorkflows:\nMarkdown files that define sequences of repetitive tasks\nKnowledge Engine:\nComing in their enterprise product\nNik expressed caution about automatic memory updates like those in ChatGPT:\n\"You really gotta be careful with this because oftentimes using ChatGPT, it's just like 'memory updated' - it's like 'Oh, memorize something that I didn't want it remembering. Stop doing this!'\"\nHe suggested that embedding-based approaches might actually be appropriate for managing collections of memory snippets, showing that while he's against RAG for code exploration, he sees potential value in similar technologies for different use cases.\nKey Takeaway:\nMemory management for coding agents requires careful design to balance automation with user control. While embedding-based approaches might be appropriate for managing collections of memories, they're still problematic for code exploration.\nWhat's next for Cline and coding agents?\n¶\nCline is expanding their offerings with several new developments:\nEnterprise product\nlaunching the same week as this talk\nJetBrains integration\ncoming soon\nCLI version\nof Cline for terminal users\nNik mentioned that many large enterprises are already using Cline through their open-source offering and are eager for an enterprise version to manage security, costs, and permissions:\n\"We started getting flooded with all these enterprises, booking meetings with Fortune 5 companies, not even 500, but massive companies with massive engineering teams and massive codebases coming to us saying 'Hey, we already have hundreds of engineers using Cline in our organization because you guys are open source and we passed the security audits.'\"\nThese companies reported that Cline works well in their massive codebases using the basic tools Cline already provides, validating the agentic approach even at enterprise scale.\nKey Takeaway:\nThe agentic approach to code exploration is proving effective even in massive enterprise codebases, and companies are eager to adopt these tools with proper enterprise controls for security and cost management.\nFAQs\n¶\nWhat is RAG and why was it initially popular?\n¶\nRAG (Retrieval-Augmented Generation) was initially promoted as a solution to give AI models \"long-term memory\" when context windows were very limited. Companies like Pinecone marketed embedding-based search as a way to ground AI responses in real documents, reduce hallucinations, and simulate infinite context windows. This approach gained significant investment from major venture capital firms and became a standard recommendation for many AI applications.\nWhy is RAG no longer recommended for coding agents?\n¶\nFor coding agents specifically, RAG (particularly embedding-based search) has proven unnecessary and potentially counterproductive. Modern coding agents perform better when allowed to explore code bases naturally—reading files, using grep commands, and navigating directory structures—similar to how human engineers work. This approach maintains \"narrative integrity\" where the agent follows a logical thought process rather than jumping between disconnected code snippets surfaced by embedding search.\nWhat alternatives work better than RAG for coding agents?\n¶\nThe most effective approach is giving coding agents access to basic tools like file reading, directory navigation, and terminal commands (grep, search). This allows agents to explore code bases organically, building understanding through a logical progression. Many leading coding agents like Cline and Cloud Code have adopted a \"plan and act\" paradigm where the agent first gathers information and creates a plan, then executes it—all without relying on embedding search.\nDoesn't RAG help with large code bases?\n¶\nSurprisingly, even with very large code bases, the agentic exploration approach works better than embedding search. Major enterprises with massive code bases have found that tools like Cline work effectively without RAG. The agent simply needs access to the file structure, basic search capabilities, and the ability to read files in context to navigate even complex code repositories.\nWhat about hallucinations? Doesn't RAG help prevent those?\n¶\nFor coding agents, hallucinations are rarely an issue when using the agentic approach. By reading files in full context and setting temperature to 0, modern models can maintain accuracy without embedding search. The hallucination concern is largely outdated with today's flagship models and their expanded context windows.\nAre there any situations where RAG is still useful?\n¶\nRAG can still be valuable in certain scenarios:\nWhen trying to reduce costs (embedding search can use fewer tokens than reading entire files)\nFor applications with massive unstructured data lakes\nFor human-readable documents like legal texts (though even here, agentic exploration is increasingly effective)\nWhen building applications with tight budget constraints that need to optimize token usage\nWhat is the \"bitter lesson\" regarding RAG and coding agents?\n¶\nThe \"bitter lesson\" refers to the realization that as AI models improve, many complex engineering solutions become unnecessary. For coding agents, this means that elaborate systems like embedding search, knowledge graphs, and complex indexing are being outperformed by simply letting the model do what it does best with minimal interference. The application layer is shrinking, and developers should focus on removing barriers rather than adding complexity.\nHow do coding agents maintain context in long-running tasks?\n¶\nRather than using RAG for memory, effective coding agents use techniques like:\nSummarization of previous work\nTask handoff with detailed context summaries\nTo-do lists that track completed and remaining items\nStructured workflows that maintain logical progression\nThese approaches have proven more effective than embedding-based memory systems for maintaining context in extended coding sessions.\nWhat about multi-agent systems? Are they better than single agents?\n¶\nThe evidence suggests that single, powerful agents often outperform multi-agent systems for coding tasks. Similar to the RAG situation, there's a tendency to add complexity (multiple specialized agents) when a single capable agent with the right tools can perform better. While the jury is still out, early indications suggest that maintaining \"narrative integrity\" with a single agent leads to more coherent and effective results.\nHow should tools be provided to coding agents?\n¶\nThere's a balance between providing specialized tools (read file, search directory) versus general-purpose tools (terminal access). Specialized tools offer better UX, permissions control, and error prevention, while general-purpose tools provide flexibility. Most successful coding agents offer both, with specialized tools for common operations and terminal access for everything else. As models improve, the need for specialized tools may diminish.",
  "metadata": {
    "title": "Why I Stopped Using RAG for Coding Agents (And You Should Too) - Jason Liu",
    "description": "Why leading coding agent companies are abandoning embedding-based RAG in favor of direct, agentic approaches to code exploration that mirror how senior engineers actually work.",
    "keywords": null,
    "author": "Jason Liu",
    "og:type": "website",
    "og:title": "Why I Stopped Using RAG for Coding Agents (And You Should Too) - Jason Liu",
    "og:description": "Why leading coding agent companies are abandoning embedding-based RAG in favor of direct, agentic approaches to code exploration that mirror how senior engineers actually work.",
    "og:image": "https://jxnl.co/assets/images/social/writing/2025/09/11/why-i-stopped-using-rag-for-coding-agents-and-you-should-too.png",
    "og:image:type": "image/png",
    "og:image:width": "1200",
    "og:image:height": "630",
    "og:url": "https://jxnl.co/writing/2025/09/11/why-i-stopped-using-rag-for-coding-agents-and-you-should-too/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://github.com/jxnl/blog/edit/main/docs/writing/posts/talks/rag-is-dead-cline-nik.md",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://github.com/jxnl/blog/raw/main/docs/writing/posts/talks/rag-is-dead-cline-nik.md",
      "label": "",
      "type": "a"
    },
    {
      "href": "http://www.incompleteideas.net/IncIdeas/BitterLesson.html",
      "label": "\"bitter lesson\" in AI",
      "type": "a"
    },
    {
      "href": "https://jxnl.co/writing/2025/08/28/context-engineering-index/",
      "label": "Context Engineering principles",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:52:56Z",
  "source_url": "https://jxnl.co/writing/2025/09/11/why-i-stopped-using-rag-for-coding-agents-and-you-should-too/",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 18560,
  "expected_body_images": 0,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/936c323f0da8/pages/source.html",
  "local_html": "attachments/936c323f0da8/pages/article.html",
  "body_base_path": "attachments/936c323f0da8/pages/",
  "body_markdown_path": "attachments/936c323f0da8/pages/article.md"
}