This directory contains a series of progressive examples to help you understand how to use the Mini Agent framework.
Difficulty: ⭐ Beginner
Content:
- How to directly use ReadTool, WriteTool, EditTool, BashTool
- No Agent or LLM involved, pure tool call demonstrations
- Perfect for understanding each tool's basic functionality
Run:
python examples/01_basic_tools.pyKey Learnings:
- Tool input parameter formats
- ToolResult return structure
- Error handling approaches
Difficulty: ⭐⭐ Beginner-Intermediate
Content:
- Create the simplest Agent
- Have Agent perform file creation tasks
- Have Agent execute bash command tasks
- Understand Agent execution flow
Run:
# Requires API key configuration first
python examples/02_simple_agent.pyKey Learnings:
- Agent initialization process
- How to give tasks to Agent
- How Agent autonomously selects tools
- Task completion criteria
Prerequisites:
- API key configured in
mini_agent/config/config.yaml
Difficulty: ⭐⭐⭐ Intermediate
Content:
- Direct usage of Session Note tools (record_note, recall_notes)
- Agent using Session Notes to maintain cross-session memory
- Demonstrate how two Agent instances share memory
Run:
python examples/03_session_notes.pyKey Learnings:
- How Session Notes work
- Note categorization management (category)
- How to guide Agent to use notes in system prompt
- Cross-session memory implementation
Highlight: This is one of the core features of this project! Shows a lightweight but effective session memory management solution.
Difficulty: ⭐⭐⭐⭐ Advanced
Content:
- Complete Agent setup with all features
- Integration of basic tools + Session Notes + MCP tools
- Full execution flow for complex tasks
- Multi-turn conversation examples
Run:
python examples/04_full_agent.pyKey Learnings:
- How to combine multiple tools
- MCP tool loading and usage
- Complex task decomposition and execution
- Production environment Agent configuration
Prerequisites:
- API key configured
- (Optional) MCP tools configured
# Copy configuration template
cp mini_agent/config/config-example.yaml mini_agent/config/config.yaml
# Edit config file and fill in your MiniMax API Key
vim mini_agent/config/config.yaml# Example that doesn't need API key
python examples/01_basic_tools.py
# Example that needs API key
python examples/02_simple_agent.pyRecommended to learn in numerical order:
- 01_basic_tools.py - Understand tools
- 02_simple_agent.py - Understand Agent
- 03_session_notes.py - Understand memory management
- 04_full_agent.py - Understand complete system
These examples are all refined from test cases in the tests/ directory:
| Example | Based on Test | Description |
|---|---|---|
| 01_basic_tools.py | tests/test_tools.py | Basic tool unit tests |
| 02_simple_agent.py | tests/test_agent.py | Agent basic functionality tests |
| 03_session_notes.py | tests/test_note_tool.py tests/test_integration.py |
Session Note tool tests |
| 04_full_agent.py | tests/test_integration.py | Complete integration tests |
- Run
01_basic_tools.py- Learn about tools - Run
02_simple_agent.py- Run your first Agent - Go directly to interactive mode with
main.py
- Read and run all examples (01 → 04)
- Read corresponding test cases (
tests/) - Read core implementation code (
mini_agent/) - Try modifying examples to implement your own features
- Understand all examples
- Read Production Deployment Guide
- Configure MCP tools and Skills
- Extend tool set based on needs
❌ API key not configured in config.yaml
Solution: Ensure you've configured a valid MiniMax API Key in mini_agent/config/config.yaml
❌ config.yaml not found
Solution:
cp mini_agent/config/config-example.yaml mini_agent/config/config.yaml⚠️ MCP tools not loaded: [error message]
Solution: MCP tools are optional and don't affect basic functionality. If you need them, refer to the MCP configuration section in the main README.
- Main Project README - Complete project documentation
- Test Cases - More usage examples
- Core Implementation - Source code
- Production Guide - Deployment guide
If you have good usage examples, PRs are welcome!
Suggested new example directions:
- Web search integration examples (using MiniMax Search MCP)
- Skills usage examples (document processing, design, etc.)
- Custom tool development examples
- Error handling and retry mechanism examples
⭐ If these examples help you, please give the project a Star!