A local autonomous software engineering agent that works in the background.
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
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]
- Uses vector embeddings to understand codebase context
- Generates detailed implementation plans with specific file modifications
- Considers existing code patterns and architecture
- Creates feature branches automatically
- Makes targeted file modifications based on the plan
- Iterates with verification until task completion
- Built-in verification and testing phases
- Error detection and automatic fixing
- Comprehensive logging for debugging
- Full git workflow support (clone, branch, commit, push, PR)
- Temporary directory management
- Clean resource cleanup
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"
)- 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"
- 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
- 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
# 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:8001model_config = {
"api_key": "sk-...",
"base_url": "https://api.openai.com/v1", # optional
"model": "kimi-k2-0711-preview", # default
"temperature": 0.1 # for consistent results
}# 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# Backend tests
cd backend
python -m pytest tests/
# Frontend tests
cd frontend
npm testThe 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
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests and validation
- Submit a pull request
MIT License - see LICENSE file for details.