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 commitsand 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_pathis 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.