Core Tools and Tool Execution
Relevant source files
The following files were used as context for generating this wiki page:
Hermes Agent employs a set of core tools to interact with the environment, manage skills, and process information. These tools enable the agent to perform actions such as terminal execution, file manipulation, and complex knowledge base management. The system executes these tools through a standardized interface that ensures predictability and consistency across different tasks, from codebase documentation to financial analysis.
Tool execution follows hardline standards to maintain security and privacy. For example, the agent never writes machine-local paths or leaks host identity into generated artifacts. It prioritizes using wrapped tools like read_file or search_files over raw shell commands to maintain a controlled execution environment.
Sources: optional-skills/software-development/code-wiki/SKILL.md:15-18, skills/software-development/hermes-agent-skill-authoring/SKILL.md:112-118, agent/learn_prompt.py:46-52
Tool Registry and Categories
The agent organizes tools into specific categories based on their function. These tools are the primary mechanism for the agent to affect the system and retrieve data.
| Tool Name | Purpose | Recommended Usage |
|---|---|---|
terminal | Executes shell commands and scripts | Run project-specific CLIs or scripts |
read_file | Reads content from a specific file path | Inspection and context gathering |
write_file | Writes or overwrites content to a file | Creating new artifacts or logs |
patch | Applies targeted edits to existing files | Small modifications to skills or code |
search_files | Finds files or symbols using patterns | Locating manifests or specific code blocks |
skill_manage | Manages the lifecycle of agent skills | Creating, patching, or viewing skills |
web_extract | Scrapes content from URLs or PDFs | Research and data ingestion |
Sources: optional-skills/software-development/code-wiki/SKILL.md:20-22, skills/software-development/hermes-agent-skill-authoring/SKILL.md:113-118, agent/learn_prompt.py:73-81
Tool Execution Flow
The agent follows a structured sequence when executing tasks. It uses an "Inspect First" philosophy to gather context before modifying the environment.
General Execution Pattern
The diagram shows the iterative loop the agent uses to ensure technical accuracy by verifying the environment state before and after actions.
Sources: optional-skills/software-development/code-wiki/SKILL.md:46-75, skills/research/llm-wiki/SKILL.md:213-248
Skill Authoring Workflow
When creating new capabilities via the /learn command, the agent follows a specific protocol to ensure the generated SKILL.md meets hardline standards.
This sequence illustrates the division of labor between source gathering and the persistence of the learned skill.
Sources: agent/learn_prompt.py:128-145, skills/software-development/hermes-agent-skill-authoring/SKILL.md:173-195
Progressive Context Discovery
Hermes Agent automatically loads context files like AGENTS.md or .hermes.md to shape its behavior. During tool execution, the system dynamically discovers new context as the agent navigates into subdirectories.
- Path Extraction: The system extracts file paths from tool parameters like
pathorworkdir. - Ancestor Traversal: The system checks the target directory and up to 5 parent levels for context files.
- Security Scanning: The tracker scans discovered files for prompt injection patterns before injection.
- Injection: The system appends truncated content to tool results to provide "hints" to the model.
Knowledge Base Management Tools
For large research tasks, the agent uses the llm-wiki skill to maintain a persistent knowledge base. This utilizes a tiered architecture to separate raw sources from synthesized knowledge.
- Layer 1 (Raw): Immutable source material stored in
raw/folders. The agent reads these but never modifies them. - Layer 2 (Wiki): Agent-owned markdown files (
entities/,concepts/) updated throughwrite_file. - Layer 3 (Schema):
SCHEMA.mddefines the rules and tag taxonomy for the wiki.
The diagram shows how the SCHEMA.md acts as a constraint on tool operations like Ingest and Lint to maintain consistency.
Sources: skills/research/llm-wiki/SKILL.md:52-70
Hardline Execution Standards
The project enforces strict constraints on how tools are invoked and how data is written:
- No Generic Prose: Tool outputs must be technical and specific; generic AI filler is prohibited.
- No Fabricated Paths: The agent must call
read_fileorsearch_filesto verify a path exists before claiming its existence in documentation. - Privacy Preservation: The agent must not fill
authorfields in skills from host environment probes (e.g., git config). It uses the literal valueHermes. - Framing: Instructions must frame actions through Hermes tools (e.g., "invoke through the
terminaltool") rather than raw shell commands.
Sources: optional-skills/software-development/code-wiki/SKILL.md:255-265, skills/software-development/hermes-agent-skill-authoring/SKILL.md:70-76, agent/learn_prompt.py:46-60
Conclusion
Core tools and their execution in Hermes Agent are centered on predictability, security, and verified context. By utilizing a standardized tool registry and following multi-step execution flows, the agent can perform complex tasks—such as building self-documenting wikis or authoring its own skills—while adhering to strict project standards that prevent hallucinations and protect user privacy.