Skip to main content

Swarms - TGSC

Project description

Open Cursor Agent

Powered by Swarms Swarms Framework

An open-source autonomous AI agent implementation inspired by Cursor Agent, built on top of Swarms - the enterprise-grade production-ready multi-agent orchestration framework. This production-grade agent can autonomously plan, execute, and complete complex tasks using a combination of Large Language Model reasoning and tool execution.

Built with Swarms Framework - Leveraging the power of Swarms, the leading open-source framework for building production-ready multi-agent systems. Swarms provides the robust infrastructure, agent orchestration, and enterprise-grade reliability that makes this agent possible.

Overview

Open Cursor Agent is a sophisticated AI agent capable of:

  • Autonomous Task Planning: Breaking down complex tasks into manageable, sequential subtasks
  • Multi-Tool Execution: Leveraging various tools including file operations, command execution, and web search
  • Intelligent Reasoning: Using LLM-powered thinking to analyze situations and decide next actions
  • State Management: Tracking task progress through well-defined execution states
  • Error Handling: Robust error detection and recovery mechanisms

Features

Feature Description
File system operations Read, write, search, and manage files
Command execution Execute commands with timeout and security controls
Web search integration Access real-time information via web search
Task dependency management Manage tasks with priority awareness
Execution history tracking and logging Record and monitor action history and logs
Workspace isolation Ensure security-first approach to isolate workspace

Installation

Prerequisites

  • Python 3.8 or higher
  • API key for your chosen LLM provider (e.g., OpenAI)

Setup

# Clone the repository
git clone https://github.com/kyegomez/Open-Cursor-Agent
cd Open-Cursor-Agent

# Install dependencies
pip install -r requirements.txt

Environment Variables

WORKSPACE_DIR=""
OPENAI_API_KEY=""
ANTHROPIC_API_KEY=""

Usage

from open_cursor.main import OpenCursorAgent

# Initialize the agent
agent = OpenCursorAgent(
    model_name="gpt-4o",
    workspace_path=".",
)

# Example task
task_description = """
Create a transformer model in pytorch in a file called transformer.py"
"""

result = agent.run(task_description)

print(result)

Architecture

graph LR
    A[User Task] --> B[Initialize]
    B --> C[Planning]
    C --> D[Execution]
    D --> E[Thinking]
    E --> F{Complete?}
    F -->|No| D
    F -->|Yes| G[Results]
    
    C -.-> H[LLM]
    D -.-> H
    E -.-> H
    D -.-> I[Tools]
    
    style B fill:#4a90e2,color:#fff
    style C fill:#9b59b6,color:#fff
    style D fill:#e74c3c,color:#fff
    style E fill:#f39c12,color:#fff
    style G fill:#27ae60,color:#fff

Execution Flow

The agent operates through a state machine with the following phases:

  1. Initialization: Task context is created and main task is registered
  2. Planning Phase: LLM generates a detailed execution plan with subtasks
  3. Execution Phase: Each subtask is executed using appropriate tools
  4. Thinking Phase: Results are analyzed and next actions determined
  5. Completion: All tasks are finalized and results are returned

Agent States

  • INITIALIZING: Setting up the task context
  • PLANNING: Creating a detailed execution plan
  • EXECUTING: Performing planned actions
  • THINKING: Analyzing results and determining next steps
  • COMPLETED: Task successfully finished
  • ERROR: Error encountered during execution
  • PAUSED: Execution temporarily halted

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with appropriate tests
  4. Submit a pull request with a clear description

License

This project is licensed under the terms specified in the LICENSE file.

Acknowledgments

Special Thanks: To Swarms Team and the entire Swarms community for building the infrastructure that makes advanced AI agents accessible to everyone. This project stands on the shoulders of giants.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_cursor_agent-0.1.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_cursor_agent-0.1.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file open_cursor_agent-0.1.0.tar.gz.

File metadata

  • Download URL: open_cursor_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for open_cursor_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aae99950b4c64d22525ae1e2803bc04791e9e2e352597161bb71a1924fb5616b
MD5 5422213c7660ee4557d56811bf01f5af
BLAKE2b-256 1a0e4bede3c52109c58cd1f691ce0efb7218c243bbda1248a24c89e06c0fb6d2

See more details on using hashes here.

File details

Details for the file open_cursor_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: open_cursor_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for open_cursor_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d782eee5960534a15ec84a1828a1d25a431e0f52356bd55507612a9d92eb99b0
MD5 1a0646c1b3b33cd1f15b5134e738f451
BLAKE2b-256 fb0097139ef19d8ea3308cb35eee4c3d50031c5e95f62aadd22f7318c96dfb1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page