Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 MiMo SWE-Agent

Autonomous Software Engineering Agent powered by Xiaomi MiMo

Python 3.10+ License MiMo V2.5 Pro FastAPI Autonomous Agent


📖 Overview

MiMo SWE-Agent is an autonomous software engineering agent that reads GitHub issues, analyzes codebases, generates fixes, runs tests, and creates pull requests — all powered by Xiaomi MiMo V2.5 Pro.

🎯 What It Does

GitHub Issue → Analyze → Plan → Code → Test → Review → Pull Request
     │           │        │       │       │        │         │
     └───────────┴────────┴───────┴───────┴────────┴─────────┘
                         All powered by MiMo
  1. 📥 Read Issue — Fetches issue details from GitHub API
  2. 🧠 Analyze — Understands the problem, identifies affected files
  3. 📋 Plan — Creates step-by-step execution plan
  4. 💻 Code — Generates precise code changes
  5. 🧪 Test — Runs tests to validate changes
  6. 🔍 Review — Self-reviews code quality (scored 1-10)
  7. 🔀 PR — Creates pull request with detailed description

✨ Key Features

  • 🤖 MiMo-Powered — Uses Xiaomi MiMo V2.5 Pro for reasoning
  • 🔄 Full Pipeline — End-to-end from issue to PR
  • 🌐 Web Dashboard — Real-time visualization of agent thinking
  • 🎮 Demo Mode — Works without API keys (mock responses)
  • ⌨️ CLI Interface — Command-line tool for quick usage
  • 📊 Metrics — Token usage, success rates, timing
  • 🔌 Plugin Ready — Easy to add custom agents

🚀 Quick Start

Installation

git clone https://github.com/Cohhuy/mimo-swe-agent.git
cd mimo-swe-agent
pip install -r requirements.txt

Demo Mode (No API Key Needed!)

# Run the full demo pipeline
python -m mimo_swe demo

# Or with CLI
python -m mimo_swe demo --verbose

Live Mode

# Set up environment
cp .env.example .env
# Edit .env with your keys

# Run on a GitHub issue
python -m mimo_swe run Cohhuy/mimo-swe-agent 1

# Check configuration
python -m mimo_swe check

Web Dashboard

# Start the web UI
python -m mimo_swe web

# Open http://localhost:8000

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                      MiMo SWE-Agent                         │
│                                                             │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐  │
│  │ Planner  │→ │  Coder   │→ │  Tester  │→ │ Reviewer │  │
│  │          │  │          │  │          │  │          │  │
│  │ Analyze  │  │ Generate │  │ Validate │  │ Score &  │  │
│  │ & Plan   │  │ Code     │  │ Tests    │  │ Approve  │  │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘  │
│       ↑              ↑             ↑             ↑         │
│       └──────────────┴─────────────┴─────────────┘         │
│                    MiMo V2.5 Pro                            │
│                                                             │
│  ┌──────────────────────────────────────────────────────┐  │
│  │                  GitHub Client                        │  │
│  │  Issues • Files • Branches • Pull Requests           │  │
│  └──────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Core Modules

Module Purpose
mimo_client.py MiMo API client (OpenAI-compatible)
github_client.py GitHub REST API wrapper
planner.py Issue analysis & execution planning
coder.py Code generation from plans
tester.py Test runner & validation
reviewer.py Code review & scoring
agent.py Main orchestrator pipeline
demo_engine.py Demo mode with mock responses
cli.py Command-line interface
web/ FastAPI web dashboard

🌐 Web Dashboard

The web dashboard provides real-time visualization of the agent's work:

  • Dark theme with Xiaomi branding
  • Live timeline showing each pipeline step
  • Diff viewer with syntax highlighting
  • Terminal output streaming in real-time
  • Demo mode toggle for presentations

MiMo SWE-Agent Dashboard


🎮 Demo Mode

Demo mode runs the full pipeline without any API keys:

python -m mimo_swe demo

It uses a sample Flask calculator app with intentional bugs:

  • Division function uses multiplication instead
  • No ZeroDivisionError handling
  • Modulo endpoint not implemented
  • History endpoint has undefined variable

The agent "fixes" all bugs and creates a PR — perfect for demonstrations.


⚙️ Configuration

Environment Variables

# Required for live mode
MIMO_API_KEY=your_mimo_api_key
GITHUB_TOKEN=your_github_token

# Optional
MIMO_MODEL=mimo-v2.5-pro          # Model to use
MIMO_BASE_URL=https://token-plan-sgp.xiaomimimo.com/v1
DEMO_MODE=false                     # Enable demo mode

CLI Options

# Run on specific issue
mimo-swe run owner/repo 42

# Run with custom model
mimo-swe run owner/repo 42 --model mimo-v2.5

# Demo mode
mimo-swe demo --verbose

# Check configuration
mimo-swe check

# Start web dashboard
mimo-swe web --port 8000

📊 Performance Metrics

The agent tracks detailed metrics:

  • Token Usage — Total tokens consumed per step
  • Success Rate — Percentage of successful PRs
  • Average Duration — Mean time per issue
  • Review Score — Code quality score (1-10)
📈 Execution Summary
════════════════════════════════════════════════════════
  Issue:          #42 - Calculator division bug
  Status:         ✅ PR Created
  Duration:       12.4s
  Tokens Used:    3,847
  Review Score:   9.2/10
  Tests Fixed:    4/4

🧠 Pipeline Steps
  ✅ Analyze     1.2s    450 tokens
  ✅ Plan        1.8s    680 tokens
  ✅ Code        3.4s    1,200 tokens
  ✅ Test        2.1s    320 tokens
  ✅ Review      1.9s    580 tokens
  ✅ PR          2.0s    617 tokens

🛣️ Roadmap

  • Core agent pipeline
  • Demo mode
  • Web dashboard
  • CLI interface
  • Multi-file complex changes
  • GitHub Actions integration
  • Slack/Discord notifications
  • Agent memory & learning
  • Multi-repo support
  • Custom agent plugins

🤝 Contributing

Contributions welcome! Please see our Contributing Guide.

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open Pull Request

📄 License

MIT License - see LICENSE for details.


🙏 Acknowledgments

  • Xiaomi MiMo — For the powerful AI model
  • SWE-Agent / Devin — For inspiration
  • Open Source Community — For tools and libraries

Built with ❤️ using Xiaomi MiMo V2.5 Pro

About

Autonomous SWE-Agent powered by Xiaomi MiMo — reads GitHub issues, writes code, runs tests, creates PRs

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages