Skip to content

trycirrus/cirrus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cirrus — Enhanced SWE Agent

A local autonomous software engineering agent that works in the background.

Overview

Cirrus is an enhanced SWE (Software Engineering) agent that can:

  • Clone repositories and create isolated working environments
  • Generate intelligent implementation plans using vector embeddings
  • Execute iterative implementation with verification
  • Create pull requests from feature branches
  • Clean up temporary resources automatically

Workflow

The agent follows a structured 10-phase workflow:

graph TD
    A[TASK] --> B(Clone repository)
    B --> C(Vector embeddings)
    C --> D["Plan (from task and using the embeddings)"]
    D --> E["Iterative Implementation (shift to new branch and commit)"]
    E --> F(Task Verification)

    F -- Does not verify --> E
    F -- Verifies --> G{Error Fixing}

    G -- If errors --> E
    G -- No errors --> H(Create a PR from new branch)

    H --> I(Delete temp files)
    I --> J[Task done]
Loading

Features

🧠 Intelligent Planning

  • Uses vector embeddings to understand codebase context
  • Generates detailed implementation plans with specific file modifications
  • Considers existing code patterns and architecture

🔧 Autonomous Implementation

  • Creates feature branches automatically
  • Makes targeted file modifications based on the plan
  • Iterates with verification until task completion

✅ Quality Assurance

  • Built-in verification and testing phases
  • Error detection and automatic fixing
  • Comprehensive logging for debugging

🔄 Git Integration

  • Full git workflow support (clone, branch, commit, push, PR)
  • Temporary directory management
  • Clean resource cleanup

Usage

Basic Usage

from cirrus_agent.agents.enhanced_swe_agent import EnhancedSWEAgent

# Initialize the agent
agent = EnhancedSWEAgent(
    model_config={
        "api_key": "your-openai-api-key",
        "base_url": "https://api.openai.com/v1"  # optional
    },
    github_token="your-github-token"
)

# Execute a task
result = await agent.execute_task(
    task_description="Update Node.js to v22 and upgrade Next.js",
    repo_url="https://github.com/username/repository"
)

Task Examples

  • Dependency Updates: "Update React to v19 and Next.js to latest"
  • Configuration Changes: "Add dark mode support with Tailwind CSS"
  • Code Refactoring: "Refactor authentication middleware to use JWT tokens"
  • Feature Implementation: "Add user profile page with avatar upload"

Architecture

Core Components

  • EnhancedSWEAgent: Main orchestrator that manages the workflow
  • RepositoryManager: Handles repository cloning and cleanup
  • EmbeddingService: Creates and manages code embeddings for context
  • ValidationEngine: Verifies implementation and detects issues
  • AutonomousToolSystem: Orchestrates autonomous tool execution

Available Tools

  • File Operations: read, write, update, search files
  • Git Operations: branch, commit, push, status, create PR
  • Code Analysis: vector embeddings, semantic search
  • Validation: testing, linting, type checking

Configuration

Environment Variables

# Required
OPENAI_API_KEY=your-openai-api-key
GITHUB_TOKEN=your-github-token

# Optional
EMBEDDING_SERVICE_URL=http://localhost:8000
VALIDATION_ENGINE_URL=http://localhost:8001

Model Configuration

model_config = {
    "api_key": "sk-...",
    "base_url": "https://api.openai.com/v1",  # optional
    "model": "kimi-k2-0711-preview",          # default
    "temperature": 0.1                      # for consistent results
}

Development

Setup

# Clone the repository
git clone https://github.com/saurish/cirrus.git
cd cirrus

# Install dependencies
npm install  # for frontend
cd backend && pip install -r requirements.txt

Running Tests

# Backend tests
cd backend
python -m pytest tests/

# Frontend tests
cd frontend
npm test

Architecture Overview

The system follows a modular architecture with clear separation of concerns:

  • Agent Layer: High-level orchestration and workflow management
  • Tool Layer: Specific operations (file, git, analysis tools)
  • Service Layer: Core services (embeddings, validation)
  • Repository Layer: Git and file system operations

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Run tests and validation
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

:)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published