Mini Agent is a minimal yet professional demo project that showcases the best practices for building agents with the MiniMax M2.1 model. Leveraging an Anthropic-compatible API, it fully supports interleaved thinking to unlock M2's powerful reasoning capabilities for long, complex tasks.
This project comes packed with features designed for a robust and intelligent agent development experience:
✅ Full Agent Execution Loop: A complete and reliable foundation with a basic toolset for file system and shell operations.
✅ Persistent Memory: An active Session Note Tool ensures the agent retains key information across multiple sessions.
✅ Intelligent Context Management: Automatically summarizes conversation history to handle contexts up to a configurable token limit, enabling infinitely long tasks.
✅ Claude Skills Integration: Comes with 15 professional skills for documents, design, testing, and development.
✅ MCP Tool Integration: Natively supports MCP for tools like knowledge graph access and web search.
✅ Comprehensive Logging: Detailed logs for every request, response, and tool execution for easy debugging.
✅ Clean & Simple Design: A beautiful CLI and a codebase that is easy to understand, making it the perfect starting point for building advanced agents.
1Copy-Item mini_agent\config\config-example.yaml mini_agent\config\config.yaml
23# 6. Edit config file4vim mini_agent/config/config.yaml # Or use your preferred editor
Fill in your API Key and corresponding API Base:
yaml
1api_key:"YOUR_API_KEY_HERE"# API Key from step 12api_base:"https://api.minimax.io"# Global3# api_base: "https://api.minimaxi.com" # China4model:"MiniMax-M2.1"5max_steps:1006workspace_dir:"./workspace"
1# Method 1: Run as module directly (good for debugging)2uv run python -m mini_agent.cli
34# Method 2: Install in editable mode (recommended)5uv tool install -e .6# After installation, run from anywhere and code changes take effect immediately7mini-agent
8mini-agent --workspace /path/to/your/project
If installed via uv tool install: Use the output of which mini-agent-acp
If in development mode: ./mini_agent/acp/server.py
Usage:
Open Zed's agent panel with Ctrl+Shift+P → "Agent: Toggle Panel"
Select "mini-agent" from the agent dropdown
Start conversations with Mini Agent directly in your editor
Usage Examples
Here are a few examples of what Mini Agent can do.
Task Execution
In this demo, the agent is asked to create a simple, beautiful webpage and display it in the browser, showcasing the basic tool-use loop.
Demo GIF 1: Basic Task Execution
Using a Claude Skill (e.g., PDF Generation)
Here, the agent leverages a Claude Skill to create a professional document (like a PDF or DOCX) based on the user's request, demonstrating its advanced capabilities.
Demo GIF 2: Claude Skill Usage
Web Search & Summarization (MCP Tool)
This demo shows the agent using its web search tool to find up-to-date information online and summarize it for the user.
Demo GIF 3: Web Search
Testing
The project includes comprehensive test cases covering unit tests, functional tests, and integration tests.
Quick Run
bash
1# Run all tests2pytest tests/ -v
34# Run core functionality tests5pytest tests/test_agent.py tests/test_note_tool.py -v