Batch Processing — Handle Many Tasks at Once
Batch Processing — Handle Many Tasks at Once — easy-to-understand guide based on official docs
You wouldn’t reply to a thousand emails one by one if you could hand the whole inbox to a tireless assistant who writes every response, logs every decision, and hands you a neat report when it’s done. That’s exactly what batch processing does for you with Hermes Agent.
What It Does
Batch processing lets you throw hundreds or thousands of questions at Hermes Agent in one go. The agent works through each item in its own fresh session, uses tools like search or calculators when needed, and automatically records the entire journey — every thought, every tool call, every final answer. It’s like sending a stack of work orders to a factory floor and getting back a detailed log of how each one was handled.
The Core Idea
- Input: A
.jsonlfile — each line is one JSON object containing a prompt or instruction. - Processing: Each prompt starts a separate AI session. The agent can call tools to solve the problem, just like it would in a normal conversation.
- Output: A structured “trajectory” file that captures the agent’s reasoning steps, tool usage, final responses, and useful stats (e.g., how many tools were called per task).
Three Steps to Get Started
Step 1: Prepare Your Questions
Create a .jsonl file where each line is one question. For example:
{"prompt": "Calculate 25 * 4"}
{"prompt": "Write a short poem about autumn"}
{"prompt": "Summarize the basics of quantum computing"}
Make sure there are no extra commas or brackets — each line must be a valid JSON object on its own.
Step 2: Run the Batch Command
Open your terminal and run:
python batch_runner.py --input my_questions.jsonl --output results.jsonl
That’s it. Hermes will process every line in the file automatically.
Step 3: Check the Results
When it finishes, you’ll have a results.jsonl file. Each line corresponds to one of your original prompts and includes:
- The full conversation history
- Details of every tool call (which tool, what it returned)
- Statistics like reasoning step coverage and tool usage frequency
Why You Should Care
- Save Time: No more running tasks one by one. Run a hundred or a thousand at once.
- Build a Data Goldmine: The output is perfect for fine-tuning AI models or evaluating how well the agent performs.
- Reproducible: Every run leaves a complete record, so you can compare different configurations and improve over time.
Practical Tips
Start small. Run a test batch with just 10 questions to confirm the output format matches what you expect. Then scale up to 1000. If something fails, check the error log — it’s almost always a formatting issue in your input file.
Wrapping Up
Batch processing turns repetitive work into a single command and transforms raw results into valuable data. Whether you’re training a custom AI or stress-testing an agent at scale, this feature saves you hours. Next time you have a mountain of tasks, don’t sweat it — just batch it.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › user-guide/features