Skip to content

Commit 4ac1dd9

Browse files
authored
Merge pull request #27 from MiroMindAI/patch_pengxiang
feat(agent): update README and single task running scripts to support the demo.
2 parents a40022c + 726b657 commit 4ac1dd9

File tree

13 files changed

+271
-60
lines changed

13 files changed

+271
-60
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ web_app/static/
225225
web_app/sessions/
226226
web_app/uploads/
227227
.claude/
228+
.vscode/
228229
.ruff_cache/
229230
.env
230231
.env.local

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,41 @@
6868

6969
### ⚡ Quick Setup
7070

71-
**Example**: Intelligent document analysis with file processing capabilities.
71+
MiroFlow provides a web interface powered by FastAPI and React for interactive agent tasks.
7272

7373
```bash
7474
# 1. Clone and setup
7575
git clone https://github.com/MiroMindAI/MiroFlow && cd MiroFlow
7676
uv sync
7777

78-
# 2. Configure API key
78+
# 2. Configure API keys
7979
cp .env.template .env
80-
# Edit .env and add your OPENROUTER_API_KEY
80+
# Edit .env and add your API keys (see .env.template for details)
8181

82-
# 3. Run your first agent
83-
uv run main.py trace --config_file_name=agent_quickstart_reading --task="What is the first country listed in the XLSX file that have names starting with Co?" --task_file_name="data/FSI-2023-DOWNLOAD.xlsx"
82+
# 3. Launch the web application
83+
bash scripts/start_web.sh
8484
```
8585

86-
🎉 **Expected Output:** Your agent should return **\boxed{Congo Democratic Republic}** 😊
86+
Access the web interface at `http://localhost:8000` and start querying the agent. The default agent configuration is `config/agent_web_demo.yaml`.
8787

88-
> **💡 Tip:** If you encounter issues, check that your API key is correctly set in the `.env` file and that all dependencies are installed.
88+
> **💡 Tip:** If you encounter issues, check that your API keys are correctly set in the `.env` file and that all dependencies are installed.
8989
90-
### 🌐 Web Application
90+
### 🖥️ CLI Usage
9191

92-
MiroFlow provides a web interface powered by FastAPI and React for interactive agent tasks.
92+
You can also run single tasks from the command line:
9393

9494
```bash
95-
# Start the web server (auto-builds frontend on first run)
96-
bash scripts/start_web.sh
95+
# Run a single task with a custom question
96+
bash scripts/test_single_task.sh \
97+
--config config/agent_quickstart.yaml \
98+
--task-question "What is the first country listed in the XLSX file that have names starting with Co?" \
99+
--file-path data/FSI-2023-DOWNLOAD.xlsx
97100
```
98101

99-
Access the web interface at `http://localhost:8000` and API documentation at `http://localhost:8000/docs`.
102+
🎉 Expected Output: Your agent should return \boxed{Congo Democratic Republic} 😊
103+
104+
💡 Tip: If you encounter issues, check that your API key is correctly set in the .env file and that all dependencies are installed.
105+
100106

101107
---
102108

@@ -172,7 +178,7 @@ Follow our detailed guides to reproduce benchmark results in our [Benchmarks Doc
172178
<details>
173179
<summary><strong>What API keys do I need?</strong></summary>
174180
<br>
175-
You only need an OpenRouter API key to get started. OpenRouter provides access to multiple language models through a single API.
181+
The required API keys depend on your configuration. See <code>.env.template</code> for the full list. Common keys include: <code>OPENROUTER_API_KEY</code> (for models via OpenRouter), <code>SERPER_API_KEY</code> (web search), <code>JINA_API_KEY</code> (web scraping), and <code>E2B_API_KEY</code> (Python code execution).
176182
</details>
177183

178184
<details>

config/agent_quickstart.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# MiroFlow Gradio Demo Configuration
2+
# A simplified configuration for the Gradio web interface (using MiroThinker)
3+
4+
# No benchmark defaults - this is a standalone config
5+
defaults:
6+
- benchmark: example_dataset
7+
- override hydra/job_logging: none
8+
- _self_
9+
10+
entrypoint: main_agent
11+
12+
main_agent:
13+
name: main_agent
14+
type: IterativeAgentWithTool
15+
max_turns: 30
16+
17+
llm:
18+
_base_: config/llm/base_openai.yaml
19+
provider_class: GPT5OpenAIClient
20+
model_name: gpt-5
21+
max_tokens: 128000
22+
reasoning_effort: medium
23+
24+
prompt: config/prompts/standard_prompt_main_agent.yaml
25+
26+
tools:
27+
- config/tool/tool-reading.yaml
28+
# - config/tool/tool-python.yaml
29+
# - config/tool/tool-search-and-scrape-webpage.yaml
30+
# - config/tool/tool-jina-scrape-llm-summary.yaml
31+
#- config/tool/tool-code.yaml
32+
#- config/tool/tool-image-video.yaml
33+
# - config/tool/tool-audio.yaml # Uncomment for audio processing
34+
35+
input_processor:
36+
- ${input-message-generator}
37+
38+
output_processor:
39+
- ${output-summary}
40+
- ${output-boxed-extractor}
41+
42+
# Input processor: generates initial message from task description
43+
input-message-generator:
44+
type: InputMessageGenerator
45+
46+
# Output processor: summarizes conversation
47+
output-summary:
48+
type: SummaryGenerator
49+
50+
# Output processor: extracts final answer in a boxed format
51+
output-boxed-extractor:
52+
type: RegexBoxedExtractor
53+
54+
# Output directory for logs
55+
output_dir: logs
56+
data_dir: "${oc.env:DATA_DIR,data}"
57+
58+
benchmark:
59+
exceed_max_turn_summary: false
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# MiroFlow Gradio Demo Configuration
2-
# A simplified configuration for the Gradio web interface (using MiroThinker)
1+
# MiroFlow Web Demo Configuration
2+
# A simplified configuration for the web interface (using MiroThinker)
33

44
# No benchmark defaults - this is a standalone config
55
defaults:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
defaults:
2+
- benchmark: gaia-validation-165
3+
- override hydra/job_logging: none
4+
- _self_
5+
6+
entrypoint: main_agent
7+
main_agent:
8+
name: main_agent
9+
type: IterativeAgentWithToolAndRollback
10+
max_consecutive_rollbacks: 3
11+
max_turns: 200
12+
llm:
13+
_base_: config/llm/base_mirothinker.yaml
14+
prompt: config/prompts/binwang_prompt_main_agent_0128.yaml
15+
tools:
16+
- config/tool/tool-python.yaml
17+
- config/tool/tool-search-and-scrape-webpage.yaml
18+
- config/tool/tool-jina-scrape-llm-summary.yaml
19+
- config/tool/tool-reading.yaml
20+
- config/tool/tool-audio.yaml
21+
- config/tool/tool-image-video.yaml
22+
tool_blacklist:
23+
- server: "tool-search-and-scrape-webpage"
24+
tool: "sogou_search"
25+
- server: "tool-python"
26+
tool: "download_file_from_sandbox_to_local"
27+
input_processor:
28+
- ${file-content-preprocessor}
29+
- ${input-message-generator}
30+
output_processor:
31+
- ${output-summary}
32+
- ${output-boxed-extractor}
33+
- ${output-exceed-max-turn-summary}
34+
35+
file-content-preprocessor:
36+
type: FileContentPreprocessor
37+
input-message-generator:
38+
type: InputMessageGenerator
39+
output-summary:
40+
type: SummaryGenerator
41+
output-boxed-extractor:
42+
type: RegexBoxedExtractor
43+
output-exceed-max-turn-summary:
44+
type: ExceedMaxTurnSummaryGenerator
45+
prompt: config/prompts/binwang_prompt_main_agent_0128.yaml
46+
llm:
47+
_base_: config/llm/base_mirothinker.yaml
48+
49+
output_dir: logs/
50+
data_dir: "${oc.env:DATA_DIR,data}"
51+
52+
benchmark:
53+
exceed_max_turn_summary: true
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
defaults:
2+
- benchmark: gaia-validation-text-only
3+
- override hydra/job_logging: none
4+
- _self_
5+
6+
entrypoint: main_agent
7+
main_agent:
8+
name: main_agent
9+
type: IterativeAgentWithToolAndRollback
10+
# max_consecutive_rollbacks: 3
11+
# max_turns: 200
12+
llm:
13+
_base_: config/llm/base_mirothinker.yaml
14+
prompt: config/prompts/standard_prompt_main_agent.yaml
15+
tools: null
16+
input_processor:
17+
- ${input-message-generator}
18+
output_processor:
19+
- ${output-summary}
20+
- ${output-boxed-extractor}
21+
- ${output-exceed-max-turn-summary}
22+
sub_agents:
23+
agent-worker: ${agent-worker}
24+
25+
agent-worker:
26+
type: IterativeAgentWithTool
27+
name: agent-worker
28+
max_consecutive_rollbacks: 3
29+
max_turns: 200
30+
llm:
31+
_base_: config/llm/base_mirothinker.yaml
32+
prompt: config/prompts/prompt_sub_agent.yaml
33+
tools:
34+
- config/tool/tool-python.yaml
35+
- config/tool/tool-search-and-scrape-webpage.yaml
36+
- config/tool/tool-jina-scrape-llm-summary.yaml
37+
tool_blacklist:
38+
- server: "tool-search-and-scrape-webpage"
39+
tool: "sogou_search"
40+
- server: "tool-python"
41+
tool: "download_file_from_sandbox_to_local"
42+
input_processor:
43+
- ${input-message-generator}
44+
output_processor:
45+
- ${output-summary}
46+
47+
48+
49+
50+
input-message-generator:
51+
type: InputMessageGenerator
52+
output-summary:
53+
type: SummaryGenerator
54+
output-boxed-extractor:
55+
type: RegexBoxedExtractor
56+
output-exceed-max-turn-summary:
57+
type: ExceedMaxTurnSummaryGenerator
58+
prompt: config/prompts/standard_prompt_main_agent.yaml
59+
llm:
60+
_base_: config/llm/base_mirothinker.yaml
61+
62+
output_dir: logs/
63+
data_dir: "${oc.env:DATA_DIR,data}"
64+
65+
benchmark:
66+
exceed_max_turn_summary: true

0 commit comments

Comments
 (0)