cursor-ide.mdx 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. ---
  2. title: "Cursor AI"
  3. description: "Getting started with Cursor."
  4. icon: "cube"
  5. ---
  6. <iframe
  7. width="100%"
  8. height="400"
  9. src="https://www.youtube.com/embed/Og73plUTabs"
  10. title="YouTube video player"
  11. frameborder="0"
  12. allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  13. allowfullscreen
  14. style={{ borderRadius: "10px" }}
  15. ></iframe>
  16. ## Why Use Cursor
  17. Cursor simplifies AI agent development by reducing the feedback loop on AI-generated code. This enables faster iteration and provides an optimal balance between manual control and AI assistance.
  18. ![Cursor IDE Overview](/images/cursor-overview.png)
  19. ## What are Cursor Rules
  20. **Cursor Rules** are custom instructions that tell Cursor how to work with your code. Agency has a predefined `.cursorrules` file that contains everything that Cursor needs to know in order to create agents with this framework.
  21. ![Cursor Rules Example](/images/cursor-rules-example.png)
  22. ## Getting Started with Cursor
  23. Follow these steps to create your first Agency using Cursor:
  24. <Tip>
  25. Prefer a ready-to-run repo? Start from the [Starter Template](/welcome/getting-started/starter-template).
  26. </Tip>
  27. <Steps>
  28. <Step title="Enable Cursor Rules in Settings">
  29. First, you need to enable Cursor Rules in the Cursor IDE:
  30. - Open the Cursor IDE.
  31. - Go to **Settings...** > **Cursor Settings**.
  32. <img src="/images/open-cursor-settings.png" width="65%" alt="Open Cursor Settings" style={{display: 'block', margin: '0 auto'}} />
  33. - Turn on the **Rules for AI** option. This allows you to use a `.cursorrules` file in your project.
  34. ![Enable Cursor Rules](/images/enable-cursor-rules.png)
  35. </Step>
  36. <Step title="Add The `.cursorrules` File to Your Project">
  37. The `.cursorrules` file contains the instructions that guide Cursor's AI. To add it:
  38. - Download the `.cursorrules` file from the [Agency Swarm repository](https://github.com/VRSEN/agency-swarm/blob/main/.cursorrules).
  39. - Place the file in the main folder (root directory) of your project.
  40. </Step>
  41. <Step title="Open Cursor Composer">
  42. Cursor Composer allows you to create and modify multiple files in parallel.
  43. - Open Composer by pressing `Cmd+I` (macOS) or `Ctrl+I` (Windows/Linux).
  44. </Step>
  45. <Step title="Send Your First Prompt to Composer">
  46. Spend as much time as possible on your first prompt. This will save you a lot of time later. Make sure to include:
  47. - All agents that you want to create
  48. - All tools and APIs that the agents must use
  49. - Communication flows between your agents
  50. </Step>
  51. <Step title="Verify The Agency Structure">
  52. Sometimes Cursor forgets certain files or hallucinates the agency structure. Make sure to verify that:
  53. - All import statements are correct
  54. - `requirements.txt` file exists
  55. - `agency.py` file executes properly
  56. If any of these are missing or not working, instruct composer to create them or fix the code.
  57. </Step>
  58. <Step title="Adjust the Tools">
  59. Run each tool file to make sure they work as expected. You will see the test cases that Cursor created at the bottom in `if __name__ == "__main__"` statements.
  60. - If any of the tools are not working, send the error message to composer and ask it to fix the code.
  61. - If you want to adjust the functionality of the tool, either use inline editing `Cmd+K` (macOS) or `Ctrl+K` (Windows/Linux) or send another message to composer.
  62. - If you are stuck, use Chat `Cmd+L` (macOS) or `Ctrl+L` (Windows/Linux) to ask questions and brainstorm alternative approaches. For example, ask "What other APIs can I use for this tool?"
  63. </Step>
  64. <Step title="Adjust the Agents">
  65. Verify the agent instructions and parameters are correct after adjustments. **Actually think about instructions.**
  66. - Use Chat or Inline Editing to adjust the `instruction.md` files to your needs.
  67. - Edit instructions manually and remove all boilerplate text.
  68. - Make sure each agent has access to all the new tools either by specifying `tools_folder` path or adding them in `tools` parameter.
  69. </Step>
  70. <Step title="Test Your Agency">
  71. Run `agency.py` file to see if it works.
  72. - Send a realistic task to your agency and see if it can complete it.
  73. - If it doesn't work as expected, try to send additional messages with more details and see if it helps.
  74. - Use these extra messages to guide yourself on how to adjust the instructions, so it can complete it next time.
  75. </Step>
  76. <Step title="Repeat">
  77. Iterate on your agency by repeating the process until you are satisfied with the results.
  78. <Note>
  79. **Agent Development is an Iterative Process**
  80. Currently, agent development requires ongoing monitoring and adjustments to ensure desired performance. As larger and more advanced models become available, this process will become more streamlined.
  81. </Note>
  82. </Step>
  83. </Steps>
  84. ## Next Steps
  85. - Learn the core concepts: [Tools Overview](/core-framework/tools/overview), [Agents Overview](/core-framework/agents/overview), and [Agencies Overview](/core-framework/agencies/overview).
  86. - Run your first end-to-end flow with [Running an Agency](/core-framework/agencies/running-agency).