Cursor is great BUT Aider is the OG AI Coding King (Mermaid Diagram AI Agent)

Cursor is great BUT Aider is the OG AI Coding King (Mermaid Diagram AI Agent)

Introduction to AI Coding Tools

Overview of Cursor and AER

  • The speaker introduces the topic, highlighting the popularity of Cursor in the tech ecosystem due to its new multifile editing composer feature.
  • Despite being a fan of Cursor, the speaker warns against relying solely on it as it is a closed-source commercial application. They emphasize the importance of diversifying tools in the generative AI landscape.
  • The speaker mentions AER, an original LLM-based AI coding tool that has been beneficial for over a year, typically outperforming Cursor while offering more control and being completely free.

Introduction to Mermaid AI Agent

  • The video aims to showcase AER as an alternative to Cursor by demonstrating its use in building a new Mermaid AI agent for faster diagram creation.
  • An explanation of Mermaid is provided; it's described as a text-based diagramming tool that converts simple text blocks into node-edge diagrams.

Demonstrating Mermaid Diagram Generation

Running Commands and Generating Diagrams

  • The speaker demonstrates how to run commands with the Mermaid agent, specifying desired diagrams and output images.
  • A detailed breakdown of a prompt used for generating a flowchart about communication's importance in engineering is shared, including key benefits like time saved and increased trust.

Iteration Process

  • The iterative nature of using this tool is highlighted; users can refine diagrams by adding nodes or grouping them based on benefits.
  • The speaker shows how adjustments are made to improve diagram clarity by changing layout options (e.g., making it run left-to-right).

AI Coding with AER

Saving Generated Files

  • Discussion shifts towards saving generated files from the codebase. The goal is to save all iterations rather than just the last one created.

Utilizing Terminal Commands

  • The speaker explains how AER operates directly within the terminal, showcasing commands like AER no autoc commits and running with specific formats (Sonet).

Contextual Awareness in Codebase

  • By adding files under "Source mermaid agent," users can see all relevant Python files within their context window when querying changes needed for file management.

Implementing Changes in Codebase

Identifying Functions for Image Saving

  • The process involves asking AER where mermaid diagram images are saved within the codebase. This leads to identifying functions responsible for image handling.

Verbose Approach to AI Coding

Understanding AI Coding Assistants and Their Functionality

Importance of the Slash Ask Command

  • The speaker emphasizes the significance of using the slash ask command to enhance interactions with AI coding assistants, indicating that it facilitates deeper conversations about code changes.

Utilizing Existing Functions

  • A function called build_file_path is introduced, which helps in saving files to a specified output directory. This function ensures that the directory exists before saving.

Iterative Changes and Drafting

  • The speaker discusses how running the slash ask command allows for iterative changes, enabling users to request drafts and understand reasoning behind modifications made by the AI assistant.
  • By asking for a draft change in every iteration of a mermaid chart, users can see potential mistakes before finalizing any updates.

Implementing Code Changes

  • The focus shifts to updating code within a loop structure to ensure new files are saved correctly during iterations. This involves pasting specific code snippets into the main file.

Example: Creating Pie Charts

  • An example is provided where a pie chart is created using an AI agent. The speaker highlights how various charts can be generated through this process.

Enhancing Functionality with New Commands

Adding New Features

  • The discussion transitions towards creating additional commands for generating multiple versions of flowcharts, showcasing flexibility in design choices when working with AI tools.

Bulk Command Implementation

  • A bulk command feature is proposed that would allow users to create several iterations of flowcharts simultaneously by passing an additional flag during execution.

Creating and Managing Mermaid Diagrams with AER

Adding Typings and New Parameters

  • The speaker discusses the addition of a typings file that includes all necessary types for the code, specifically mentioning "oneshot mermaid params" and "iterate mermaid params."
  • A new parameter type called "bulk mermaid params" is introduced to enhance functionality within the method.
  • The speaker expresses hope that AER can make multifile changes automatically without manual intervention.

Observing Changes in Code

  • After executing commands, the system prompts whether to create an input file, which the speaker decides to accept.
  • The editor now displays all commands, including a newly added "merb command," indicating successful integration of changes.

Running Commands and Generating Diagrams

  • The setup instructions are visualized as a flowchart named "setup diagram.png," showcasing how various components interact.
  • Multiple versions of diagrams are generated, illustrating different setups such as installing dependencies and running commands using UV, a fast Python manager.

Evaluating Generated Versions

  • The diagrams produced show clear steps for installation and setup, highlighting optional configurations like setting up OpenAI keys.
  • Different verbosity levels in generated diagrams allow users to choose between detailed or simplified views based on their needs.

Performance Metrics and Insights

  • AER successfully executed changes across three files while processing 18K tokens at a cost of 7 cents; this highlights efficiency in resource usage.
  • Discussion on advancements in language models indicates potential future capabilities with context windows expanding significantly beyond current limits.

Conclusion: Tools for AI Coding Assistance

  • The speaker praises AER as an open-source tool offering customization options compared to closed-source alternatives like Cursor.

AI Coding Tools: AER vs. Cursor

Exploring AER as an Alternative to Cursor

  • The speaker recommends considering AER as a viable alternative to Cursor, emphasizing its precision during deep coding sessions.
  • AER is praised for its simplicity and clean AI coding architecture, making it user-friendly for developers.

Importance of Diagram Generation in Engineering

  • Generating diagrams on the fly is highlighted as crucial for engineers, particularly those at mid-senior levels, to effectively communicate their work's value.
  • Utilizing generative AI tools can enhance the speed and efficiency of diagram creation, aiding in clearer communication of ideas.

Diversifying Tools in AI Coding

  • The speaker stresses the importance of not relying solely on one tool in the evolving landscape of AI coding; diversification is key.
Video description

šŸ”„ Why Aider? Simple - Because Aider is THE Original LLM-based AI coding tool. šŸ“ AIDER https://aider.chat/ šŸ–¼ļø Mermaid JS AI Agent https://github.com/disler/mermaid-js-ai-agent šŸ” Great builder.io article on Cursor, OSS, and Lock-in https://www.builder.io/blog/oss-consequences šŸ’» Our Cursor Composer Breakdown https://youtu.be/V9_RzjqCXP8 ā° Aider Review 1 YEAR Ago https://youtu.be/MPYFPvxfGZs Unlike Cursor, Aider is open-source and completely free, offering you more control and customization over your AI coding process. With support from multiple LLM providers and incredible insights from its creator, Paul, Aider is designed to keep you ahead of the AI Coding curve. 🄚🄚🐣 Don't put all your eggs in one basket - explore the benefits of open-source AI coding tools like Aider. Whether you're a seasoned dev or just starting out, this video will show you how to: - Use Aider's terminal-based interface for precise control over your AI coding process - Implement the "Ask - Draft - Change" pattern for more accurate code modifications - Develop new features for our Mermaid JS Diagramming AI Agent with minimal manual input, leveraging Aider's advanced AI coding capabilities šŸŽ„ In This Video: - Discover why Aider, the original LM-based AI coding tool, often outperforms Cursor. - Learn how to leverage Aider's multi-file editing capabilities to enhance your coding efficiency. - See a live demo of building a Mermaid AI Agent to create stunning diagrams effortlessly. Understand the importance of diversifying your AI coding tools in the rapidly evolving generative AI landscape. šŸ› ļø Key Topics: AI Coding: Experience the power of AI in coding with Aider. Multi-File Editing: Seamlessly edit multiple files with ease. Diagram AI Agent: Use Mermaid.js + Generative AI to generate and iterate on diagrams quickly. Human-in-the-Loop: Enhance your agentic coding with iterative feedback and adjustments. Open Source: Enjoy the freedom and flexibility of an open-source AI Coding tool, AIDER. 🌟 Stay ahead in the world of AI programming and AI software engineering by subscribing to our channel. Stay focused and keep building. šŸ“– Chapters: 00:00 Cursor Pop off BUT BEWARE 00:30 Aider - The Original LM-based AI Coding Tool 01:27 Mermaid Diagram AI Agent 04:10 AI Coding with Aider 11:35 Multi-File AI Coding with Aider 17:45 Cheaper LLMs and 100m context window is coming 18:50 Aider gives you incredible AI Coding Insights #aicoding #programming #aiprogramming