Skip to content

Commit

Permalink
Fixed cursor page
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Nov 30, 2024
1 parent 15e38c4 commit 29da8f5
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.mdx
*.md
2 changes: 1 addition & 1 deletion docs_new/welcome/ai-agency-vs-other-frameworks.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "AI Agency vs Other Frameworks"
title: "Agency vs Other Frameworks"
description: "Compare Agency Swarm with other multi-agent AI frameworks."
icon: "scale-unbalanced"
---
Expand Down
76 changes: 54 additions & 22 deletions docs_new/welcome/getting-started/cursor-ide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ icon: "cube"

## Why Use Cursor

Cursor makes coding easier by adding AI tools directly into your Cursor IDE. These tools can help you save time by automating repetitive tasks, fixing code, and even helping your team work together more effectively.
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.

![Cursor IDE Overview](/images/cursor-overview.png)

## What are Cursor Rules

**Cursor Rules** are custom instructions that tell Cursor how to work with your code. They help the AI understand your project, make changes, and assist you in completing tasks.
**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.

![Cursor Rules Example](/images/cursor-rules-example.png)

## Getting Started with Cursor

Follow these steps to set up Cursor IDE in your project:
Follow these steps to create your first Agency using Cursor:

<Steps>
<Step title="Enable Cursor Rules in Settings">
Expand All @@ -42,34 +42,66 @@ Follow these steps to set up Cursor IDE in your project:
![Enable Cursor Rules](/images/enable-cursor-rules.png)
</Step>

<Step title="Add the `.cursorrules` File to Your Project">
<Step title="Add The `.cursorrules` File to Your Project">
The `.cursorrules` file contains the instructions that guide Cursor's AI. To add it:
- Download the `.cursorrules` file from the Agency Swarm repository.
- Download the `.cursorrules` file from the [Agency Swarm repository](https://github.com/VRSEN/agency-swarm/blob/main/.cursorrules).
- Place the file in the main folder (root directory) of your project.
</Step>

<Step title="Edit the `.cursorrules` File">
You can edit the `.cursorrules` file to customize how Cursor AI works for your project. For example, you can define specific tasks or rules for the AI to follow.
<Step title="Open Cursor Composer">
Cursor Composer allows you to create and modify multiple files in parallel.
- Open Composer by pressing `Cmd+I` (macOS) or `Ctrl+I` (Windows/Linux).
</Step>

<Step title="Use Cursor's AI Tools">
Cursor provides several tools to make coding easier:
<Step title="Send Your First Prompt to Composer">
Spend as much time as possible on your first prompt. This will save you a lot of time later. Make sure to include:
- All agents that you want to create
- All tools and APIs that the agents must use.
- Communication flows between your agents.
</Step>

<Step title="Varify The Agency Structure">
Sometimes Cursor forgets certain files or hallucinates the agency structure. Make sure to verify that:
- All import statements are correct.
- `requirements.txt` file exists.
- `agency.py` file executes properly.

- **Composer**:
![Cursor Composer](/images/cursor-composer.gif)
- Open Composer by pressing `Cmd+Shift+I` (macOS) or `Ctrl+Shift+I` (Windows/Linux).
- Use it to edit multiple files at once or create entire setups based on simple instructions.
If any of these are missing or not working, instruct composer to create them or fix the code.
</Step>

- **Inline Editing**:
![Inline Editing](/images/cursor-inline-editing.svg)
- Highlight the code you want to change and press `Cmd+K` (macOS) or `Ctrl+K` (Windows/Linux).
- The AI will help you rewrite or improve the selected code.
<Step title="Adjust the Tools">
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.
- If any of the tools are not working, send the error message to composer and ask it to fix the code.
- 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.
- If you are stuck, use Chat `CMD+L` (macOS) or `Ctrl+L` (Windows/Linux) to ask questions and brain storm alternative approaches. For example, ask "What other APIs can I use for this tool?"

</Step>

- **Chat Interface**:
<img src="/images/cursor-chat.svg" width="65%" alt="Chat Interface" style={{display: 'block', margin: '0 auto'}} />
- Open the chat by pressing `Cmd+L` (macOS) or `Ctrl+L` (Windows/Linux).
- Use it to ask the AI questions, debug your code, or see changes made to your files.
<Step title="Adjust the Agents">
Verify the agent instructions and parameters are correct after adjustments. **Actually think about instructions.**
- Use Chat or Inline Editing to adjust the `instruction.md` files to your needs.
- Edit instructions manually and remove all boilerplate text.
- Make sure each agent has access to all the new tools either by speciying `tools_folder` path or adding them in `tools` parameter.
</Step>

<Step title="Test Your Agency">
Run `agency.py` file to see if it works.
- Send a realistic task to your agency and see if it can complete it.
- If it doesn't work as expected, try to send additional messages with more details and see if it helps.
- Use these extra messages to guide yourself on how to adjust the instructions, so it can complete it next time.
</Step>

<Step title="Repeat">
Iterate on your agency by repeating the process until you are satisfied with the results.

<Note>
**Agent Development is an Iterative Process**

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.
</Note>
</Step>


</Steps>

With these steps, you're ready to start using Cursor to make your coding experience faster and easier!

8 changes: 4 additions & 4 deletions docs_new/welcome/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "Installation"
description: "Install AI Agency in just 2 simple steps."
description: "Install Agency in just 2 simple steps."
icon: "box"
---

## Installation

<Accordion title="Step 1: Create a Python virtual environment" defaultOpen={false}>
<Accordion title="Step 1: Create a python virtual environment" defaultOpen={false}>

1. **Install Python**

Expand Down Expand Up @@ -35,14 +35,14 @@ icon: "box"
```

</Accordion>
<Accordion title="Step 2: Install the aiagency package" defaultOpen={true}>
<Accordion title="Step 2: Install the agency package" defaultOpen={true}>

Simply run the following command:

<Note>Make sure you are in the virtual environment before installing the package.</Note>

```bash
pip install aiagency
pip install agency
```

</Accordion>
Expand Down

0 comments on commit 29da8f5

Please sign in to comment.