<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Refact AI</title>
    <description>The latest articles on DEV Community by Refact AI (@refact).</description>
    <link>https://dev.to/refact</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F7379%2F8e1d0bee-5d31-4adb-89b6-db7380552e15.jpg</url>
      <title>DEV Community: Refact AI</title>
      <link>https://dev.to/refact</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/refact"/>
    <language>en</language>
    <item>
      <title>Long-term memory in AI programming: Why your team needs an Agent that doesn't forget</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Fri, 11 Jul 2025 00:09:57 +0000</pubDate>
      <link>https://dev.to/refact/long-term-memory-in-ai-programming-why-your-team-needs-an-agent-that-doesnt-forget-4636</link>
      <guid>https://dev.to/refact/long-term-memory-in-ai-programming-why-your-team-needs-an-agent-that-doesnt-forget-4636</guid>
      <description>&lt;p&gt;Ever feel like you’re stuck in a developer’s version of &lt;em&gt;Groundhog Day&lt;/em&gt;?&lt;br&gt;&lt;br&gt;
You explain your code and project context to an AI, it helps for a while, but next session it’s like you’re meeting a stranger — all that context is gone.&lt;/p&gt;

&lt;p&gt;You’ve probably seen this outside of coding too. You tell the AI you have two cats. Then later, while asking about pet food, it goes: “So, do you have dogs?” only to randomly mention your cats in a completely unrelated conversation about databases.&lt;/p&gt;

&lt;p&gt;It’s frustrating. You want continuity in programming with AI, but it can’t even handle a task nearly identical to the one it solved yesterday. At some point, you start wondering why you bother at all. Maybe that surfing career is still an option… Sound familiar? Hold that thought.&lt;/p&gt;

&lt;p&gt;How can we make AI remember and learn over time? The solution exists: &lt;strong&gt;continuous, long-term memory in AI Agents&lt;/strong&gt;, and thankfully, today’s AI Agents can already use it in real workflows.&lt;/p&gt;

&lt;p&gt;This article isn’t about the textbook definitions of memory types. Instead, we’ll explore the practical application of memory in modern agentic workflows, why knowledge management in AI programming is crucial, and how you can &lt;a href="https://refact.ai/blog/2025/long-term-memory-in-ai-programming-why-your-team-needs-an-agent-that-doesnt-forget/" rel="noopener noreferrer"&gt;get an AI Agent with memory&lt;/a&gt; for you and your team.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is memory in AI programming tools?
&lt;/h2&gt;

&lt;p&gt;When we talk about “memory” in AI tools, it’s useful to distinguish between &lt;em&gt;short-term&lt;/em&gt; and &lt;em&gt;long-term&lt;/em&gt; memory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Short-term memory&lt;/strong&gt; – the information an AI model can hold within a single session (bounded by the model’s context window). Once you exceed it or start a new session, the older context falls out of scope.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-term memory&lt;/strong&gt; – information that persists across sessions and beyond the context window. A true long-term memory in an AI coding Agent means it can retain and recall important facts and patterns from yesterday, last week, or last month, and use them to solve your task properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In essence, short-term memory gives an AI continuity within a single conversation, but long-term memory gives it continuity across conversations (e.g., within a shared workspace).&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a long-term memory AI?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;An example of AI with long-term memory is an AI Agent&lt;/strong&gt; that, instead of wiping context after each interaction, retains critical information and reuses it to improve future responses. Thus, it might remember your key API endpoints, the fact that you’re migrating from one framework to another, the approach to some tasks, etc.&lt;/p&gt;

&lt;p&gt;Crucially, long-term memory in AI isn’t about storing everything; it’s about capturing the right facts that will improve the AI accuracy and user experience later on. A well-designed memory system might log important details (e.g., “&lt;em&gt;User’s preferred database is PostgreSQL&lt;/em&gt;”) and bring them up when relevant while ignoring irrelevant one-off prompts.&lt;/p&gt;

&lt;p&gt;By persisting in such a context, an AI programming Agent could transition from a stateless tool to a learning collaborator. It would start to “know” your project and your team.&lt;/p&gt;




&lt;h2&gt;
  
  
  Long-term memory AI — simple explanation
&lt;/h2&gt;

&lt;p&gt;A well-known demonstration comes from the paper &lt;a href="https://arxiv.org/abs/2304.03442" rel="noopener noreferrer"&gt;“Generative Agents: Interactive Simulacra of Human Behavior” (ACM UIST 2023).&lt;/a&gt; Its core idea is a &lt;strong&gt;memory stream&lt;/strong&gt; — a natural-language log of everything the Agent observes, does, and thinks.&lt;/p&gt;

&lt;p&gt;The behavior cycle is simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Perceive:&lt;/strong&gt; write each new observation to the memory stream.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve:&lt;/strong&gt; pick the memories most useful right now, based on recency (time decay), importance (LM-rated 1-10), and relevance (semantic similarity to the current context).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reflect:&lt;/strong&gt; cluster recent entries into broader takeaways (“I enjoy helping people”) that are saved back to memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan:&lt;/strong&gt; turn goals and reflections into an ordered set of actions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Act:&lt;/strong&gt; execute the next step, record the result back to memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fact that your AI Agent doesn’t remember is a technical limitation of AI’s context window. As we’ve already understood, the model isn’t actively maintaining a knowledge base of what happened before. In practice, that means all the project structure, code details, and requirements you fed it earlier may be absent today.&lt;/p&gt;

&lt;p&gt;What is more crucial is that AI forgets the right decision it made. So if it wrote for you some brilliant piece of code or fixed an old bug doesn’t mean it would really understand how to do the same later on. Maintaining conversation memory with an AI Agent or preserving the Agent’s context and understanding across sessions is impossible without special handling.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In modern development, if an AI Agent can’t accumulate experience, learn from mistakes, or follow a development narrative over time, it may be less useful in long-living coding projects and large codebases.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Why developers need Agent workflow memory
&lt;/h2&gt;

&lt;p&gt;Lack of long-term memory actively hinders productivity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every session starts from zero.&lt;/strong&gt; Yesterday’s complex deployment explanation? Gone.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No project context.&lt;/strong&gt; Custom utilities, deprecated patterns — forgotten.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No learning across time.&lt;/strong&gt; Good answers aren’t reused; the Agent never gets smarter.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No team-wide learning.&lt;/strong&gt; A bug fix found by one Agent isn’t shared with others.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No shared access to data/docs.&lt;/strong&gt; Each dev’s context stays local.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge leaves with people.&lt;/strong&gt; Departing teammates take their AI experience with them.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Poor onboarding.&lt;/strong&gt; New hires start from scratch; the Agent can’t surface prior answers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given these limitations, it’s clear that enabling long-term memory in AI is the missing piece to make AI Agents truly effective.&lt;/p&gt;




&lt;h2&gt;
  
  
  Team knowledge in AI Agent: The future of software development
&lt;/h2&gt;

&lt;p&gt;Imagine an Agent for IDE that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Records its moves,&lt;/li&gt;
&lt;li&gt;Notes which approaches succeed or fail,&lt;/li&gt;
&lt;li&gt;Stores those as memory items,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, when faced with a similar task, &lt;strong&gt;retrieves relevant past attempts&lt;/strong&gt; and solves the new problem with full context &lt;em&gt;plus&lt;/em&gt; experience.&lt;/p&gt;

&lt;p&gt;Extend that to a team: each Agent’s personal memory stream merges into a &lt;strong&gt;shared knowledge base&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The whole team gains automatic access to the best solutions, patterns, and gotchas discovered by anyone’s AI Agent on the project. A bug fix found by one Agent becomes instantly available to another even across team members. This collective memory becomes a form of AI-driven knowledge transfer across the team — a self-updating wiki of coding wisdom for the project at hand.&lt;/p&gt;




&lt;h2&gt;
  
  
  AI knowledge management platform for long-term memory
&lt;/h2&gt;

&lt;p&gt;The most efficient organization is a &lt;strong&gt;cloud workspace&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Admins manage memory items.
&lt;/li&gt;
&lt;li&gt;Agents connect to shared databases, docs, APIs.
&lt;/li&gt;
&lt;li&gt;Each Agent is both &lt;em&gt;contributor&lt;/em&gt; and &lt;em&gt;consumer&lt;/em&gt; of the knowledge base.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By coordinating memory at the team level, you ensure AI output consistency. And the payoff is huge: fewer duplicated efforts, fewer recurring bugs, and onboarded developers get up to speed faster with the help of an AI that actually knows the project.&lt;/p&gt;

&lt;p&gt;How many times have you wished “&lt;em&gt;Didn’t we solve a similar problem last month?&lt;/em&gt;” - now the AI can instantly answer that and even apply the previous solution. Ultimately, when AI Agents gain long-term memory and shared team-wide data access, they stop repeating mistakes and start accelerating progress. Developers don’t just get a helpful AI digital twin: they get a system that remembers, learns, and collaborates at scale.&lt;/p&gt;

&lt;p&gt;To sum up: &lt;strong&gt;integrating long-term memory and shared data access at the team level becomes an anti-frustration pill for AI Agents&lt;/strong&gt;, letting them pull in relevant project knowledge whenever developers need it while programming with AI.&lt;/p&gt;




&lt;h2&gt;
  
  
  Programming &lt;em&gt;without&lt;/em&gt; memory vs. &lt;em&gt;with&lt;/em&gt; memory
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Aspect&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;❌ &lt;em&gt;Without a memory layer&lt;/em&gt;
&lt;/th&gt;
&lt;th&gt;✅ &lt;em&gt;With memory&lt;/em&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Context handling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Requires repeated explanations&lt;/td&gt;
&lt;td&gt;AI Agent remembers past conversations and task states; resumes with full context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Access to shared project resources&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Each dev manually re-uploads docs or snippets; context stays local&lt;/td&gt;
&lt;td&gt;Team Agents query shared DBs, docs, and APIs via a connected memory layer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Team collaboration&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No knowledge sharing; best practices are isolated&lt;/td&gt;
&lt;td&gt;Agents share successful approaches automatically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Knowledge reuse&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Agent re-learns similar tasks from scratch&lt;/td&gt;
&lt;td&gt;Proven solutions are reused and instantly applied across sessions &amp;amp; devs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Code quality over time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Inconsistent; depends on each dev’s prompting skills&lt;/td&gt;
&lt;td&gt;Agents generate code aligned with project standards and improve with use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Onboarding new members&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;New devs start from zero; must learn project &amp;amp; AI practices&lt;/td&gt;
&lt;td&gt;Agents preload project knowledge &amp;amp; conventions; useful from day 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Knowledge loss when teammates leave&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Experience with AI programming is lost&lt;/td&gt;
&lt;td&gt;Persistent memory retains learnings for future teammates&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you want to maintain AI context and understanding across programming sessions, you need an AI Agent &lt;strong&gt;with memory&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Implement memory in your AI Agent for programming
&lt;/h2&gt;

&lt;p&gt;Forgetting is &lt;em&gt;not&lt;/em&gt; a given. When choosing an AI coding tool, ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does it forget everything when you close the window, or does it learn and improve with you?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That single difference defines whether it’s the best AI Agent for software development or just another tool.&lt;/p&gt;

&lt;p&gt;The era of long-term memory in AI Agents is just beginning. These Agents remember your codebase, follow your standards, and re-apply successful solutions across tasks and teammates.&lt;/p&gt;

&lt;p&gt;You can be among the first to adopt an AI Agent with memory. It runs inside your IDE with no complex setup, but the impact is real.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Want an AI Agent with memory for a team of 3 + developers? &lt;a href="https://refact.ai/waitlist/" rel="noopener noreferrer"&gt;Fill out the form to join the Waitlist&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>SWE-bench Multimodal is the benchmark that JavaScript devs might explore</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Thu, 26 Jun 2025 22:26:20 +0000</pubDate>
      <link>https://dev.to/refact/swe-bench-multimodal-is-the-benchmark-that-javascript-devs-might-explore-3550</link>
      <guid>https://dev.to/refact/swe-bench-multimodal-is-the-benchmark-that-javascript-devs-might-explore-3550</guid>
      <description>&lt;p&gt;We recently ran Refact.ai Agent on &lt;a href="https://www.swebench.com" rel="noopener noreferrer"&gt;SWE-bench Multimodal&lt;/a&gt;, &lt;strong&gt;a benchmark that honestly doesn’t get enough attention&lt;/strong&gt;. It’s one of the few evaluations that test if AI can fix bugs described using screenshots (e.g., UI mockups, diagrams, error messages, etc.).&lt;/p&gt;

&lt;p&gt;Unlike SWE-bench Verified (Python-only), the Multimodal version focuses on web libraries and frontend tasks. That makes it more representative of real-world debugging, especially in JavaScript environments where bugs are often reported this way.&lt;/p&gt;

&lt;p&gt;So, I'm here to share that our &lt;strong&gt;AI Agent Refact.ai has achieved #1 on SWE-bench Multimodal&lt;/strong&gt;. It solved 184 out of 517 tasks (35.59%) and did it fully autonomously. &lt;strong&gt;We also scored highest on SWE-bench Verified&lt;/strong&gt; among AI Agents solving tasks in pass@1 (in one attempt).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v2j83vaevsccddze0lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v2j83vaevsccddze0lg.png" alt="Refact.ai is the leading AI Agent for programming on SWE Bench" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full &lt;a href="https://github.com/smallcloudai/refact-bench" rel="noopener noreferrer"&gt;SWE-bench pipeline we used is open-source&lt;/a&gt; and fully reproducible. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can run Refact.ai in &lt;a href="https://marketplace.visualstudio.com/items?itemName=smallcloud.codify" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt;, &lt;a href="https://plugins.jetbrains.com/plugin/20647-refact--open-source-ai-agent-code-generator--chat" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt;, or self-host: it can fix the toughest bugs, solve routine dev tasks you delegate, build working solutions from scratch, and help you do more with less manual coding!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this post, I’ll walk through how we achieved top results on SWE-bench and the tech behind the runs.&lt;/p&gt;




&lt;h2&gt;
  
  
  #1 AI Agent in SWE-bench Multimodal is Refact.ai
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.swebench.com/multimodal.html" rel="noopener noreferrer"&gt;SWE-bench Multimodal&lt;/a&gt; tests whether an AI Agent can handle GitHub issues that include both text and visuals, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Screenshots of bugs or interface issues
&lt;/li&gt;
&lt;li&gt;Design mockups or wireframes
&lt;/li&gt;
&lt;li&gt;Diagrams explaining desired functionality
&lt;/li&gt;
&lt;li&gt;Error messages with visual context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It covers tasks from libraries used in web interfaces, diagramming, data visualization, syntax highlighting, and more.&lt;/p&gt;

&lt;p&gt;We ran this benchmark &lt;strong&gt;fully autonomously&lt;/strong&gt; using a locally modified version of the official &lt;code&gt;sb-cli&lt;/code&gt; to enforce single-threaded execution.  &lt;/p&gt;

&lt;p&gt;Also, we didn’t use extra agentic tools like &lt;code&gt;debug_script&lt;/code&gt; or &lt;code&gt;strategic_planning&lt;/code&gt;, which were part of our earlier Verified runs.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Evaluation results:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;th&gt;Solved&lt;/th&gt;
&lt;th&gt;Solved (%)&lt;/th&gt;
&lt;th&gt;Not solved&lt;/th&gt;
&lt;th&gt;Failed runs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;517&lt;/td&gt;
&lt;td&gt;184&lt;/td&gt;
&lt;td&gt;35.59%&lt;/td&gt;
&lt;td&gt;326&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;Achieving &lt;strong&gt;#1 on SWE-bench Multimodal&lt;/strong&gt; makes &lt;a href="https://refact.ai/" rel="noopener noreferrer"&gt;Refact.ai a top-tier AI Agent for JavaScript tasks&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;Combined with our leading results on Python-based SWE-bench, it confirms the Agent’s ability to deliver &lt;strong&gt;high-quality results across programming languages&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Refact.ai’s open-source approach to SWE-bench
&lt;/h2&gt;

&lt;p&gt;The new run introduced a key upgrade: &lt;strong&gt;Anthropic’s Claude 4 Sonnet&lt;/strong&gt; as the core model, bringing a notable boost in reasoning and code generation. With it, Refact.ai Agent reached a &lt;strong&gt;74.40% score&lt;/strong&gt; — surpassing &lt;a href="https://refact.ai/blog/2025/open-source-sota-on-swe-bench-verified-refact-ai" rel="noopener noreferrer"&gt;Refact.ai's best SWE-bench Verified score of 70.4%&lt;/a&gt; with Claude 3.7 Sonnet.&lt;/p&gt;

&lt;p&gt;Beyond that, this milestone builds on everything we’ve learned from earlier SWE-bench runs.&lt;/p&gt;

&lt;p&gt;Our approach remains focused on &lt;strong&gt;reliability&lt;/strong&gt; and &lt;strong&gt;step-by-step problem solving&lt;/strong&gt;. Key elements of the SWE-bench Verified setup included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/smallcloudai/refact/blob/swe-verified-claude4/refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml#L63" rel="noopener noreferrer"&gt;Open-source Agent prompt, available on GitHub&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude 4 Sonnet&lt;/strong&gt; as a core model
&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;debug_script()&lt;/code&gt; sub-agent that fixes bugs and can modify/create new scripts
&lt;/li&gt;
&lt;li&gt;Extensive guardrails to catch when the model is stuck or going off track, and to redirect it back on course
&lt;/li&gt;
&lt;li&gt;Incremental improvements built on our previous Claude 3.7 run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How does Refact.ai Agent solve the SWE-bench Verified tasks? It follows a &lt;strong&gt;four-step strategy&lt;/strong&gt; defined &lt;a href="https://github.com/smallcloudai/refact/blob/swe-verified-claude4/refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml#L63" rel="noopener noreferrer"&gt;in its system prompt&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The Agent starts by &lt;strong&gt;exploring the problem&lt;/strong&gt;: using tools like &lt;code&gt;cat()&lt;/code&gt; to open files, &lt;code&gt;search_symbol_definition()&lt;/code&gt;, &lt;code&gt;search_pattern()&lt;/code&gt;, etc. to locate relevant code. The Agent also uses &lt;code&gt;compress_session()&lt;/code&gt;, ensuring it gathers the right context before attempting any changes.&lt;/p&gt;

&lt;p&gt;At &lt;strong&gt;step two&lt;/strong&gt;, the Agent &lt;strong&gt;reproduces the issue&lt;/strong&gt;. It runs all existing tests to ensure a clean baseline, writes a script that triggers the bug (covering all possible edge cases), sets up the environment, and runs the script via &lt;code&gt;shell("python ...")&lt;/code&gt; to confirm the failure. Then &lt;code&gt;debug_script()&lt;/code&gt; takes over — a custom sub-agent that uses &lt;code&gt;pdb&lt;/code&gt; to debug, modify, and generate scripts. Powered by Claude 4 with &lt;code&gt;o4-mini&lt;/code&gt; for summarizing the debug info, it’s called at least once — and up to three times — per task. In practice, it was really helpful for digging into the problem source.&lt;/p&gt;

&lt;p&gt;Once complete, the Agent &lt;strong&gt;plans and applies the fix&lt;/strong&gt; based on the debugging report. It updates project files directly, without creating patches and diffs. In the earlier run, this step used a separate &lt;code&gt;strategic_planning()&lt;/code&gt; tool. With Claude 4 Sonnet, that’s no longer needed — the model’s reasoning is strong enough to handle this job on its own. Finally, the Agent &lt;strong&gt;checks its work&lt;/strong&gt;: re-runs the reproduction script and the project’s existing tests to validate the fix. If all tests pass, it uses &lt;code&gt;compress_session()&lt;/code&gt; to offload any debug or temporary files and optimize context usage before ending the run.&lt;/p&gt;

&lt;p&gt;Throughout the run, &lt;strong&gt;automatic guardrails&lt;/strong&gt; help keep the Agent on track. These are mid-run messages, inserted into the chat as if from a simulated “user” when the model gets stuck or makes mistakes. A script statically monitors Claude 4’s outputs, and when needed, injects messages to guide the model back on course. For example, it may remind the model to open all visited files after &lt;code&gt;debug_script()&lt;/code&gt;, or to follow correct implementation rules after planning. These small actions make a big difference in stability.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The entire run is fully autonomous: no manual inputs, no retries. Each task runs in a single session, with the Agent self-correcting and managing context to stay efficient and produce a single correct solution.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  SWE-bench Verified vol.2: What changed in the new run
&lt;/h2&gt;

&lt;p&gt;Several upgrades helped push Refact.ai Agent from 70.4% to 74.4% on SWE-bench Verified:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model upgrade to Claude 4 Sonnet&lt;/strong&gt;: Replaced Claude 3.7 with the more advanced Claude 4 Sonnet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Removed &lt;code&gt;strategic_planning()&lt;/code&gt;&lt;/strong&gt;: Previously, this tool (powered by &lt;code&gt;o3&lt;/code&gt;) reasoned over &lt;code&gt;debug_script()&lt;/code&gt; output and modified files. This is now fully handled by Claude 4 Sonnet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New safeguard for file overload&lt;/strong&gt;: Agent used to open entire folders using &lt;code&gt;cat&lt;/code&gt;, leading to context overflow. We’ve added a limit: if a folder contains more than 5 files, the Agent returns an error and asks for one-by-one access: &lt;em&gt;“Too many files were requested. Please open files one by one.”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extra guardrail at the end of the session&lt;/strong&gt;: “Check the last time that all changes applied to the project directly and all pre-existing tests aren’t broken.”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Larger context for &lt;code&gt;search_pattern()&lt;/code&gt;.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Minor tweaks to &lt;code&gt;debug_script()&lt;/code&gt; prompt.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these improvements work together to make Refact.ai Agent &lt;strong&gt;more robust and efficient&lt;/strong&gt;. Moving to Claude 4 Sonnet significantly boosted reasoning ability and allowed us to simplify the agent’s loop while still solving more tasks. Meanwhile, the debug sub-agent and guardrails have been enhanced to ensure greater reliability throughout each run.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Evaluation results:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;th&gt;Solved&lt;/th&gt;
&lt;th&gt;Not solved&lt;/th&gt;
&lt;th&gt;Solved (%)&lt;/th&gt;
&lt;th&gt;Not solved (%)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;372&lt;/td&gt;
&lt;td&gt;128&lt;/td&gt;
&lt;td&gt;74.40%&lt;/td&gt;
&lt;td&gt;25.60%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  From benchmark to your IDE
&lt;/h2&gt;

&lt;p&gt;Ultimately, our focus isn’t only on benchmark scores — it’s on building an AI agent that truly works for real developers. The lessons learned and improvements made for SWE-bench are already finding their way into the product. That means when you use Refact.ai, you’re benefitting from the engineering approach that achieved this benchmark record.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Solves tasks autonomously&lt;/strong&gt;, from start to finish&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fully understands your codebase&lt;/strong&gt;, not just open tabs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transparent by design&lt;/strong&gt; — every step is visible and reversible&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrates with dev tools&lt;/strong&gt; (GitHub, Web, MCP, and more) to work across your system&lt;/li&gt;
&lt;li&gt;BYOK-friendly or self-hosted &lt;strong&gt;if you want full control&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://refact.ai/" rel="noopener noreferrer"&gt;Refact.ai Agent is an AI Agent for software engineering&lt;/a&gt; you can trust — and guide when needed. Autonomous when you want it, collaborative when you step in.&lt;/p&gt;

&lt;p&gt;If you’re ready to work with an AI that understands your environment, works across your tools, and earns your trust one task at a time — Refact.ai is ready for you. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://discord.com/invite/9GaWEK9Btb" rel="noopener noreferrer"&gt;Join our community&lt;/a&gt; to see what real developers are building end-to-end. &lt;br&gt;
And of course, I'd be happy to answer any of your questions and chat. Thanks for reading!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How we built the open-source SOTA AI Agent on SWE-bench Verified</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Thu, 22 May 2025 19:02:36 +0000</pubDate>
      <link>https://dev.to/refact/how-we-built-the-open-source-sota-ai-agent-on-swe-bench-verified-1gml</link>
      <guid>https://dev.to/refact/how-we-built-the-open-source-sota-ai-agent-on-swe-bench-verified-1gml</guid>
      <description>&lt;p&gt;We built the open-source SOTA AI Agent on SWE-bench Verified. Score: 69.9% — 349/500 tasks solved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://openai.com/index/introducing-swe-bench-verified/" rel="noopener noreferrer"&gt;SWE-bench Verified&lt;/a&gt; is a refined version of the original SWE-bench, featuring 500 real-world GitHub issues, selected manually. It provides a more accurate and consistent way to evaluate how well AI agents can handle practical software engineering tasks.&lt;/p&gt;

&lt;p&gt;Key elements that made this possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extensive guardrails that step in when the model gets stuck or goes off track&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;debug_script()&lt;/code&gt; sub-agent that uses pdb to fix bugs and can modify/create new scripts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;strategic_planning()&lt;/code&gt; tool powered by o3 to rethink and refine fixes when needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/smallcloudai/refact-bench" rel="noopener noreferrer"&gt;The full pipeline we used for SWE-bench Verified is open-source — you can check it on GitHub&lt;/a&gt;. You can implement the same components and run the benchmark just like we did — to reproduce our Agent approach and score end-to-end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read on&lt;/strong&gt; to see how &lt;a href="https://refact.ai/blog/2025/open-source-sota-on-swe-bench-verified-refact-ai/" rel="noopener noreferrer"&gt;Refact.ai became the best open-source Agent in SWE-bench Verified&lt;/a&gt;, and how the same ideas power real-world workflows in Refact.ai.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Model setup&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Orchestration model: Claude-3.7&lt;/li&gt;
&lt;li&gt;Debug sub-agent — &lt;code&gt;debug_script()&lt;/code&gt;: Claude-3.7 + o4-mini&lt;/li&gt;
&lt;li&gt;Planning tool — &lt;code&gt;strategic_planning()&lt;/code&gt;: o3&lt;/li&gt;
&lt;li&gt;pass@1: Each task is not attempted more than once.&lt;/li&gt;
&lt;li&gt;Temperature: 0 for every Claude model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each SWE-bench Verified problem, &lt;a href="https://refact.ai" rel="noopener noreferrer"&gt;Refact.ai&lt;/a&gt; Agent made one multi-step run aiming to produce a &lt;strong&gt;single, correct final solution.&lt;/strong&gt; Our main goal was to achieve a maximum score in a single attempt.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Simpler, more effective Agent prompt&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We revised the Agent prompt from our &lt;a href="https://refact.ai/blog/2025/sota-on-swe-bench-lite-open-source-refact-ai/" rel="noopener noreferrer"&gt;SWE-bench Lite run, where we top-ranked with a 59.7% score&lt;/a&gt;. Back then, it was more complex, and looking at how AI Agent behaved, we realized that simpler is better.&lt;/p&gt;

&lt;p&gt;The new version is shorter and easier to follow. Since &lt;a href="https://github.com/smallcloudai" rel="noopener noreferrer"&gt;Refact.ai is open-source&lt;/a&gt;, you can explore it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a fully autonomous agent for coding tasks.
  Your task is to identify and solve the problem from the given PR by directly changing files in the given project.
  You must follow the strategy, step by step in the given order without skipping.
  **Step 1: Explore the Problem**
    - Use `cat()` to open files. Use `search_symbol_definition()`, `search_symbol_usages()` if you know names of symbols.
    - Use `search_pattern()` for search by pattern, `search_semantic()` for a semantic search.
  **Step 2: Reproduce the Problem using `debug_script()`**
    - Find and run all project's existing tests to ensure the fix won't introduce new problems elsewhere.
    - Write a script that reproduces the issue. Cover as many corner cases as possible.
    - Set up necessary environment (e.g., create required folders or additional files) to run the script.
    - Run the script using `shell("python ...")` to verify that the error occurs and the script is correct.
    - After verifying that the script is correct and reproduces the issue, call `debug_script()` to debug it.
  **Step 3: Make a Plan using `strategic_planning()` and fix the Problem**
    - Open all new files mentioned in `debug_script()` report.
    - Call `strategic_planning()` once to think through and brainstorm the solution.
    - Update projects files directly without creating patches and diffs.
  **Step 4: Check and Improve Your Work by running tests**
    - Execute the script that reproduces the original issue.
    - Run project's existing tests again to ensure the fix doesn't introduce new problems elsewhere.

  **BEST PRACTICES**
    - You must follow the strategy (explore -&amp;gt; reproduce -&amp;gt; solve -&amp;gt; check), step by step in the given order.
    - Before each step explicitly announce your next actions. Make sure they are still align with the strategy.
    - Include your thoughts wrapped in &amp;lt;think&amp;gt;&amp;lt;/think&amp;gt; before any action.
    - %CD_INSTRUCTIONS%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Introducing a debugging sub-agent&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When developers run into bugs, they investigate the code to figure out what went wrong. For our SWE-bench Verified run, that role was mimicked by &lt;code&gt;debug_script()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;debug_script()&lt;/code&gt; is a sub-agent inside Refact.ai that uses &lt;code&gt;pdb&lt;/code&gt; to debug, modify, and generate scripts. It helps AI Agent gather key issue details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which files are affected&lt;/li&gt;
&lt;li&gt;What actually caused the failure&lt;/li&gt;
&lt;li&gt;And how it might be fixed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under the hood, &lt;code&gt;debug_script()&lt;/code&gt; is powered by Claude-3.7, with o4-mini for summarizing debug info. We forced Refact.ai Agent to call this tool at least once — and up to three times — during each task.&lt;/p&gt;

&lt;p&gt;In practice, this debugging sub-agent was really helpful for digging into the problem source.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Guardrails to keep AI Agent on track&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The more we tried to constrain the model, the more it resisted. Since the goal was to solve each task in one go, we needed ways to make Agent more reliable.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We added &lt;strong&gt;automatic guardrails&lt;/strong&gt; that kick in when the model gets stuck or makes mistakes. Essentially, these are helper messages, inserted into the chat mid-run as if from a simulated “user” — to nudge Agent back on track. It’s all automated: the script runs static checks on the main model’s (Claude-3.7) messages, and if it detects signs that something is going off track, it sends a message into the chat to help guide the model back in the right direction. These small actions make a big difference in stability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extra prompts after sub-agent calls:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After debug_script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;💿 Open all visited files using `cat(file1,file2,file3,…)`!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After strategic_planning():&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;💿 Now implement the solution above.

Reminders:

- Do not create documents, README.md, or other files which are non-related to fixing the problem.
- Convert generated changes into the `update_textdoc()` or `create_textdoc()` tool calls. Do not creat
patches (in diff format) or monkey-patches!
- Change the project directly to fix the issue but do not modify existing tests.
- Find and run all project’s existing tests to ensure the fix won’t introduce new problems elsewhere.
- Create new test files only using `create_textdoc()`.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Guardrails for Agent flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;💿 Use `debug_script()` instead of `shell()`; dig deeper than previous attempts and set breakpoints inside the project.
💿 Do not call `debug_script()` more than three times.
💿 Call `strategic_planning()` before modifying the project.
💿 If you struggle to find the correct solution, consider using `debug_script()` or `strategic_planning()`.
💿 You cannot call {a_tool_name}\ while on the previous step—follow the strategy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Strategic planning&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;strategic_planning()&lt;/code&gt; tool comes in at Step 3 of the Agent prompt. It helps the model improve solution quality by reflecting on what went wrong — and what could be done better — based on the &lt;code&gt;debug_script()&lt;/code&gt; report. It uses reasoning, powered by o3, and updates project files directly, without generating patches and diffs.&lt;/p&gt;

&lt;p&gt;For this tool, we enforce one call per task.&lt;/p&gt;

&lt;p&gt;Since the observation layer (&lt;code&gt;search&lt;/code&gt; + &lt;code&gt;pdb&lt;/code&gt; debug) was already quite efficient, strategy planning sometimes lagged. We tried the o4-mini and o3 models and found no obvious differences on a small subset of tasks. That said, both models were prone to overcomplicating tasks or not smart enough to identify the real root cause. Claude 3.7 might be a good candidate as a planning model in the future, given how well it did in other parts of the workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Improvements over the SWE-bench Lite strategy&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A 59.7% score on the SWE-bench Lite was a solid start. We shared &lt;a href="https://refact.ai/blog/2025/sota-on-swe-bench-lite-open-source-refact-ai/" rel="noopener noreferrer"&gt;the full technical breakdown in our earlier blog post&lt;/a&gt; — but even with a SOTA result, this run exposed a few weak spots.&lt;/p&gt;

&lt;p&gt;Before tackling SWE-bench Verified, we prioritized addressing these issues found.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools-related updates:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed a few tool-related issues, making the tools more tolerant of the model’s uncertainty when calling them.&lt;/li&gt;
&lt;li&gt;Renamed tools — the model often skipped some tools as their names were unclear. New names:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;definition()     -&amp;gt; search\_symbol\_definition()  
references()     -&amp;gt; search\_symbol\_usages()  
regex\_search()  -&amp;gt; search\_pattern()  
search()         -&amp;gt; search\_semantic()  
deep\_analysis() -&amp;gt; strategic\_planning()  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Fixed the AST mechanisms inside refact-lsp that prevented decorated symbols from being parsed.&lt;/li&gt;
&lt;li&gt;Resolved an issue where Agent didn’t wait for ast/vecdb to finish indexing the project.&lt;/li&gt;
&lt;li&gt;We now mark line numbers, which add extra stability with retrieval tools like cat, search, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Context-related updates:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduced the strength of chat compression. Claude 3.7 often tried to cat files already in context; instead of blocking it (which caused loops), we now allow the model to receive them again.&lt;/li&gt;
&lt;li&gt;Encouraged the model to open whole files instead of many tiny cat calls to read a file line by line.&lt;/li&gt;
&lt;li&gt;When the model opens large files, it noticeably degrades as the context size grows quickly. We continue to adjust this balance.
During the SWE-bench Verified run, all these improvements were implemented.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What we tried that did not work&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Not every experiment makes it to production. Here’s what we tested — and what we implemented:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Didn’t work&lt;/th&gt;
&lt;th&gt;What works instead&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A separate &lt;code&gt;critique&lt;/code&gt; tool that allowed the model to assess its own changes.&lt;/td&gt;
&lt;td&gt;Turns out, the model does better when it just runs tests and decides the next steps based on results.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A complex &lt;code&gt;strategic_planning()&lt;/code&gt; tool flow with four steps: root-cause analysis → initial solution → critique → refined solution. It overcomplicated simple tasks and lowered success rates.&lt;/td&gt;
&lt;td&gt;Now, &lt;code&gt;strategic_planning()&lt;/code&gt; only generates a solution — and this works better.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Using a &lt;code&gt;pdb()&lt;/code&gt; tool without a dedicated sub-agent. The Claude model preferred &lt;code&gt;shell()&lt;/code&gt; over &lt;code&gt;pdb()&lt;/code&gt;, so debugging rarely happened.&lt;/td&gt;
&lt;td&gt;Introducing the &lt;code&gt;debug_script()&lt;/code&gt; sub-agent made it reliable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Running without sub-agents. As context grew, Claude 3.7 quickly became less accurate and stopped following instructions.&lt;/td&gt;
&lt;td&gt;Letting sub-agents do their job.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;From benchmark to real product&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;What makes Refact.ai stand out isn’t just the % of solved benchmark tasks — it’s how our AI Agent gets there. &lt;strong&gt;Our goal isn’t to win all leaderboards just for the sake of it, but to build an approach that actually works for real-world programming.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s why SWE-bench Verified is also a way to test and improve the actual engineering flow of our product. Many of the updates we made for the run (see: &lt;em&gt;Tools-related updates, Context-related updates&lt;/em&gt;) are already shipping in Refact.ai.&lt;/p&gt;

&lt;p&gt;The guard mechanisms are another example: in the product, we already have these helper messages that AI Agent automatically sends itself after calling certain tools. Like with &lt;code&gt;debug_script()&lt;/code&gt;: it gets the tool output, and also a static instruction to open all the related files mentioned. So, these guard mechanisms are already part of specific flows. And we’re planning more, incluiding chat-wide checks to spot earlier off-tracks and react to them.&lt;/p&gt;

&lt;p&gt;We’re also updating the AI Agent prompt used in Refact.ai for VS Code and JetBrains to improve product efficiency for our users. Notably, &lt;code&gt;strategic_planning()&lt;/code&gt; isn’t (and won’t be) called by default in pluggin — it’s heavy on coins spent and not always necessary, since the main model is often enough to solve the task. That said, if you think your task needs deeper reasoning, you can still call it manually in chat with @. Just keep in mind it’s coin-expensive.&lt;/p&gt;

&lt;p&gt;Refact.ai Agent solved SWE-bech Verified fully autonomously — but in real-world use, of course, developers often want more control. That’s why Refact.ai offers flexible interaction with manual overrides: you can delegate tasks to AI Agent, while it lets you preview and guide the process.&lt;/p&gt;

&lt;p&gt;That reflects our philosophy: autonomous AI Agent for programming you can trust — and control when you need to.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final score&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Out of 500 tasks in SWE-bench Verified:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;🥇 Solved: 349 (69.8% resolve rate)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Not solved: 151 (30.2%).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Evaluation results&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Total Instances&lt;/th&gt;
&lt;th&gt;Solved&lt;/th&gt;
&lt;th&gt;Not solved&lt;/th&gt;
&lt;th&gt;Solved (%)&lt;/th&gt;
&lt;th&gt;Not solved (%)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;349&lt;/td&gt;
&lt;td&gt;151&lt;/td&gt;
&lt;td&gt;69.8%&lt;/td&gt;
&lt;td&gt;30.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Resolved by Repository:

astropy/astropy: 9/22 (40.91%)
django/django: 165/231 (71.43%)
matplotlib/matplotlib: 20/34 (58.82%)
mwaskom/seaborn: 0/2 (0.0%)
pallets/flask: 1/1 (100.0%)
psf/requests: 6/8 (75.0%)
pydata/xarray: 18/22 (81.82%)
pylint-dev/pylint: 4/10 (40.0%)
pytest-dev/pytest: 16/19 (84.21%)
scikit-learn/scikit-learn: 28/32 (87.5%)
sphinx-doc/sphinx: 28/44 (63.64%)
sympy/sympy: 54/75 (72.0%)

Resolved by Time:

2013: 3/3 (100.0%)
2014: 2/2 (100.0%)
2015: 0/1 (0.0%)
2016: 2/2 (100.0%)
2017: 13/16 (81.25%)
2018: 14/24 (58.33%)
2019: 73/98 (74.49%)
2020: 79/108 (73.15%)
2021: 54/86 (62.79%)
2022: 71/102 (69.61%)
2023: 38/58 (65.52%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Get Refact.ai Agent for your IDE&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Refact.ai is an autonomous AI Agent that automates programming tasks — helping developers and IT teams move faster:&lt;/p&gt;

&lt;p&gt;With Refact.ai in your IDE, you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real automation that boosts productivity by 10x&lt;/li&gt;
&lt;li&gt;Seamless integration with your codebase, workflow, and dev tools&lt;/li&gt;
&lt;li&gt;A digital twin that handles your busywork and lets you focus on big things.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Available to everyone: install Refact.ai for &lt;a href="https://marketplace.visualstudio.com/items?itemName=smallcloud.codify" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; or &lt;a href="https://plugins.jetbrains.com/plugin/20647-refact--open-source-ai-agent-code-generator--chat" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt; today and feel the &lt;strong&gt;real impact in your everyday programming.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>#1 on SWE-bench lite, achieved fully autonomously by open-source Refact.ai Agent</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Mon, 05 May 2025 21:45:32 +0000</pubDate>
      <link>https://dev.to/refact/1-on-swe-bench-lite-achieved-fully-autonomously-by-open-source-refactai-agent-4mcj</link>
      <guid>https://dev.to/refact/1-on-swe-bench-lite-achieved-fully-autonomously-by-open-source-refactai-agent-4mcj</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;a href="https://refact.ai/blog/2025/sota-on-swe-bench-lite-open-source-refact-ai/?utm_source=media&amp;amp;utm_medium=devto&amp;amp;utm_campaign=SWE-light" rel="noopener noreferrer"&gt;Refact.ai Agent has achieved the #1 score on SWE-bench Lite&lt;/a&gt;&lt;/strong&gt; — solving 179 out of 300 tasks, for a 59,7% success rate. Our approach: &lt;strong&gt;&lt;a href="https://refact.ai/?utm_source=media&amp;amp;utm_medium=devto&amp;amp;utm_campaign=SWE-light" rel="noopener noreferrer"&gt;fully autonomous AI Agent for programming&lt;/a&gt;, no manual intervention needed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SWE-bench Lite is a benchmark that evaluates LLM-based systems on real GitHub issues from popular open-source Python projects. Each task requires applying a bug fix or feature implementation, then validating the result through test execution. This makes the benchmark particularly valuable for understanding how AI tools will perform in actual production environments.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Agent setup
&lt;/h2&gt;

&lt;p&gt;Refact.ai Agent takes a fully autonomous, iterative approach. It plans, executes, tests, and self-corrects — repeating steps as needed &lt;strong&gt;to reach a single correct solution with no user input&lt;/strong&gt;. So, the benchmark setup was designed to reflect our autonomy-first philosophy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prompt strategy: Defines the Agent’s behavior and high-level task-solving logic. &lt;a href="https://github.com/smallcloudai/refact/blob/swe-boosted-prompt/refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml#L63" rel="noopener noreferrer"&gt;Open-source and available on GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Model: Claude 3.7 Sonnet — responsible for orchestration and decision-making.&lt;/li&gt;
&lt;li&gt;Execution layer: refact-lsp, a backend that connects the model to tools and the environment.&lt;/li&gt;
&lt;li&gt;deep_analysis() tool: Enhanced reasoning, powered by o4-mini.
Tool suite for repository exploration, code modification, and testing. Used dynamically based on task needs.&lt;/li&gt;
&lt;li&gt;Step cap: 60 agent steps (each one a discrete action) per task.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What sets Refact.ai apart is that our AI Agent independently drives the entire process.&lt;/strong&gt; While some solutions take a semi-autonomous approach — requiring to manually invoke tools and guide the agent — Refact.ai Agent operates independently from start to finish.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt strategy
&lt;/h2&gt;

&lt;p&gt;Refact.ai’s &lt;a href="https://github.com/smallcloudai/refact/blob/swe-boosted-prompt/refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml#L63" rel="noopener noreferrer"&gt;SWE-bench Lite prompt&lt;/a&gt; follows a clear workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Describe the problem.&lt;/li&gt;
&lt;li&gt;Investigate the repo.&lt;/li&gt;
&lt;li&gt;Create and run problem reproduction script.&lt;/li&gt;
&lt;li&gt;Make up a plan (using deep_analysis() powered by o4-mini) and apply changes.&lt;/li&gt;
&lt;li&gt;Run tests and evaluate changes (including optional reasoning with deep_analysis())&lt;/li&gt;
&lt;li&gt;Repeat 4 and 5 steps until the problem is solved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This workflow serves as high-level guidance, not hard rules.&lt;/strong&gt; &lt;a href="https://refact.ai/?utm_source=media&amp;amp;utm_medium=devto&amp;amp;utm_campaign=SWE-light" rel="noopener noreferrer"&gt;Refact.ai Agent&lt;/a&gt; uses it to form its own strategy — repeating, skipping, or reordering steps based on task context.&lt;br&gt;
For each SWE-bench problem, Refact.ai Agent made &lt;strong&gt;one multi-step run to produce a single, correct final solution.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Claude 3.7: Model choice
&lt;/h2&gt;

&lt;p&gt;Refact.ai uses Claude 3.7 Sonnet &lt;strong&gt;with sampling temperature 0.0&lt;/strong&gt; as its core model for SWE-bench Lite. It demonstrated exceptional capabilities for autonomous workflows: following multi-step instructions, understanding complex codebases, and maintaining context across long interactions.&lt;/p&gt;

&lt;p&gt;We’ve previously paired &lt;a href="https://refact.ai/blog/2025/refact-ai-agent-achieves-93-3-on-aider-polyglot-benchmark/?utm_source=media&amp;amp;utm_medium=devto&amp;amp;utm_campaign=SWE-light" rel="noopener noreferrer"&gt;Refact.ai with Claude 3.7, solving the Polyglot benchmark&lt;/a&gt;, where it reached &lt;strong&gt;93.3% with Thinking Mode and 92.9% without&lt;/strong&gt; — the highest known scores to date on that task set.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deep-analysis() tool
&lt;/h2&gt;

&lt;p&gt;One of the key features in Refact.ai’s approach is the deep_analysis() tool. It adds a structured, three-step reasoning process that improves solution quality at critical moments in the task flow.&lt;/p&gt;

&lt;p&gt;deep_analysis() is powered &lt;strong&gt;by o4-mini&lt;/strong&gt; — a small, fast reasoning model that handles the cognitive load of problem-solving so Claude 3.7 can focus on orchestration.&lt;/p&gt;

&lt;p&gt;The prompt for deep_analysis() tool follows the pattern &lt;a href="https://github.com/smallcloudai/refact/blob/swe-boosted-prompt/refact-agent/engine/src/tools/tool_deep_analysis.rs#L150" rel="noopener noreferrer"&gt;[also on GitHub]&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solution generation
&lt;em&gt;”Get the initial solution.”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Critique
&lt;em&gt;”Please critique the solution above. Identify any weaknesses, limitations, or bugs. Be specific and thorough in your analysis. Remember, that the final solution must be minimal, robust, and effective.”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Refinement
&lt;em&gt;”Please improve the original solution based on the critique. Provide a comprehensive, refined solution that addresses the weaknesses identified in the critique while maintaining the strengths of the original solution.”&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structured loop is normally triggered during &lt;a href="https://github.com/smallcloudai/refact/blob/swe-boosted-prompt/refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml#L63" rel="noopener noreferrer"&gt;Step 4 of the Benchmark prompt&lt;/a&gt; — when planning and applying code changes. But in fact, Refact.ai Agent decides when to use this tool on its own.&lt;/p&gt;

&lt;p&gt;Completing the benchmark, we observed that Agent sometimes called deep_analysis()multiple times — first during planning, then again when testing and evaluating results. In other cases, it skipped the tool entirely. This proves that Refact.ai Agent doesn’t follow a rigid script, but instead &lt;strong&gt;prioritizes its own strategy to get the task done right.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools, tools, tools
&lt;/h2&gt;

&lt;p&gt;Refact.ai Agent has access to a variety of tools that allow it to interact with the entire development environment for tasks-solving.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code exploration: search(), regex_search(), definition(), references(), tree(), cat()&lt;/li&gt;
&lt;li&gt;Editing: create_textdoc(), update_textdoc()&lt;/li&gt;
&lt;li&gt;Shell execution: shell() — used to run Python tests and verify solutions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools enable AI Agent to navigate codebases, understand dependencies, make precise changes, and verify that its solutions work correctly. It uses them autonomously, what and when needed.&lt;/p&gt;

&lt;p&gt;Although Refact.ai Agent can also interface with real-world tools (GitHub, Docker, PostgreSQL, etc.) and 1000+ tools via MCP servers, these integrations weren’t used in the benchmark run — but are part of standard workflows in user environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  60 steps cap
&lt;/h2&gt;

&lt;p&gt;Claude 3.7 Sonnet has &lt;strong&gt;60 steps&lt;/strong&gt; to complete a task. A step = AI action, such as modifying a file, listing directories, or running tests. AI Agent strategically decides how to use these steps, leading to clear, controlled solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final SOTA score
&lt;/h2&gt;

&lt;p&gt;Out of 300 tasks in SWE-bench Lite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;🥇 Solved: 179 (59,7% resolve rate)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Not solved: 121 (40,3%).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Refact.ai Agent even managed to &lt;strong&gt;solve two SWE-bench tasks that no other listed agents have&lt;/strong&gt; (django-12589, sympy-21627) — supposedly, thanks to the o4-mini model’s reasoning capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluation results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;th&gt;Solved&lt;/th&gt;
&lt;th&gt;Not solved&lt;/th&gt;
&lt;th&gt;Solved (%)&lt;/th&gt;
&lt;th&gt;Unresolved (%)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;180&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;60,0%&lt;/td&gt;
&lt;td&gt;30,0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Resolved by repository
&lt;/h2&gt;

&lt;p&gt;astropy/astropy: 3/6 (50.0%) &lt;br&gt;
django/django: 78/114 (68.4%) &lt;br&gt;
matplotlib/matplotlib: 11/23 (47.8%) &lt;br&gt;
mwaskom/seaborn: 2/4 (50.0%) &lt;br&gt;
pallets/flask: 0/3 (0.0%) &lt;br&gt;
psf/requests: 5/6 (83.3%) &lt;br&gt;
pydata/xarray: 2/5 (40.0%) &lt;br&gt;
pylint-dev/pylint: 3/6 (50.0%) &lt;br&gt;
pytest-dev/pytest: 10/17 (58.8%) &lt;br&gt;
scikit-learn/scikit-learn: 17/23 (73.9%) &lt;br&gt;
sphinx-doc/sphinx: 6/16 (37.5%) &lt;br&gt;
sympy/sympy: 43/77 (55.8%)&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking forward
&lt;/h2&gt;

&lt;p&gt;Refact.ai’s performance on SWE-bench Lite demonstrates that AI agents are becoming increasingly capable of handling real-world software engineering tasks autonomously — not just generating code, but planning, debugging, testing, and refining it with minimal human input.&lt;/p&gt;

&lt;p&gt;Our next step is evaluating Refact.ai Agent on &lt;strong&gt;SWE-bench verified&lt;/strong&gt; — a benchmark with more rigorous testing.&lt;/p&gt;

&lt;p&gt;All of this is part of our open-source commitment. Developers can explore the system, understand how autonomy is implemented, and even contribute. We believe that as the baseline work of software development shifts to AI, human engineers will be free to focus on the more interesting and creative parts of the job — and invite developers to build the future of programming together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does SWE-bench matter for developers?
&lt;/h2&gt;

&lt;p&gt;This isn’t just about ranking highly on a benchmark — it’s about real-world coding impact. Refact.ai Agent helps developers and software companies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automate repetitive tasks across the SDLC&lt;/li&gt;
&lt;li&gt;Focus on core work while the AI handles the rest&lt;/li&gt;
&lt;li&gt;Deliver faster with the AI Agent working alongside you in your IDE&lt;/li&gt;
&lt;li&gt;Delegate with confidence, knowing the AI writes reliable, tested code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Get Refact.ai Agent for your IDE
&lt;/h2&gt;

&lt;p&gt;Vibe coding is the future of software development — get it today.&lt;br&gt;
Refact.ai’s autonomous AI Agent works like a senior developer in your IDE:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Works inside your workflow &amp;amp; with your dev tools&lt;/li&gt;
&lt;li&gt;Boosts productivity x10 with real automation&lt;/li&gt;
&lt;li&gt;Handles coding while you focus on core work&lt;/li&gt;
&lt;li&gt;Available to everyone in IDE.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try &lt;a href="https://refact.ai/?utm_source=media&amp;amp;utm_medium=devto&amp;amp;utm_campaign=SWE-light" rel="noopener noreferrer"&gt;open-source Refact.ai Agent for programming&lt;/a&gt; in &lt;a href="https://marketplace.visualstudio.com/items?itemName=smallcloud.codify" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; or &lt;a href="https://plugins.jetbrains.com/plugin/20647-refact--open-source-ai-agent-code-generator--chat" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt; and let us know what you think!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Top-10 Tips for Conscious Vibe Coding</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Tue, 01 Apr 2025 18:05:50 +0000</pubDate>
      <link>https://dev.to/refact/top-10-tips-for-conscious-vibe-coding-17fl</link>
      <guid>https://dev.to/refact/top-10-tips-for-conscious-vibe-coding-17fl</guid>
      <description>&lt;p&gt;Welcome to the world of “Vibe Coding” - a way that’s transforming how we build software. This approach shifts the traditional focus from algorithmic precision to intent-driven development, where developers and non-technical professionals describe what they want rather than how to achieve it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6o3e5ltjrj847n4hcuu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6o3e5ltjrj847n4hcuu.png" alt="Refact.ai Agent for Vibe Coding" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can read this text on our blog: &lt;a href="https://refact.ai/blog/2025/top-10-tips-for-conscious-vibe-coding/" rel="noopener noreferrer"&gt;Top-10 Tips for Conscious Vibe Coding&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is Vibe Coding?
&lt;/h2&gt;

&lt;p&gt;The term “Vibe Coding” entered the tech lexicon just months ago, courtesy of Andrej Karpathy, former Director of AI at Tesla and ex-OpenAI researcher. On February 3, 2025, Karpathy &lt;a href="https://x.com/karpathy/status/1886192184808149383" rel="noopener noreferrer"&gt;tweeted&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“There’s a new kind of coding I call “vibe coding”, where you fully give in to the vibes, embrace exponentials, and forget that the code even exists.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This simple yet profound statement captured the essence of a developing trend: allowing AI to handle the technical complexities while humans focus on ideation and direction. Since then, this term has exploded in popularity, with thousands of developers and entrepreneurs embracing this new paradigm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Top-10 Essential Tips for Successful Vibe Coding
&lt;/h2&gt;

&lt;p&gt;If you’re intrigued by the concept and eager to dive in, here are some practical 10 tips to enhance your Vibe Coding experience:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Give clear and concise instructions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your AI isn’t a mind reader. While it’s tempting to provide vague directions and expect magic, specificity is your friend. Instead of saying “build me a habit tracker,” try “create a NextJS-based habit tracker with daily streak tracking and a clean, colorful UI.” The more precise your instructions, the better the output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Leverage different AI models&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funocet2ubk9utwder0ji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funocet2ubk9utwder0ji.png" alt="Leverage different AI models in Refact.ai Agent" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use advanced reasoning models like GPT-o3-mini specifically for planning (in &lt;a href="https://refact.ai" rel="noopener noreferrer"&gt;Refact.ai&lt;/a&gt;, just click ‘Think’ button’) and creating detailed Product Requirements Documents (PRDs), then pass these comprehensive plans to execution-focused models like Claude 3.7 to handle the actual coding implementation. The planning models excel at high-level thinking while execution models efficiently translate those plans into functional code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Accept and iterate, don’t perfect&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The beauty of Vibe Coding lies in rapid iteration. Don’t get stuck trying to make everything perfect in one go. Accept what the AI generates, test it, and then refine your instructions based on what you see. This cycle of acceptance and iteration leads to faster development and better results. Refact.ai enhances this workflow with powerful tools that allow the Agent to close the feedback loop autonomously. The Chrome tool enables the Agent to open websites or localhost servers, click through interfaces, and capture screenshots to use as additional context. Similarly, the pdb tool allows the Agent to debug code execution in real-time, identifying and resolving issues without constant human intervention. These capabilities mean the Agent can not only generate code but also test it, observe its behavior in action, and incorporate visual feedback into subsequent iterations - dramatically accelerating the development cycle while maintaining quality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Structure your code in separate files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instruct a model (we recommend Claude 3.7) to generate code in a modular way, using separate files instead of one large script. Keeping everything in a single file can clutter the context window and slow down responses. Instead, request well-organized, smaller files for better clarity. Always remind the Agent to clean the generated code and unnecessary files at the end of every iteration. Also asking to update the README file after every change can be beneficial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Context is key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mastering context management is the secret weapon of vibe coders. &lt;a href="https://simonw.substack.com/p/how-i-use-llms-to-help-me-write-code" rel="noopener noreferrer"&gt;As Simon Willison&lt;/a&gt;, Django’s co-creator, points out:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“Most of the craft of getting good results out of an LLM comes down to managing its context - the text that is part of your current conversation.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your AI assistant only knows what you’ve shared with it, so deliberately controlling what information is in context for each request improves results. Refact.ai takes this to the next level with its RAG-based system which allows the Agent to select the most necessary files and also open them using commands like “tree” to view the directory structure and “cat” to read file contents. This autonomous context management gives the AI a comprehensive understanding of your codebase without requiring you to manually guide it through every file. The Agent intelligently determines which code components are relevant to your current task and brings them into context, ensuring generated code that’s tailored to your specific project architecture and conventions.&lt;/p&gt;

&lt;p&gt;The best way to work with &lt;a href="https://refact.ai" rel="noopener noreferrer"&gt;Refact&lt;/a&gt; is to simply indicate 1-2 initial files using the &lt;a class="mentioned-user" href="https://dev.to/file"&gt;@file&lt;/a&gt; command, and then let the system get the context from other files by itself. This efficient workflow combines the precision of targeted context with the power of autonomous exploration, creating the ideal balance for productive vibe coding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Learn from the Community&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Community is an incredible way to learn and exchange insights. Follow key figures, join forums, and participate in discussions to pick up new techniques. For example, join the &lt;a href="https://discord.com/invite/9GaWEK9Btb" rel="noopener noreferrer"&gt;Refact.ai Discord community&lt;/a&gt; where we gathered developers who are excited about AI-driven programming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Create a comprehensive prompt library&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Develop a collection of proven prompts that work well for specific tasks. Having templates for common operations like “implement authentication,” “create a responsive navbar,” or “set up database models” can significantly speed up your workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Understand the basics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While Vibe Coding reduces the need for deep technical knowledge, understanding fundamental concepts is still valuable. Knowing the difference between frontend and backend, basic data structures, and simple programming patterns will help you communicate effectively with your AI tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Document the process&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a personal library of effective prompts, patterns, and terminology that consistently yield quality results with your AI assistant. Document successful approaches and your reasoning behind key decisions—this documentation becomes invaluable as projects grow in complexity. Maintain a glossary of project-specific terms that your AI responds well to, noting how slight variations in wording can dramatically affect output quality. This systematic approach transforms vibe coding from a haphazard process into a reproducible methodology that improves with each iteration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Engineering discipline still matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even with powerful AI, engineering fundamentals remain essential. Here are several key pieces of advice from Refact.ai Co-founder Oleg Klimov, who emphasizes the importance of maintaining solid software development practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Know your stuff as an engineer. AI can accelerate development, but understanding core software engineering principles ensures you produce high-quality code.&lt;/li&gt;
&lt;li&gt;Pay attention to generated code. AI-generated code will form the core of your project, so review, refine, and optimize it regularly.&lt;/li&gt;
&lt;li&gt;Be aware of AI limitations, so learn models’ weaknesses and adjust accordingly.&lt;/li&gt;
&lt;li&gt;Reduce code size. Simplify your codebase by eliminating redundant parts at every opportunity&lt;/li&gt;
&lt;li&gt;Write tests and commit frequently. Establish working checkpoints so you can revert to stable versions if needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  AI Agent Useful Case Study
&lt;/h2&gt;

&lt;p&gt;User of Refact.ai, @Ukro built a complete IoT cloud monitoring Django application with the Refact.ai Agent doing 99.9% of the work. This real-world project included sophisticated features like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Permission management for various modules&lt;/li&gt;
&lt;li&gt;Automatic real-time updates via Ajax&lt;/li&gt;
&lt;li&gt;UI translation editing&lt;/li&gt;
&lt;li&gt;Dark/Light mode&lt;/li&gt;
&lt;li&gt;Custom OAuth2 SSO implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amazingly, @Ukro only needed to write the models.py file himself - everything else was handled by the AI agent. While Agent worked, @Ukro was busy with his main job and family, as he shared. Here are some screenshots of what the AI Agent built for him:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzvy1t8g312v4cxnxm5cr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzvy1t8g312v4cxnxm5cr.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkfuyktb6bsrsfh8g82lu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkfuyktb6bsrsfh8g82lu.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Potential risks of vibe coding
&lt;/h2&gt;

&lt;p&gt;Vibe coding comes with significant security concerns. Developers are integrating code they don’t fully understand, leading to potential vulnerabilities. Two primary security issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Blind trust&lt;/strong&gt;: Developers implementing AI-generated code without understanding its security implications&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency bloat&lt;/strong&gt;: AI tools often add unnecessary dependencies that expand the attack surface.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In its recent article, &lt;a href="https://www.indiehackers.com/post/tech/vibe-coding-has-a-security-problem-here-are-two-solutions-vLxyPTrTlZVwDo76oqvr" rel="noopener noreferrer"&gt;Indie Hackers&lt;/a&gt; gave the example of the non-technical guy &lt;a href="https://x.com/leojr94_" rel="noopener noreferrer"&gt;@leojr94_&lt;/a&gt; who capitalized on the vibe coding trend by building an app in public and earning quick revenue, then hackers began exploiting numerous security vulnerabilities in his app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc4ygiqig8jiifmrs1v8e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc4ygiqig8jiifmrs1v8e.jpg" alt="Potential risks of vibe coding" width="800" height="954"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To mitigate these risks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always review generated code for security best practices.&lt;/li&gt;
&lt;li&gt;Understand core algorithms even if you didn’t write every line.&lt;/li&gt;
&lt;li&gt;Scan for potential vulnerabilities before deploying.&lt;/li&gt;
&lt;li&gt;Minimize dependencies when possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And here are some more additional recommendations from Indie Hackers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t make your API keys public, store hardcoding keys in a secure environment that only the application can access.&lt;/li&gt;
&lt;li&gt;Don’t make an easily bypassable paywall&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, non-technical founders should balance their “ship fast” mentality with basic security measures or partnerships with security-focused developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What users think about Vibe Coding
&lt;/h2&gt;

&lt;p&gt;“Vibe coding” has exploded as a search term, evolving from niche concept to mainstream tech conversation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1c82djps13w6zyrip52g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1c82djps13w6zyrip52g.png" alt="Vibe coding is the future of software development" width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yet important distinctions are emerging in the discourse — some developers pointedly differentiates between intention-based “vibe coding” and potentially problematic “blind coding” where developers implement AI solutions without understanding them. The community response remains decidedly mixed: skeptics outnumber enthusiasts in recent discussions, with many experienced developers expressing reservations about reliability and maintenance implications. Join the discussion in our &lt;a href="https://discord.com/invite/9GaWEK9Btb" rel="noopener noreferrer"&gt;Discord community&lt;/a&gt; and share your thoughts!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4dxbrftegnuevdulz4xs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4dxbrftegnuevdulz4xs.png" alt="What developers think of vibe coding" width="800" height="1044"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Interestingly, the market is responding in polarized ways: some organizations are actively recruiting for “Vibe Coder” positions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuivjs3oyhmxha3gfzjb4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuivjs3oyhmxha3gfzjb4.jpg" alt="Vibe coder wanted" width="800" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While entrepreneurial developers have launched services specifically targeting the cleanup of problematic code generated through vibe coding approaches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewc2jw2yxghy1fgsrxup.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewc2jw2yxghy1fgsrxup.jpg" alt="Connect with expert developers to fix your code" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference between AI Tools for Vibe Coding
&lt;/h2&gt;

&lt;p&gt;This quadrant provides an overview of various AI coding tools, highlighting the key differences between those associated with “vibe coding” (such as Lovable, Bolt, and v0) and more developer-centric solutions like Refact.ai.&lt;/p&gt;

&lt;p&gt;It is a combination of two quadrants originally shared by &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:7295132016201588736/" rel="noopener noreferrer"&gt;Henry Shi&lt;/a&gt; (co-founder of Super.com) and &lt;a href="https://www.linkedin.com/posts/lucamezzalira_genai-developers-coding-activity-7309338036385792000-F9UI?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAADZs-MUB4aYFSf_rIeq9hYWWakw0z9dHAQU" rel="noopener noreferrer"&gt;Luca Mezzalira&lt;/a&gt; (Principal Serverless Specialist Solutions Architect at Amazon Web Services) who is also leading ‘Dear Architects’ newsletter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4tnx2ggqms9g7vp2fof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4tnx2ggqms9g7vp2fof.png" alt="Vibe coding tools" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-technical people focused tools:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Primarily designed for non-technical users (product managers, designers)&lt;/li&gt;
&lt;li&gt;Focus on natural language understanding&lt;/li&gt;
&lt;li&gt;Prioritize ease of use over technical precision&lt;/li&gt;
&lt;li&gt;Best for simple applications and prototypes (MVPs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Developer-centric solutions (Refact.ai)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Built for professional developers&lt;/li&gt;
&lt;li&gt;Balance between natural language and technical precision&lt;/li&gt;
&lt;li&gt;Integrate with existing development workflows&lt;/li&gt;
&lt;li&gt;Support complex codebases and enterprise requirements&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conscious vibe coding approach
&lt;/h2&gt;

&lt;p&gt;Vibe coding represents a paradigm shift in software development — one that promises greater accessibility, faster development cycles, and more focus on creative problem-solving. However, it also demands a new set of skills focused on effective communication, critical evaluation, and security awareness.&lt;/p&gt;

&lt;p&gt;Tools like Refact.ai are leading the way in conscious vibe coding, helping developers maintain quality and security while embracing the productivity benefits of AI collaboration. By developing a balanced approach that combines the intuitive nature of vibe coding with the rigor of traditional development practices, we can unleash the full potential of this new frontier.&lt;/p&gt;

&lt;p&gt;As we continue to explore the possibilities of AI-powered development, the most successful developers will be those who view AI not as a replacement for technical understanding, but as a powerful collaborator that amplifies their existing skills and expands their creative possibilities.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Thanks for reading!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://linktr.ee/refactai" rel="noopener noreferrer"&gt;Get Refact.ai Agent for IDE&lt;/a&gt; | More links: &lt;a href="https://github.com/smallcloudai/refact" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/refactai/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://x.com/refact_ai" rel="noopener noreferrer"&gt;X&lt;/a&gt;, &lt;a href="https://www.smallcloud.ai/discord" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
    </item>
    <item>
      <title>Refact.ai Agent scores highest on Aider's Polyglot Benchmark: 93.3% with Thinking Mode, 92.9% without</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Tue, 01 Apr 2025 16:34:54 +0000</pubDate>
      <link>https://dev.to/refact/refactai-agent-scores-highest-on-aiders-polyglot-benchmark-933-with-thinking-mode-929-1do2</link>
      <guid>https://dev.to/refact/refactai-agent-scores-highest-on-aiders-polyglot-benchmark-933-with-thinking-mode-929-1do2</guid>
      <description>&lt;p&gt;&lt;strong&gt;Refact.ai Agent, powered by Claude 3.7 Sonnet, has achieved top performance on the Aider Polyglot Benchmark:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;92.9% without Thinking&lt;/li&gt;
&lt;li&gt;93.3% with Thinking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This 20-point lead over the highest listed score (72.9% by Aider with Gemini 2.5 Pro) showcases Refact.ai’s superior autonomous coding capabilities. &lt;strong&gt;It handles programming tasks end-to-end in IDE — planning, execution, testing, refinement — and delivers a highly accurate result with zero human intervention.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0q9lpkm5chkhc8fbq5zq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0q9lpkm5chkhc8fbq5zq.png" alt="Refact.ai Agent scores highest on Aider's Polyglot Benchmark: 93.3% with Thinking Mode, 92.9% without" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://refact.ai/blog/2025/refact-ai-agent-achieves-93-3-on-aider-polyglot-benchmark/" rel="noopener noreferrer"&gt;Explore the full article on our blog&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Aider’s Polyglot benchmark evaluates how well AI models handle 225 of the &lt;a href="https://aider.chat/2024/12/21/polyglot.html#the-polyglot-benchmark" rel="noopener noreferrer"&gt;hardest coding exercises from Exercism&lt;/a&gt; across C++, Go, Java, JavaScript, Python, and Rust. Unlike SWE-Bench, which focuses solely on Python and single-file edits within 12 repos, Polyglot tests AI ability to write and integrate new code across diverse, multi-language projects, making it much closer to real-world developer workflows.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Our approach: How Refact.ai achieved #1 in the polyglot leaderboard
&lt;/h2&gt;

&lt;p&gt;Refact.ai Agent takes &lt;strong&gt;a fully autonomous, iterative approach. It plans, executes, tests, self-corrects, and repeats steps as needed to fully complete tasks with high accuracy — without human input.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other approaches&lt;/strong&gt; may follow a more manual, structured workflow, where some steps are &lt;strong&gt;controlled by human input + pre-defined scripts.&lt;/strong&gt; Aider’s benchmark setup looks similar to this, following the trajectory:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Prompt → User provides task description → User manually collects and adds files to the context → Model attempts to solve the task → Then retries, controlled by the number of —tries parameter → User runs tests manually and, if they fail, provides feedback to the model → Model does corrections → Result.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;This workflow requires ongoing user involvement&lt;/strong&gt; — manually providing context, running tests, and guiding the AI. The model itself doesn’t form a strategy, search for files, or decide when to test. Of course, this approach saves tokens, but it also lacks autonomy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refact.ai has a different, autonomy-first AI workflow:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Prompt + tool-specific prompts → User provides task description → AI Agent autonomously solves it within 30 steps (i.e. searches for the relevant data, calls tools, decides when corrections are needed, runs tests, etc.) → Result.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;So, Refact.ai interacts with the development environment, verifies its own work, and optimizes resources to fully solve the task end-to-end&lt;/strong&gt;, delivering efficient and practical programming flow with full-scope autonomy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is much closer to real-world software development and vibe coding&lt;/strong&gt;: developers can delegate entire tasks to AI Agent while doing other work, then simply receive the final result. It enables teams to get 2x more done in parallel, get the best out of AI models, and focus on big things instead of basic coding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key aspects of Refact.ai Agent approach:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1️⃣ 100% autonomy at each step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We at Refact.ai focus on making our AI Agent &lt;strong&gt;as autonomous, reliable, and trustworthy as possible.&lt;/strong&gt; To complete tasks, it follows a structured prompt — since Refact.ai is open-source, you can explore &lt;a href="https://github.com/smallcloudai/refact/blob/dev/refact-agent/engine/src/yaml_configs/customization_compiled_in.yaml#L63" rel="noopener noreferrer"&gt;our AI Agent prompt on GitHub&lt;/a&gt;. Below is an excerpt:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PROMPT_AGENTIC_TOOLS: |&lt;br&gt;
You are Refact Agent, an autonomous bot for coding tasks.&lt;br&gt;
STRATEGY&lt;br&gt;
Step 1: Gather Existing Knowledge&lt;br&gt;
Goal: Get information about the project and previous similar tasks.&lt;br&gt;
Always call the knowledge() tool to get initial information about the project and the task.&lt;br&gt;
This tool gives you access to memories, and external data, example trajectories (🗃️) to help understand and solve the task.&lt;br&gt;
Step 2: Gather Context&lt;br&gt;
Goal: Fully understand the task by gathering all important details.&lt;br&gt;
Do the following:&lt;br&gt;
Use tree() to check the project structure.&lt;br&gt;
Use locate() with the task description to find all necessary files automatically.&lt;br&gt;
Use additional tools like search(), regex_search(), cat(), definition(), and references() and any other to collect relevant information.&lt;br&gt;
Check any files that might indirectly relate to the task.&lt;br&gt;
Running available validation tools preliminary - is a good idea.&lt;br&gt;
Step 3: Make a Clear Plan&lt;br&gt;
Goal: Create a clear, validated plan before making changes.&lt;br&gt;
After gathering context (Step 2), create your plan independently.&lt;br&gt;
Only call deep_think() if:&lt;br&gt;
The task is very complex,&lt;br&gt;
You face complicated issues or loops,&lt;br&gt;
The user specifically asks for it.&lt;br&gt;
When using deep_think(), clearly state the task, what the outcome should look like, and carefully check the plan.&lt;br&gt;
After planning, use create_knowledge() to save important ideas, decisions, and strategies.&lt;br&gt;
Step 4: Make Changes Step-by-Step&lt;br&gt;
Goal: Follow the validated plan carefully.&lt;br&gt;
Make changes step-by-step using *_textdoc() tools.&lt;br&gt;
Clearly comment each step and its results.&lt;br&gt;
After making changes, go to the assessment step.&lt;br&gt;
Step 5: Check and Improve Your Work&lt;br&gt;
Goal: Make sure your changes are correct, complete, and really working.&lt;br&gt;
After changes:&lt;br&gt;
Run available build validation tools (cmdline_cargo_check(), cmdline_pytest*(), cmdline_npm_test(), etc…).&lt;br&gt;
If you find any issues, go back to Step 4 and fix them.&lt;br&gt;
If you cannot solve an issue even after multiple attempts, go back to Step 3 and use deep_think().&lt;br&gt;
Do not pay attention to skipped tests, they don’t indicate any problems&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In short: &lt;strong&gt;The AI analyzes files → creates a task plan → executes it → tests results → refines the solution — all without human intervention.&lt;/strong&gt; It independently decides what to check, fix, and retry. You don’t need to force this manually or copy-paste anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2️⃣ Deep environment interaction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The model fully integrates with the development environment. It can autonomously read files, call tools, modify code, run tests, and more as needed, whenever needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3️⃣ Capped at 30 steps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI Agent has 30 messages to complete a task. Here, a “message” doesn’t mean human input — AI only needs one: the task description. A message refers to each AI action, such as modifying a file, listing directories, or running tests.&lt;/p&gt;

&lt;p&gt;This cap ensures efficiency while avoiding unlimited retries or token inflation. AI Agent decides when and how to use these messages, leading to clear, controlled solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4️⃣ Self-testing with a possibility to check previous steps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tests are essential for autonomous AI to validate correctness and ensure the final output is reliable.&lt;/p&gt;

&lt;p&gt;Refact.ai Agent can run tests multiple times. &lt;strong&gt;It doesn’t just test the final output&lt;/strong&gt; — it can go back to earlier steps, correct mistakes, and retry. If test failures reveal deeper issues, the model may decide to revise previous actions and then create and test a new solution. Plus, the model sometimes runs tests even before trying to write a solution to gather a better preliminary context.&lt;/p&gt;




&lt;p&gt;Our approach may slightly differ from what Aider used for solving this benchmark, as our AI agent strategy and vision focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full autonomy of AI agent at every step, with no need for human input&lt;/li&gt;
&lt;li&gt;Deep integration with tools and dev environment, enabling Agent to act independently&lt;/li&gt;
&lt;li&gt;Self-testing autonomously when needed, revising earlier steps, testing mid-process, and running multiple checks for accuracy&lt;/li&gt;
&lt;li&gt;Task completion within 30 steps&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Refact.ai Agent improvements &amp;amp; benchmark progress
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Two weeks ago, we published that &lt;a href="https://refact.ai/blog/2025/refact-ai-agent-claude-3-7-sonnet-ranked-1-aider-polyglot/" rel="noopener noreferrer"&gt;Refact.ai had achieved 76.4% on Polyglot with Claude 3.7 Sonnet No-Thinking&lt;/a&gt;, already outperforming other listed results.&lt;/strong&gt; However, the benchmark run revealed areas for improvement: in some cases, AI lacked enough steps to finish tasks, or skipped testing. Now, we introduced general improvements to Refact.ai Agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Doubled limit for AI to solve the task from 15 → 30&lt;/strong&gt; to allow more complex solutions to fully complete.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enforced test execution&lt;/strong&gt;, ensuring AI validates itself at least once per task.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;These enhancements made Refact.ai Agent more effective for all users&lt;/strong&gt; — also boosting the score from 76.4% to 92.9%, and reaching 93.3% score with Thinking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thinking vs. No-Thinking mode: What’s the difference?
&lt;/h2&gt;

&lt;p&gt;“I think, therefore I am.” — René Descartes said. For AI, thinking isn’t philosophical, but practical. It refers to a state where models allocate additional computational resources for deeper reasoning.&lt;/p&gt;

&lt;p&gt;Completing the Polyglot benchmark, Claude 3.7 Sonnet with Thinking received &lt;strong&gt;+4K extra tokens per response to use reasoning when requested.&lt;/strong&gt; A quick recap of the results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;92.9% without Thinking&lt;/li&gt;
&lt;li&gt;93.3% with Thinking — but it also consumed nearly twice as many tokens to complete the benchmark.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 For production use, we recommend enabling Thinking when working on longer, multi-step problems requiring deeper analysis, or handling high-risk code changes where additional reasoning helps avoid errors. You can try it with Refact.ai Agent.&lt;/p&gt;




&lt;p&gt;Full breakdown, approach reveal &amp;amp; AI Agent insights we've shared on our blog: &lt;strong&gt;&lt;a href="https://refact.ai/blog/2025/refact-ai-agent-achieves-93-3-on-aider-polyglot-benchmark/" rel="noopener noreferrer"&gt;Refact.ai Agent scores highest on Aider's Polyglot Benchmark: 93.3% with Thinking Mode, 92.9% without.&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Happy to discuss!&lt;/p&gt;




&lt;p&gt;&lt;a href="https://linktr.ee/refactai" rel="noopener noreferrer"&gt;Get Refact.ai Agent for IDE&lt;/a&gt; | More links: &lt;a href="https://github.com/smallcloudai/refact" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://www.linkedin.com/company/refactai/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://x.com/refact_ai" rel="noopener noreferrer"&gt;X&lt;/a&gt;, &lt;a href="https://discord.com/invite/9GaWEK9Btb" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Our AI Agent + 3.7 Sonnet ranked #1 on Aider’s polyglot bench — a 76.4% score</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Tue, 18 Mar 2025 11:11:01 +0000</pubDate>
      <link>https://dev.to/refact/our-ai-agent-37-sonnet-ranked-1-on-aiders-polyglot-bench-a-764-score-10d0</link>
      <guid>https://dev.to/refact/our-ai-agent-37-sonnet-ranked-1-on-aiders-polyglot-bench-a-764-score-10d0</guid>
      <description>&lt;p&gt;We’ve built &lt;strong&gt;an open-source AI Agent for programming in IDE&lt;/strong&gt;, and it ranked #1 &lt;a href="https://aider.chat/docs/leaderboards/" rel="noopener noreferrer"&gt;on Aider’s Polyglot Benchmark&lt;/a&gt; with a 76.4% score. The benchmark tests autonomous problem-solving on 225 of the hardest coding exercises across C++, Go, Java, JavaScript, Python, and Rust.&lt;/p&gt;

&lt;p&gt;With this score, we’ve outperformed Aider’s own 60.4% with the same model, Claude 3.7 Sonnet, as well as DeepSeek Chat V3, GPT-4.5 Preview, and ChatGPT-4o.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbbqy5ki17r2d1z96lv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbbqy5ki17r2d1z96lv6.png" alt="Refact.ai + Claude 3.7 Sonnet ranked #1 on  Aider’s polyglot bench —  a 76.4% score" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How? Our AI Agent uses an iterative problem-solving approach: it writes code, validates it, fixes errors, and repeats until the task is solved correctly. No shortcuts — just reliable, production-ready results.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While SWE Bench gets a lot of attention, we’ve found Polyglot to be a far better measure of AI agents’ problem-solving abilities. It’s not just about passing tests or raw code generation — it’s about reasoning, precision, and delivering working solutions.&lt;/p&gt;

&lt;p&gt;For more details on our tech setup and approach, &lt;a href="https://refact.ai/blog/2025/refact-ai-agent-claude-3-7-sonnet-ranked-1-aider-polyglot/" rel="noopener noreferrer"&gt;check out our blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We’d love to hear your thoughts and feedback!&lt;/p&gt;




&lt;h2&gt;
  
  
  About Aider’s polyglot benchmark
&lt;/h2&gt;

&lt;p&gt;The benchmark evaluates how well AI can handle &lt;a href="https://aider.chat/2024/12/21/polyglot.html#the-polyglot-benchmark" rel="noopener noreferrer"&gt;225 of the hardest coding exercises from Exercism&lt;/a&gt; across C++, Go, Java, JavaScript, Python, and Rust. It focuses exclusively on the most challenging problems and measures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can AI write new code that integrates seamlessly into existing codebases?&lt;/li&gt;
&lt;li&gt;Can AI successfully apply all its changes to source files without human intervention?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full test set in the &lt;a href="https://github.com/Aider-AI/polyglot-benchmark" rel="noopener noreferrer"&gt;Aider polyglot benchmark repo on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Polyglot &amp;gt; SWE Bench
&lt;/h2&gt;

&lt;p&gt;SWE Bench is popular and often seen as a key benchmark for AI coding agents. However, it has significant limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only tests Python&lt;/li&gt;
&lt;li&gt;Relies on just 12 repositories (e.g., Django, SymPy)&lt;/li&gt;
&lt;li&gt;Benchmarked models are often pre-trained on these repos (skewing results)&lt;/li&gt;
&lt;li&gt;Only one file is changed per task (unrealistic for typical development work)&lt;/li&gt;
&lt;li&gt;Human-AI interaction is oversimplified (in reality, devs adjust how they collaborate with AI).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of these constraints, SWE Bench doesn’t truly measure an AI agent’s efficiency in software engineering workflows, not in a controlled environment.&lt;/p&gt;

&lt;p&gt;In contrast, Polyglot is much more representative and realistic — it imitates the environments developers work in every day and reflects actual needs. It measures how well AI can autonomously interact with diverse, multi-language projects.&lt;/p&gt;

&lt;p&gt;So, we’d like to thank &lt;a href="https://aider.chat/" rel="noopener noreferrer"&gt;Aider&lt;/a&gt; for introducing this comprehensive benchmark! It provides great insights into AI coding tools and helps drive better solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our approach: How Refact.ai achieved #1 in the leaderboard
&lt;/h2&gt;

&lt;p&gt;Many AI Agents rely on a single-shot approach — get a task, generate code once and hope for the best. But LLMs aren’t all-knowing — they have limits and make mistakes, so their first attempt often isn’t accurate and reliable.&lt;/p&gt;

&lt;p&gt;_Sure, you can pre-train models to ace specific tasks that trend on X… But what’s the point? This doesn’t translate to real-world performance.&lt;br&gt;
_&lt;br&gt;
At Refact.ai, we do things differently.** Our AI Agent uses a multi-step process:** instead of settling for the first attempt, it validates its work through testing and iteration until the task is done right.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We call it a feedback loop:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writes code: The agent generates code based on the task description.&lt;/li&gt;
&lt;li&gt;Fixes errors: Runs automated checks for issues.&lt;/li&gt;
&lt;li&gt;Iterates: If problems are found, the agent corrects the code, fixes bugs, and re-tests until the task is successfully completed.&lt;/li&gt;
&lt;li&gt;Delivers the result, which will be correct most of the time!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This drives the real value of AI — actually solving problems, not just scoring well on benchmarks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://refact.ai/blog/2025/refact-ai-agent-claude-3-7-sonnet-ranked-1-aider-polyglot/" rel="noopener noreferrer"&gt;Read more about the tech side in our blog.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key features of Refact.ai’s autonomous AI Agent
&lt;/h2&gt;

&lt;p&gt;Refact.ai’s advanced AI Agent thinks and acts like a developer, handling software engineering tasks end-to-end.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Autonomous task execution&lt;/li&gt;
&lt;li&gt;Deep contextual understanding&lt;/li&gt;
&lt;li&gt;Dev tools integration (GitHub, Docker, PostgreSQL, MCP Servers, and more)&lt;/li&gt;
&lt;li&gt;Memory and continuous improvement&lt;/li&gt;
&lt;li&gt;Human-AI collaboration&lt;/li&gt;
&lt;li&gt;Open source&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try Refact.ai in your IDE
&lt;/h2&gt;

&lt;p&gt;Vibe coding is the future of software development. Get 10x productivity with Refact.ai Agent in your IDE, handling complex programming tasks for you while you focus on core work. &lt;/p&gt;

&lt;p&gt;✅ Available to everyone in &lt;a href="https://marketplace.visualstudio.com/items?itemName=smallcloud.codify" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; and &lt;a href="https://plugins.jetbrains.com/plugin/20647-refact-ai" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We'd be happy if you test Refact.ai Agent for your software developmebnt tasks and share you opinion!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>chatgpt</category>
      <category>llm</category>
    </item>
    <item>
      <title>Developing AI Agent: SWE bench critics, speed-smart trade-off, and how to make the agent useful</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Thu, 08 Aug 2024 10:52:24 +0000</pubDate>
      <link>https://dev.to/refact/developing-ai-agent-swe-bench-critics-speed-smart-trade-off-and-how-to-make-the-agent-useful-3b0b</link>
      <guid>https://dev.to/refact/developing-ai-agent-swe-bench-critics-speed-smart-trade-off-and-how-to-make-the-agent-useful-3b0b</guid>
      <description>&lt;p&gt;&lt;em&gt;TL;DR: It's the early days of AI autonomously working as a software engineer. A human is still required to steer these capable systems. &lt;a href="https://refact.ai/blog/2024/programming-with-ai-our-dream/" rel="noopener noreferrer"&gt;We at Refact.ai look at potential UI, speed, cost, and tradeoffs.&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Not Solving SWE-Bench
&lt;/h2&gt;

&lt;p&gt;Let’s quickly get the SWE benchmark out of the way. Some people still look at this benchmark as a primary measure of the capability of a coding agent – it isn’t.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SWE-bench consists of real issues in open-source repositories. But there are some problems:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All repositories in SWE-lite are in Python&lt;/li&gt;
&lt;li&gt;There are just 12 of them (django, sympy, …)&lt;/li&gt;
&lt;li&gt;All models are already familiar with these open source repositories&lt;/li&gt;
&lt;li&gt;Correct output is always 1 file changed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, the tasks that 99% of developers do every day aren't related to the benchmark at all.&lt;/p&gt;

&lt;p&gt;But the problems with the SWE-bench don’t end there. Sure, there’s some value in just using the description given by a submitter on github, but it’s not realistic for a real human-machine interface. Humans can learn, and they will adapt to the AI they use. They will know what kind of tasks an agent can solve, what it cannot, and only give the tasks that are likely to succeed.&lt;/p&gt;

&lt;p&gt;Then the question becomes: &lt;strong&gt;what kind of AI agent is best for a human to achieve high speed and comfort in programming?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And by the way, robots can learn, too, collecting information about the project over time, and that capability is not measured by SWE-bench – all the projects used are open source and already memorized by all the models. Not true for any new code or proprietary code that &lt;strong&gt;requires adaptation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(Hey, if you are a student and you are looking for a good task to work on, make a better benchmark! It does not require a massive GPU farm, and will earn you a lot of citations for your paper. But find other people to cooperate on this, don’t do it on your own.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Interactive vs. Long-Thinking AI Agents
&lt;/h2&gt;

&lt;p&gt;Here’s one interesting trade-off: the current AI agents are slow.&lt;/p&gt;

&lt;p&gt;The reason they are painfully slow is that they need to find a good cross-section of the repository at hand, generate and verify one or several solutions. Each of those operations requires at least one call to a state-of-the-art model (usually behind an API) with a lot of tokens. For this reason, agents are also expensive to run.&lt;/p&gt;

&lt;p&gt;But let’s talk about speed. Is it possible to create a fast intelligent agent that can be &lt;strong&gt;used interactively&lt;/strong&gt;? Does it mean it’s necessarily stupid, compared to a slow-thinking counterpart?&lt;/p&gt;

&lt;p&gt;Is it possible to build a lovable product that &lt;strong&gt;embraces the slowness&lt;/strong&gt; instead? This will require a completely different approach for a human: start several tasks, go have some tea, and when you come back some results will be ready. What are the requirements for this kind of AI agent to be usable?&lt;/p&gt;

&lt;p&gt;For Refact.ai, what should be the priority? Let’s see if we can spot some trends.&lt;/p&gt;

&lt;p&gt;Coding assistants started as an interactive feature: code completion. There were no slow-thinking products at all, and there are still none in coding assistants that are ready for prime time.&lt;/p&gt;

&lt;p&gt;Over time, models become cheaper, faster and smarter. The reason why we are talking about a long-thinking agent for developers at all – is the “smarter” part. There’s no use in running a stupid model for a long time, it will just produce a lot of stupid.&lt;/p&gt;

&lt;p&gt;But fixing the “smarter” part at a constant, as models become cheaper and faster, what will happen to a slow-thinking agent, will it become fast-thinking automatically, and therefore interactive? Or the slow AI agent will not ever go away: if a slow agent of today becomes fast tomorrow, we can always add more work and it will become slow again?&lt;/p&gt;

&lt;h2&gt;
  
  
  Refact.ai Approach
&lt;/h2&gt;

&lt;p&gt;Well, we don’t know what people will like more.&lt;/p&gt;

&lt;p&gt;On the technical side, the approach that should stand the test of time is to make building blocks that are useful in either scenario, and the difference between interactive and slow non-interactive regime is just the top-level system prompt.&lt;/p&gt;

&lt;p&gt;An argument might go both ways: interactive agents are great because they are steerable along the way, and we want to keep a human in control. Non-interactive agents are also great: most tasks are not that complicated, just shut up and do the work.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We’ve figured the best way to decide these things is to speak to actual developers, and let them try an early version of Refact.ai AI agent. There’s a group of about ten enthusiastic people that we selected, we’ll try to know their problems &lt;strong&gt;and shape our future product together with these people&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡To get early access to our AI agent and provide your feedback, &lt;a href="https://forms.gle/REUqRqJEZ4Hk3SmN9" rel="noopener noreferrer"&gt;fill out this form&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Refact.ai Future User Interface
&lt;/h2&gt;

&lt;p&gt;Let’s talk about a less-than-realtime UI. What should it look like, if you want to launch a task and forget about it for 5-15 minutes?&lt;/p&gt;

&lt;p&gt;Well, if they are so slow, you probably want to run several of them at the same time. You might also want to specify exactly what you want. If it takes considerable time to write a longer description, by the time the first one finishes or fails, your next task description might already be ready.&lt;/p&gt;

&lt;p&gt;From that, &lt;strong&gt;several sessions need to work at the same time in the UI&lt;/strong&gt;. Unfinished task descriptions or follow ups should reliably stay in place when you switch between sessions.&lt;/p&gt;

&lt;p&gt;Furthermore, Refact.ai is &lt;a href="https://github.com/smallcloudai" rel="noopener noreferrer"&gt;an open source&lt;/a&gt; AI tool, and has nothing to hide. We’ll present all the internal model calls in the UI as well. How exactly a diff is generated by the autonomous agent? You will be able to see that.&lt;/p&gt;

&lt;h2&gt;
  
  
  One With the Machine
&lt;/h2&gt;

&lt;p&gt;There are 4 main factors that make an AI agent useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intelligence of the underlying models&lt;/li&gt;
&lt;li&gt;Quality of the tools available to the model&lt;/li&gt;
&lt;li&gt;Learning curve for a human&lt;/li&gt;
&lt;li&gt;Speed and comfort for a human once adapted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We at Refact work mostly on tools: we have functions for Abstract Syntax Tree access, VecDB search, AI expert calls, and more. In this blog, the question is – what makes it an enjoyable experience?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Observable.&lt;/strong&gt; It must be clear what’s going on with a task. That includes any failures: models sometimes go in circles, or go off the rails. This should all be transparent to the user, easy to understand. Based on that information, the user can correct their future tasks, or report the failure to improve the product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open and customizable.&lt;/strong&gt; Other companies might hide the internals from you, but Refact is open source. If you see how an internal expert calls work in UI, you can understand the underlying technology, or even customize it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Diffs.&lt;/strong&gt; Software engineers use version control systems (like Git or Mercurial) every day. If there are a lot of changes produced by a single agent invocation, it needs to closely match the already familiar concepts: simple diffs for the interactive use case, ready-to-pull commits or small branches for the slow-thinking use case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory.&lt;/strong&gt; You should be able to tell how to solve a certain problem, and the model needs to memorize that, so it wouldn’t get stuck in a similar situation later. Or you can just tell your preferences directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adaptation to the project.&lt;/strong&gt; Over time, the AI agent should build a project-specific knowledge base, especially successful and unsuccessful attempts at doing things to improve the success rate in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enough with the Dreams, What’s Reality?
&lt;/h2&gt;

&lt;p&gt;We want to build Refact.ai AI agent as a product people will love.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxu1d4bq3nowadz0d6bt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxu1d4bq3nowadz0d6bt.png" alt="Refact.ai AI agent" width="708" height="999"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have just posted a pre-release version in the &lt;a href="https://marketplace.visualstudio.com/items?itemName=smallcloud.codify" rel="noopener noreferrer"&gt;VSCode Marketplace&lt;/a&gt;. It’s experimental, not yet recommended for anyone other than enthusiasts. But it won’t be experimental for long; on August 19, we plan a stable release for everybody!&lt;/p&gt;

&lt;p&gt;You will be able to turn autonomous agent features off for each chat: in that case, Refact.ai will be an AI coding assistant with RAG tools.&lt;/p&gt;

&lt;p&gt;When the agent feature is turned on, the chat will use a different system prompt and a different set of tools, and will find and patch relevant files on its own. We should be able to go through a couple of cycles of real-world feedback by then, to make the UI experience well polished.&lt;/p&gt;

&lt;p&gt;The next version in September will offer Docker container isolation to perform automatic verification of the changes and memory. This way, Refact.ai’s autonomous agent will be available for Enterprise users&lt;/p&gt;

&lt;p&gt;&lt;a href="https://discord.com/invite/j3P4t5gm95" rel="noopener noreferrer"&gt;To know more, you can join Refact.ai Discord&lt;/a&gt;: there we’re sharing first updates on our AI agent and how to get early access to it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading and best regards,&lt;br&gt;
Oleg Klimov&lt;br&gt;
CEO Refact.ai&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
    </item>
    <item>
      <title>Implementing RAG in Refact.ai AI Coding Assistant</title>
      <dc:creator>Oleg Klimov</dc:creator>
      <pubDate>Tue, 28 May 2024 12:12:48 +0000</pubDate>
      <link>https://dev.to/refact/implementing-rag-in-refactai-ai-coding-assistant-35fg</link>
      <guid>https://dev.to/refact/implementing-rag-in-refactai-ai-coding-assistant-35fg</guid>
      <description>&lt;p&gt;Retrieval Augmented Generation (RAG) is a technique to generate more customized and accurate AI suggestions by using the entire coding environment as a source of relevant context for code completions and chat queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this blog post, I go through all the details about how it works and how we implemented RAG in &lt;a href="https://refact.ai" rel="noopener noreferrer"&gt;Refact.ai&lt;/a&gt; — an open-source AI coding assistant for IDEs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7thqxdtdptz1r8kh1z98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7thqxdtdptz1r8kh1z98.png" alt="RAG in Refact.ai" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction: Why RAG matters in AI coding
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;Imagine you have 2 files:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowsjvldra8ulmjiagzuq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fowsjvldra8ulmjiagzuq.png" alt="Like these" width="800" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you just have &lt;code&gt;my_file.py&lt;/code&gt; supplied to the model, it doesn’t have any way to know to complete &lt;code&gt;“say_hello”&lt;/code&gt; and that it needs a parameter to that function.&lt;/p&gt;

&lt;p&gt;This problem of limited scope of AI models gets much worse as your project gets bigger. So, how to fetch it with the necessary information from your codebase, and do it in real time, and accurately?&lt;/p&gt;

&lt;p&gt;It takes a specialized RAG pipeline for this work inside your IDE, and that’s the point of our new release.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Refact.ai Technology Stack
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;We use an intermediate layer between a plugin inside IDE and the AI model called refact-lsp. And yes, it works as an &lt;a href="https://en.wikipedia.org/wiki/Language_Server_Protocol" rel="noopener noreferrer"&gt;LSP&lt;/a&gt; server, too.&lt;/p&gt;

&lt;p&gt;Its purpose is to run on your computer, keep track of all the files in your project, index them into an in-memory database, and forward requests for code completion or chat to the AI model, along with the relevant context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx13mv163pdv3ns4lznxe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx13mv163pdv3ns4lznxe.png" alt="Refact.ai Tech Stack" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;refact-lsp&lt;/code&gt; is written in Rust, combining speed of a compiled language and safety guarantees. Rust is great: it has a library for almost any topic you can imagine, including vector databases and a port of tree-sitter — a library to parse source files in many programming languages.&lt;/p&gt;

&lt;p&gt;The amazing thing about it: &lt;code&gt;refact-lsp&lt;/code&gt; compiles into a single executable file that doesn’t require any other software to be installed on your computer — it’s self-sufficient! It means it will not interfere with whatever you are doing on your computer, and it will not break as you update your environment. In fact you don’t even see it, it gets installed together with the Refact.ai plugin in your favorite IDE.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  AST and VecDB
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;There are two kinds of indexing possible: based on Abstract Syntax Tree (AST) and based on Vector Database (VecDB).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What is AST?&lt;/strong&gt; We use tree-sitter to parse the source files, and then get the positions of function definitions, classes, etc. It is therefore possible to build an index in memory — a mapping from the name of a thing to its position, and make functions like “go to definition” “references” very fast.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What is VecDB?&lt;/strong&gt; There are AI models that convert a piece of text (typically up to 1024 tokens) into a vector (typically 768 floating point numbers). All the documents get split into pieces and vectorized, vectors stored in a VecDB. These AI models are trained in such a way that if you vectorize the search query, the closest matches (in a sense of l2 metric between the vectors) in the database will be semantically similar or relevant to the query.&lt;br&gt;
The problem with VecDB is that you need to vectorize the query as well, and that might take some time — not good for code completion that needs to be real-time.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s not an issue for a chat though: here you can play with both indexes using &lt;code&gt;@-commands&lt;/code&gt;. More about it is described a few sections down.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  VecDB: Splitting the Source Code Right
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;To vectorize a piece of text, we first need to make sure it’s a complete construct in a programming language, such as a single function, a single class. This way the semantic matching offered by VecDB will work best.&lt;/p&gt;

&lt;p&gt;The easiest way to implement this is to use empty lines as a hint for the boundaries to split:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frctwa5df5lvd3veflq88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frctwa5df5lvd3veflq88.png" alt="VecDB in Refact.ai" width="800" height="727"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see in this example that the functions are separated by an empty line. We in fact use this method for text files without an available tree-sitter module.&lt;/p&gt;

&lt;p&gt;But can we do better in splitting as well? Sure, of course we can! We can simplify the class by shortening function bodies:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wvg54ykrd7qmnawit2s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wvg54ykrd7qmnawit2s.png" alt="VecDB in Refact.ai" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this skeletonized version of the class gets vectorized, you can see it’s much easier to match it against a query when you search for things like “classes that have jump in them”, compared to the situation when the splitter just vectorized “jump” function without its class.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  AST: Simple Tricks to Make It Better
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;A library like &lt;code&gt;tree-sitter&lt;/code&gt; can transform the source code into individual elements: function definitions, function calls, classes, etc.The most useful case: match types and function calls near the cursor with definitions.&lt;/p&gt;

&lt;p&gt;See how it works:&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://refact.ai/images/blog/meet-rag-in-refact-ai-technical-details/fim_.mp4" rel="noopener noreferrer"&gt;
      refact.ai
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;If you click on the “FIM” (fill-in-the-middle) button, you can see these in the sidebar with a 🔎 icon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But besides this simple matching, there are some tricks we can do. For the symbols near the cursor, we can first look at their type, and then go to the definitions. And for classes, we can go to their parent class. Those are simple rules that work for all programming languages!&lt;/p&gt;

&lt;p&gt;Finally, treating all the identifiers as just strings, we can find similar pieces of code - it should have similar identifiers in them. A similar code can help a model to generate a good answer as well.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Post Processing
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;Let’s say you’ve found in the AST and VecDB indexes 50 interesting points that might help the model to do its job. Now you have additional issues to solve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There might be just too many results to fit into the AI model’s context. There’s a budget measured in tokens to fit memory requirements, or latency requirements (code completion is real time), or model limitation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The results themselves might not make much sense without at least a little bit of structure where it appears. For example, for a “function do_the_thing()” it’s important to show it’s inside a class, and which class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There can be overlapping or duplicate results.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those problems can be solved with good post-processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is how our post-processing works:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;It loads all files mentioned in the search results into memory, and it keeps track of the “usefulness” of each line.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each result from AST or VecDB now just makes an increase in the usefulness of the lines it refers to. For example, if “my_function” is found, all the lines that define my_function will increase in usefulness, and the lines that contain the signature of the function (name, parameters and return type) will increase in usefulness more, compared to its body.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All that is left to do is to sort all the lines by usefulness, then take the most useful until the token budget is reached, and output the result: &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://refact.ai/images/blog/meet-rag-in-refact-ai-technical-details/frog.mp4" rel="noopener noreferrer"&gt;
      refact.ai
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;You see there, post-processing can fit into any token budget, keeping the most useful lines, and rejecting less useful ones, replacing them with ellipsis.&lt;/p&gt;

&lt;p&gt;One interesting effect is skeletonization of the code. As the budget decreases, less and less lines can make it into the context, our post-processing prefers to keep some of the code structure (which class the function belongs to) over the body of that function.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Oh Look, It’s Similar to grep-ast!
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;Yes you are right, it is! In fact we took inspiration from grep-ast, a small utility that uses tree-sitter to look for a string in a directory, and it also prefers to keep the structure of code so you can see where logically in the code your results are.&lt;/p&gt;

&lt;p&gt;It doesn’t have a notion of token budget though, and it’s written in python so it’s not very fast, and it doesn’t have any indexes to search faster.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  RAG in Refact.ai Chat with @-commands
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;In Refact.ai, we’ve made RAG support for chat LLMs too. It can be used with commands to add some important context.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@workspace&lt;/code&gt; - Uses VecDB to look for any query. You can give it a query on the same line like this: &lt;code&gt;“@workspace Frog definition”&lt;/code&gt;, or it will take any lines below it as a query, so you can search for multi-line things like code pieces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@definition&lt;/code&gt; - Looks up for the definition of a symbol. For example, you can ask: &lt;code&gt;“@definition MyClass”&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@references&lt;/code&gt; - Same, but it returns references. Example: &lt;code&gt;“@references MyClass”&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@file&lt;/code&gt; - Attaches a file. You can use file_name:LINE1-LINE2 notation for large files to be more specific, for example &lt;code&gt;“@file large_file.ext:42”&lt;/code&gt; or &lt;code&gt;“@file large_file.ext:42-56”&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;@symbols-at&lt;/code&gt; - Looks up any symbols near a given line in a file, and adds the results to the chat context. Uses the same procedure as code completion does. For it to work, you need to specify file and line number: &lt;code&gt;“@symbols-at some_file.ext:42”&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkokkhrr2l4gw8hqhkna5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkokkhrr2l4gw8hqhkna5.png" alt="@definition" width="800" height="714"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When you start a new chat, there are options available:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;“Search workspace” is equivalent to typing &lt;code&gt;@workspace&lt;/code&gt; in the input field: it will use your question as a search query.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;”Attach current_file.ext” is equivalent to &lt;code&gt;“@file current_file.ext:CURSOR_LINE”&lt;/code&gt; command that attaches the file, and uses the current cursor position (CURSOR_LINE) to deal with potentially large files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;”Lookup symbols” extracts any symbols around the cursor and searches for them in the AST index. It’s equivalent to &lt;code&gt;“@symbols-at current_file.ext:CURSOR_LINE”&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;”Selected N lines” adds the current selection as a snippet for model to analyze or modify, it’s equivalent to writing a piece of code in backquotes &lt;code&gt;my code&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Interesting Things You Can Try with RAG
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summarize a File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Take a large file, open chat (Option+C) or toolbox (F1), and type “summarize in 1 paragraph”. The post-processing described above makes the file fit the chat context you have available. Check out how the file looks in the tooltip for the 📎 Attached file. The bigger the original file, the more skeletonized version you’ll see.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdedzcp0kv3rcxj9saq5l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdedzcp0kv3rcxj9saq5l.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summarize Interaction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unfamiliar code is a big problem for humans: it might take hours to understand the interaction of several classes. Here’s another way to do it: use @definition or &lt;a class="mentioned-user" href="https://dev.to/file"&gt;@file&lt;/a&gt; to put the classes of interest to the context, and ask chat how they interact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91rnbctlp2siy475o3yc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91rnbctlp2siy475o3yc.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Near Cursor with Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can add context to chat using the same procedure as code completion: use “Lookup symbols near cursor” or @symbols-at command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpktjaw32sqzeeegptuxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpktjaw32sqzeeegptuxk.png" alt=" " width="800" height="932"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  So How Good Is It?
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;We tested code completion models with and without RAG, and here are the results.&lt;/p&gt;

&lt;p&gt;We’ve made a small test that is easy to understand and interpret, it works like this: take 100 random repositories from github for each programming language, delete a random string in a random function, and run single-line code completion to restore it exactly.&lt;/p&gt;

&lt;p&gt;It is not perfect, because sometimes it’s hard to reproduce comments exactly (if there’s any on the deleted line), and there are many easy cases (like a closing bracket) that will not benefit from RAG at all. But still it’s a good test because it’s simple! &lt;a href="https://huggingface.co/datasets/smallcloudai/refact_repobench" rel="noopener noreferrer"&gt;Here is the dataset&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The results of the test (running StarCoder2/3b):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bsf3ntmkern6li913w8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bsf3ntmkern6li913w8.png" alt=" " width="800" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;RAG always helps!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It helps Java more than Python, because many projects in Python don’t use type hints.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Here it is! We believe we've developed the best in-IDE RAG for code completion and chat, at least among the open-source solutions we've explored.&lt;/p&gt;

&lt;p&gt;If you have any questions, feel free to ask them in the comments. I'll be glad to answer or have a discussion. Or welcome to &lt;a href="https://www.smallcloud.ai/discord" rel="noopener noreferrer"&gt;join our Discord&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;P.S. You can try &lt;a href="https://refact.ai/pricing/" rel="noopener noreferrer"&gt;RAG for coding in Refact.ai Pro plan&lt;/a&gt; — use promo code RAGROCKS for a 2-month free trial. Have fun!&lt;/p&gt;

</description>
      <category>rag</category>
      <category>opensource</category>
      <category>development</category>
    </item>
    <item>
      <title>📝 🚀 Creating our first documentation from scratch using Astro and Refact AI coding assistant</title>
      <dc:creator>Vadim Smirnov</dc:creator>
      <pubDate>Mon, 18 Sep 2023 17:36:16 +0000</pubDate>
      <link>https://dev.to/refact/creating-our-first-documentation-from-scratch-using-astro-and-refact-ai-coding-assistant-36pg</link>
      <guid>https://dev.to/refact/creating-our-first-documentation-from-scratch-using-astro-and-refact-ai-coding-assistant-36pg</guid>
      <description>&lt;p&gt;At Refact, we put performance and developer experience as our top priority. That's why we were looking for a lightweight and highly customizable template for our documentation.&lt;/p&gt;

&lt;p&gt;Previously, we used Astro for our &lt;a href="http://refact.ai/" rel="noopener noreferrer"&gt;refact.ai&lt;/a&gt; website and wanted to stay within the Astro ecosystem for the documentation.&lt;/p&gt;

&lt;p&gt;Let's see how easy it will be to build the docs using the Starlight template from Astro with the help of the Refact AI coding assistant.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Refact: Open-source AI coding assistant&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Just a quick background about us: &lt;a href="https://github.com/smallcloudai/refact" rel="noopener noreferrer"&gt;Refact&lt;/a&gt; is an open-source AI coding assistant that can significantly boost developer productivity with tools like code completion, code refactoring, and chat.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr6c4b2tq1vunbit64ag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr6c4b2tq1vunbit64ag.png" alt="Refact AI Repo"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Starlight docs
&lt;/h2&gt;

&lt;p&gt;Starlight is a framework-agnostic Astro template for building documentation websites. With a straightforward configuration process and the support of Markdown and MDX, you get a solid foundation for your documentation.&lt;/p&gt;

&lt;p&gt;In this article, we will follow the manual setup process to get a better understanding of all of the parts that are required for Starlight to work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating an Astro project
&lt;/h3&gt;

&lt;p&gt;First, we must create an Astro project as a foundation since Starlight is built on top of Astro.&lt;/p&gt;

&lt;p&gt;To do that, we need to run the following command in your terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npm create astro@latest


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can pick the option with the sample files.&lt;/p&gt;

&lt;p&gt;Once the setup process is completed, you can run &lt;code&gt;npm run dev&lt;/code&gt; in your terminal and see a starter template in your browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4oupq7zbotavkcvpp596.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4oupq7zbotavkcvpp596.png" alt="Astro starter project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Astro, you get an extremely straightforward structure of the project:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

/
├── public/
│   └── favicon.svg
├── src/
│   ├── components/
│   │   └── Card.astro
│   ├── layouts/
│   │   └── Layout.astro
│   └── pages/
│       └── index.astro
└── astro.config.mjs


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Adding Starlight
&lt;/h3&gt;

&lt;p&gt;Now that we have the foundation, we are ready to add Starlight to turn our website into a fully functional documentation.&lt;/p&gt;

&lt;p&gt;To do that, run the following command in your terminal:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npx astro add starlight


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After completing the multistep installation process in your terminal, we can see that our Astro configuration file was updated.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;

&lt;/span&gt;&lt;span class="p"&gt;import { defineConfig } from 'astro/config';
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gi"&gt;+ import starlight from "@astrojs/starlight";
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;export default defineConfig({
&lt;/span&gt;&lt;span class="gi"&gt;+   integrations: [starlight()]
&lt;/span&gt;});
&lt;span class="err"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Perfect! Now, we have an Astro project with a Starlight integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring Starlight
&lt;/h3&gt;

&lt;p&gt;Even though we installed the Starlight integration, we need to complete three more steps to see it working:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We need to configure the plugin&lt;/li&gt;
&lt;li&gt;The next step will be a content collection configuration&lt;/li&gt;
&lt;li&gt;And last but not least, we need to add markdown files to see the complete documentation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This process is very straightforward, but Refact will help us to boost the configuration process with the autocomplete functionality.&lt;/p&gt;

&lt;p&gt;First, let's configure the plugin. Starlight allows you to set many things in the configuration, but only one property is required for the plugin to function, which is a &lt;code&gt;title&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In your &lt;code&gt;astro.config.mjs&lt;/code&gt; file, you should add a &lt;code&gt;title&lt;/code&gt; inside the Starlight integration. Refact immediately starts to help you with that!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;

&lt;/span&gt;&lt;span class="p"&gt;import { defineConfig } from 'astro/config';
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;import starlight from "@astrojs/starlight";
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;export default defineConfig({
&lt;/span&gt;    integrations: [starlight(
&lt;span class="gi"&gt;+       {
+           title: "My awesome documentation"
+       }
&lt;/span&gt;    )]
});
&lt;span class="err"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The next step is to configure the content collection. The content collection allows us to handle the dynamic generation of pages from markdown files.&lt;/p&gt;

&lt;p&gt;To configure the content collection, we need to complete the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a folder structure for the documentation&lt;/li&gt;
&lt;li&gt;Create the config file and define the collection with the docs schema&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For documentation to function, we need to create a &lt;code&gt;content&lt;/code&gt; folder inside the &lt;code&gt;src&lt;/code&gt; directory, which will be the root directory for the documentation-specific files.&lt;/p&gt;

&lt;p&gt;Inside that folder, we need to create the &lt;code&gt;config.ts&lt;/code&gt; file to define the collection.&lt;/p&gt;

&lt;p&gt;First, let's import two functions that we will use - &lt;code&gt;defineCollection&lt;/code&gt; and &lt;code&gt;doscSchema&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;

&lt;/span&gt;&lt;span class="gi"&gt;+ import { defineCollection } from 'astro:content'
+ import { docsSchema } from '@astrojs/starlight/schema'
&lt;/span&gt;&lt;span class="err"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we are ready to define the collection. Refact will pick it up and help you to complete that logic, which speeds up the process for you and helps you with guidance on what needs to be completed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExaHBwemJlNTFlYWhjbTZucDg2bHZ5dXp5cHlqdzF6cW50ZHBtMW1zYiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/1sIGSvAjJMxgIGwT3k/giphy-downsized-large.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExaHBwemJlNTFlYWhjbTZucDg2bHZ5dXp5cHlqdzF6cW50ZHBtMW1zYiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/1sIGSvAjJMxgIGwT3k/giphy-downsized-large.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the configuration process is completed, let's add content to see the documentation in action.&lt;/p&gt;

&lt;p&gt;Inside the &lt;code&gt;content&lt;/code&gt; folder, we need to add the &lt;code&gt;docs&lt;/code&gt; directory. There, we should add an &lt;code&gt;index.md&lt;/code&gt; file with the following structure:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

---
title: "My Documentation"
description: "This is a getting started guide of my documentation."
---

This is the first segment of my documentation!


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If we start the project locally, we will see our beautiful documentation functioning as expected!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe7uybc44vz6y3laey0p8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe7uybc44vz6y3laey0p8.png" alt="Starlight Docs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing your documentation
&lt;/h2&gt;

&lt;p&gt;The results that we achieved are great, but it looks very generic. That's why Starlight allows you to customize the documentation and make it more personalized.&lt;/p&gt;

&lt;p&gt;Let's modify the frontmatter in &lt;code&gt;index.md&lt;/code&gt; file to turn it into a landing page of your documentation. Plenty of options are available for you to make a great-looking landing page. At Refact, we used the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;template - allows you to turn a regular documentation page into a landing page&lt;/li&gt;
&lt;li&gt;hero - an option with &lt;code&gt;tagline&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;, and &lt;code&gt;actions&lt;/code&gt; properties to generate a hero banner&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to that, Starlight comes with components that allow you to add more code to the landing page.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't forget to change your index.md to index.mdx for components to work!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a final result, here's how the code for the landing page might look:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

---
title: Welcome to Refact Documentation!
description: Refact is a powerful AI coding assistant that combines completion, refactoring, chat, and more.
template: splash
hero:
  tagline: Refact is a powerful AI coding assistant that combines completion, refactoring, chat, and more.
  image:
    file: ../../assets/refact.png
  actions:
    - text: Get started
      link: /getting-started/what-is-refact/
      icon: right-arrow
      variant: primary
    - text: VS Code Extension
      link: &amp;lt;https://marketplace.visualstudio.com/items?itemName=smallcloud.codify&amp;gt;
    - text: Jetbrains Plugin
      link: &amp;lt;https://plugins.jetbrains.com/plugin/20647-codify&amp;gt;
---

import { Card, CardGrid } from '@astrojs/starlight/components';

## Features

&amp;lt;CardGrid stagger&amp;gt;
    &amp;lt;Card title="Code Completion" icon="pencil"&amp;gt;
        As you write code, Refact suggests potential code completions based on the context of your code,
    looking up and down. It can suggest whole functions, classes, commonly used programming patterns,
    libraries, and APIs usage.
    &amp;lt;/Card&amp;gt;
    &amp;lt;Card title="Improve code" icon="magnifier"&amp;gt;
        Refact can identify code that could be refactored to be more efficient or easier to understand.
    It can also detect bugs in your code and generate patches to fix them.
    &amp;lt;/Card&amp;gt;
    &amp;lt;Card title="AI Chat" icon="rocket"&amp;gt;
        Use plain language prompts in Refact chat to ask questions or get help with
    writing code without leaving your IDE.
    &amp;lt;/Card&amp;gt;
    &amp;lt;Card title="Transform and analyze code" icon="setting"&amp;gt;
        Refact can analyze the complexity of your code and explain unclear lines of code.
    It can also transform your code into a different language.
    &amp;lt;/Card&amp;gt;
&amp;lt;/CardGrid&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The following code generated a great-looking landing page with lots of helpful content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bo8cd5fk3bi83r24sge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bo8cd5fk3bi83r24sge.png" alt="Starlight docs with custom landing page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Changing the color theme
&lt;/h3&gt;

&lt;p&gt;As you saw in the screenshot, the color theme we use for the Refact documentation differs from the one available out of the box. Starlight makes it very straightforward to change the color scheme.&lt;/p&gt;

&lt;p&gt;Starlight allows you to add custom styles to match the documentation colors with colors that represent your brand.&lt;/p&gt;

&lt;p&gt;First, we must create a &lt;code&gt;custom.css&lt;/code&gt; file in the &lt;code&gt;src/styles&lt;/code&gt; folder. After that, we must link that file to the &lt;code&gt;astro.config.mjs&lt;/code&gt; file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;

&lt;/span&gt;&lt;span class="p"&gt;import { defineConfig } from 'astro/config';
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;import starlight from "@astrojs/starlight";
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;export default defineConfig({
&lt;/span&gt;    integrations: [Starlight (
        {
            title: "My awesome documentation",
&lt;span class="gi"&gt;+           customCss: [
+               './src/styles/custom.css'
+           ]
&lt;/span&gt;        }
    )
    ]
});
&lt;span class="err"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can modify the color theme in your newly created CSS file. Here is an example of styles that we use at Refact to match our brand colors:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="c"&gt;/* Dark mode colors. */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-accent-low&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#42100e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#c70016&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-accent-high&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f8b6ad&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-white&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#eeeeee&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#c2c2c2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#8b8b8b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#585858&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#383838&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-black&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#181818&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Light mode colors. */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'light'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-accent-low&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fcc9c2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#cb0017&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-accent-high&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#610b0c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-white&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#181818&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#383838&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#585858&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#8b8b8b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#c2c2c2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#eeeeee&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-gray-7&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f6f6f6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="py"&gt;--sl-color-black&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you refresh the page, you can see that the color theme was updated!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;And there we have it!&lt;br&gt;
We've explored the Starlight project - a fantastic solution for the documentation, and we used Refact - an AI coding assistant that immediately picked up our project's context and helped us get used to an unfamiliar code base a lot faster.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next Steps
&lt;/h3&gt;

&lt;p&gt;With a solid foundation and an incredible AI ally, you can explore the Starlight project to see how to personalize and make your documentation stunning.&lt;br&gt;
In addition, I encourage you to try &lt;a href="https://refact.ai/" rel="noopener noreferrer"&gt;Refact&lt;/a&gt; and see how it will improve your productivity and help you become more efficient as an engineer.&lt;/p&gt;

&lt;p&gt;Join our &lt;a href="https://www.smallcloud.ai/discord" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; server if you need assistance from the Refact team and community to get started faster!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>javascript</category>
      <category>astro</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Open-source Fine-Tuning on Codebase with Refact</title>
      <dc:creator>Refact AI</dc:creator>
      <pubDate>Tue, 05 Sep 2023 10:18:54 +0000</pubDate>
      <link>https://dev.to/refact/open-source-fine-tuning-on-codebase-with-refact-3po1</link>
      <guid>https://dev.to/refact/open-source-fine-tuning-on-codebase-with-refact-3po1</guid>
      <description>&lt;p&gt;Code completion has become increasingly popular, thanks to tools like GitHub Copilot and open-source Large Language Models (LLMs). However, both Copilot and open models often fall short when it comes to working effectively on your specific codebase. This is because these models have never been exposed to your unique code patterns and conventions.&lt;br&gt;
In order to improve the quality of suggestions and tailor them to your codebase there's a technique called fine-tuning. By fine-tuning a pre-trained model on your codebase, you can improve its ability to understand and generate code that aligns with your requirements.&lt;br&gt;
In this blog post, we will delve into the concept of fine-tuning, and its technical details, and show how you can start self-hosting your fine-tuned model in Refact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;&lt;br&gt;
    &lt;br&gt;
  &lt;/p&gt;

&lt;p&gt;In this video, the same simple function is generated by: Copilot, base Refact 3b model, fine-tuned Refact 3b model.&lt;br&gt;
All three can look down the code, find what variables are necessary, and help you with typing, but only the finetuned version knows how to work with DatasetOpts.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Exactly Fine-tune Works?
&lt;/h2&gt;

&lt;p&gt;Large language models work by predicting the next token. This simple objective allows LLMs to learn syntax, code patterns, and even high-level concepts.&lt;br&gt;
The code you write is probably different from all the other projects on the internet. It might be similar - that's why code LLMs are already useful - but you probably have your own established way to do things.&lt;br&gt;
One simple example is coding style. Predicting the next token in a certain way defines how a model writes code, including variable names, spaces, etc.&lt;br&gt;
Fine-tuning has the same objective as pre-training: predict the next token. By adjusting the parameters in a clever way (it needs only one GPU to train!), the model starts to predict the next token according to your coding style, as well as patterns, your typical API usage, etc.&lt;br&gt;
That's why you'll see more useful suggestions if you are using a fine-tuned model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Data Can I Use for Fine-tuning the Model?
&lt;/h2&gt;

&lt;p&gt;In Refact UI, you will need to upload source code, in archive form (.zip, .tar.gz, .bz2) or give it a link to a git repository (private git repositories work too, you need to generate a ssh key though). You can upload an individual file, too. Refact then will slice your source code into pieces that a model can actually train on.&lt;br&gt;
It's a good idea to give the model the current code of your projects. However, it's NOT a good idea to feed 3rd party libraries that you use, as the model may learn to generate code similar to the internals of those libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Loss
&lt;/h2&gt;

&lt;p&gt;In order to measure how well the model is adapted to your code, you can take one or two of your files and make it a test set. To be meaningful as a measurement, these files should be using your coding style, your libraries and APIs.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="https://refact.ai/images/blog/refact-finetune/sources-code.png"&amp;gt;
&amp;lt;span&amp;gt;Picture: shows &amp;lt;code&amp;gt;vllm&amp;lt;/code&amp;gt; github repository as a training set, and a single file &amp;lt;code&amp;gt;benchmark_serving.py&amp;lt;/code&amp;gt; as a fixed test set&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;If test files are also present in the train set, they will be automatically subtracted from it.&lt;br&gt;
If you don't specify any test set, it will pick several random files for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Details
&lt;/h2&gt;

&lt;p&gt;It's possible to fine-tune all parameters (called "full fine-tune"), but recently PEFT methods became popular. PEFT stands for Parameter-Efficient Fine-Tuning. There are several methods available, the most popular so far is LoRA (&lt;a href="https://arxiv.org/abs/2106.09685"&gt;2106.09685&lt;/a&gt;) that can train less than 1% of the original weights.&lt;br&gt;
LoRA has one important parameter -- tensor size, called &lt;code&gt;lora_r&lt;/code&gt;. It defines how much information LoRA can add to the network. If your codebase is small, the fine-tuning process will see the same data over and over again, many times in a loop. We found that for a smaller codebase small LoRA tensors work best because it won't overfit as much -- the tensors just don't have the capacity to fit the limited training set exactly.&lt;br&gt;
As the codebase gets bigger, tensors should become bigger as well. We also unfreeze token embeddings at a certain codebase size.&lt;br&gt;
To pick all the parameters automatically, we have developed a heuristic that calculates a score based on the source files it sees. This score is then used to determine the appropriate LoRA size, number of finetuning steps, and other parameters. We have tested this heuristic on several beta test clients, small codebases of several files, and large codebases like the Linux kernel (consisting of about 50,000 useful source files).&lt;br&gt;
If the heuristic doesn't work for you for whatever reason, you can set all the parameters yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Test If It Worked?
&lt;/h2&gt;

&lt;p&gt;After the fine-tuning process finishes (which should take several hours), you can dynamically turn it on and off and observe the difference it makes for code suggestions. You can do this using this switch:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="https://refact.ai/images/blog/refact-finetune/lora-select.png"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;There's a catch: both VS Code and JB plugins cache the responses. To force the model to produce a new suggestion (rather than immediately responding with a cached one), you can change the text a few lines above, for example, a comment.&lt;br&gt;
Alternatively, you can use the Manual Suggestion Trigger (a key combination), which always produces a new suggestion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self Hosting
&lt;/h2&gt;

&lt;p&gt;You can use your own GPU to host and fine-tune LLMs with &lt;a href="https://github.com/smallcloudai/refact/"&gt;Refact self-hosting server&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;Q: Maybe models can guess code better if they have more context, especially from other files?&lt;br&gt;
A: For the best results, you need both. Fine-tuning gives you the coding style, and if the model can see relevant snippets of code from other files, it will work better for calling functions and using types defined outside of the current file. We are currently working on that, too. Join our discord server and be the first to know when we release it!&lt;br&gt;
Q: I only want to imitate the coding style of certain experts on my team. Is this possible?&lt;br&gt;
A: Certainly! It is indeed possible to imitate the coding style of specific experts on your team. You can achieve this by selectively uploading the files that represent the desired coding style and excluding any old or low-quality code. By doing so, the model will generate code that aligns with the chosen coding style. This approach can be valuable in transferring expert knowledge within your company, as the coding assistant can consistently suggest good coding practices.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>opensource</category>
      <category>selfhost</category>
    </item>
    <item>
      <title>🤖We trained a small 1.6b code model that reaches 32% HumanEval🤖</title>
      <dc:creator>Refact AI</dc:creator>
      <pubDate>Tue, 05 Sep 2023 10:15:23 +0000</pubDate>
      <link>https://dev.to/refact/we-trained-16b-code-model-and-you-can-use-it-as-a-personal-copilot-in-refact-for-free-12io</link>
      <guid>https://dev.to/refact/we-trained-16b-code-model-and-you-can-use-it-as-a-personal-copilot-in-refact-for-free-12io</guid>
      <description>&lt;p&gt;Today we're introducing Refact LLM: 1.6B code model with infill real-time code completion (including fill-in-the-middle(FIM) capability) and chat.&lt;br&gt;
Refact LLM achieves the state-of-the-art performance among the code LLMs, coming closer to  HumanEval as Starcoder, being 10x smaller in size, and it beats other code models such as StableCode, CodeGen and ReplitCode on HumanEval metric. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;1.6b parameters&lt;/li&gt; 
    &lt;li&gt;20 programming languages&lt;/li&gt; 
    &lt;li&gt;4096 tokens context&lt;/li&gt; 
    &lt;li&gt;code completion and chat capabilities&lt;/li&gt; 
    &lt;li&gt;SoTA on HumanEval benchmark among similar code models&lt;/li&gt; 
    &lt;li&gt;pre-trained on permissive licensed code and available for commercial use&lt;/li&gt; 
&lt;/ul&gt;


    &lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;Model&lt;/th&gt;
                &lt;th&gt;Model Size&lt;/th&gt;
                &lt;th&gt;HumanEval pass@1&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
            &lt;tr&gt;
                &lt;td&gt;DeciCoder-1b&lt;/td&gt;
                &lt;td&gt;1b&lt;/td&gt;
                &lt;td&gt;19.1%&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;Refact-1.6-fim&lt;/td&gt;
                &lt;td&gt;1.6b&lt;/td&gt;
                &lt;td&gt;32.0%&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;StableCode&lt;/td&gt;
                &lt;td&gt;3b&lt;/td&gt;
                &lt;td&gt;20.2%&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;ReplitCode v1&lt;/td&gt;
                &lt;td&gt;3b&lt;/td&gt;
                &lt;td&gt;21.9%&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;CodeGen2.5-multi&lt;/td&gt;
                &lt;td&gt;7b&lt;/td&gt;
                &lt;td&gt;28.4%&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;CodeLlama&lt;/td&gt;
                &lt;td&gt;7b&lt;/td&gt;
                &lt;td&gt;33.5%&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;StarCoder&lt;/td&gt;
                &lt;td&gt;15b&lt;/td&gt;
                &lt;td&gt;33.6%&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;&lt;/div&gt;


&lt;p&gt;The base model was trained on our own set of code with permissive licenses only and open text datasets (the text to code ratio was 50:50). In total, we trained our base model on 1.2T tokens of code on our cluster.&lt;/p&gt;

&lt;p&gt;The model was then fine-tuned with open code instruction-following datasets filtered for quality and a synthetic dataset based on &lt;a href="https://huggingface.co/datasets/bigcode/the-stack-dedup" rel="noopener noreferrer"&gt;The Stack dedup v1.1&lt;/a&gt; to improve FIM and boosting the base model performance. &lt;/p&gt;

&lt;p&gt;You can read more about the architecture decisions that we made in the &lt;a href="https://refact.ai/blog/2023/applying-recent-innovations-to-train-model/" rel="noopener noreferrer"&gt;blog post&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;We aim for the model to be accessible to everyone, we're releasing the model for commercial use under BigScience OpenRAIL-M license and making the weight available on &lt;a href="https://huggingface.co/smallcloudai/Refact-1_6B-fim" rel="noopener noreferrer"&gt;HuggingFace&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;While the trend recently was for the model sizes to get bigger, we wanted to lower barriers to entry and make it a versatile tool for developers with varying hardware setups. With the smaller size, running the model is much faster and affordable than ever: the model can be served on most of all modern GPUs requiring just 3Gb RAM and works great for real-time code completion tasks.&lt;/p&gt;

&lt;p&gt;Refact LLM can be easily integrated into existing developers workflows with &lt;a href="https://github.com/smallcloudai/refact/" rel="noopener noreferrer"&gt;an open-source docker container&lt;/a&gt; and &lt;a href="https://marketplace.visualstudio.com/items?itemName=smallcloud.codify" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; and &lt;a href="https://plugins.jetbrains.com/plugin/20647-codify" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt; plugins. With Refact's intuitive user interface, developers can utilize the model easily for a variety of coding tasks. Finetune is available in the self-hosting (docker) and Enterprise versions, making suggestions more relevant for your private codebase.&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Frefact.ai%2Fimages%2Fblog%2Fintroducing-refact-code-llm%2Fpalindrome.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Frefact.ai%2Fimages%2Fblog%2Fintroducing-refact-code-llm%2Fpalindrome.gif"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Refact 1.6B LLM is the third model in the family of our code models, with &lt;a href="https://huggingface.co/smallcloudai/codify_3b_multi" rel="noopener noreferrer"&gt;CodeContrast 3b&lt;/a&gt; and &lt;a href="https://huggingface.co/smallcloudai/codify_medium_multi" rel="noopener noreferrer"&gt;CodeContrast 0.3b&lt;/a&gt; released previously. We aim to continue with our research and future updates to improve the LLM's performance and capabilities. We would love to get community contributions and feedback to enhance the model further. For any questions and ideas, please visit our &lt;a href="https://smallcloud.ai/discord" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>githubcopilot</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
