MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / demo_full_agent

Function demo_full_agent

examples/04_full_agent.py:24–183  ·  view source on GitHub ↗

Demo: Full-featured agent with all capabilities.

()

Source from the content-addressed store, hash-verified

22
23
24async def demo_full_agent():
25 """Demo: Full-featured agent with all capabilities."""
26 print("\n" + "=" * 60)
27 print("Full Mini Agent - All Features Enabled")
28 print("=" * 60)
29
30 # Load configuration
31 config_path = Path("mini_agent/config/config.yaml")
32 if not config_path.exists():
33 print("❌ config.yaml not found. Please run:")
34 print(" cp mini_agent/config/config-example.yaml mini_agent/config/config.yaml")
35 return
36
37 config = Config.from_yaml(config_path)
38
39 # Check API key
40 if not config.llm.api_key or config.llm.api_key.startswith("YOUR_"):
41 print("❌ API key not configured in config.yaml")
42 return
43
44 # Create workspace
45 with tempfile.TemporaryDirectory() as workspace_dir:
46 print(f"📁 Workspace: {workspace_dir}")
47
48 # Load system prompt (Agent will auto-inject workspace info)
49 system_prompt_path = Path("mini_agent/config/system_prompt.md")
50 if system_prompt_path.exists():
51 system_prompt = system_prompt_path.read_text(encoding="utf-8")
52 else:
53 system_prompt = "You are a helpful AI assistant."
54
55 # Add Session Note instructions
56 note_instructions = """
57
58IMPORTANT - Session Memory:
59You have record_note and recall_notes tools. Use them to:
60- Save important facts, decisions, and context
61- Recall previous information across conversations
62"""
63 system_prompt += note_instructions
64
65 # Initialize LLM
66 llm_client = LLMClient(
67 api_key=config.llm.api_key,
68 api_base=config.llm.api_base,
69 model=config.llm.model,
70 )
71
72 # Initialize basic tools
73 tools = [
74 ReadTool(workspace_dir=workspace_dir),
75 WriteTool(workspace_dir=workspace_dir),
76 EditTool(workspace_dir=workspace_dir),
77 BashTool(),
78 ]
79 print("✓ Loaded 4 basic tools")
80
81 # Add Session Note tools

Callers 1

mainFunction · 0.85

Calls 12

add_user_messageMethod · 0.95
runMethod · 0.95
LLMClientClass · 0.90
ReadToolClass · 0.90
WriteToolClass · 0.90
EditToolClass · 0.90
BashToolClass · 0.90
SessionNoteToolClass · 0.90
RecallNoteToolClass · 0.90
load_mcp_tools_asyncFunction · 0.90
AgentClass · 0.90
from_yamlMethod · 0.80

Tested by

no test coverage detected