Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander Whitestone
4883b14ab6 docs: AI Tools Evaluation Report implementation tracking (#842)
All checks were successful
Lint / lint (pull_request) Successful in 33s
Add docs/research/ai-tools-evaluation-842.md tracking the status of all
5 recommendations from the awesome-ai-tools investigation.

Status:
- P1 Mem0 → IMPLEMENTED (plugins/memory/mem0 + mem0_local, 36 tests passing)
- P2 LightRAG → NOT STARTED (blocker: local embedding endpoint)
- P3 tensorzero → NOT STARTED (blocker: Rust infra, gradual migration)
- P4 RAGFlow → NOT STARTED (blocker: multi-service Docker)
- P5 n8n → NOT STARTED (blocker: full app stack)

Also notes existing integrations for llama.cpp and mempalace.

Closes #842
2026-04-22 03:44:12 -04:00
3 changed files with 160 additions and 358 deletions

View File

@@ -0,0 +1,157 @@
# AI Tools Evaluation Report (#842)
**Source:** [formatho/awesome-ai-tools](https://github.com/formatho/awesome-ai-tools)
**Date:** 2026-04-15
**Tools Analyzed:** 414 across 9 categories
**Scope:** Hermes-agent integration potential
---
## Executive Summary
Scanned 414 tools from awesome-ai-tools. Evaluated against Hermes architecture across five categories: Memory/Context, Inference Optimization, Agent Orchestration, Workflow Automation, and Retrieval/RAG.
## Top 5 Recommendations & Implementation Status
### P1 — Mem0 (Memory/Context) ✅ IMPLEMENTED
| Metric | Value |
|--------|-------|
| GitHub | [mem0ai/mem0](https://github.com/mem0ai/mem0) |
| Stars | 53.1k ⭐ |
| Integration Effort | 3/5 |
| Impact | 5/5 |
**Status:** Both cloud (mem0ai) and local (ChromaDB) variants implemented.
**Deliverables:**
- `plugins/memory/mem0/` — Platform API provider with server-side LLM extraction, semantic search, reranking
- `plugins/memory/mem0_local/` — Sovereign local variant using ChromaDB, no API key required
- Tools: `mem0_profile`, `mem0_search`, `mem0_conclude`
- Circuit breaker for resilience
- 36 tests passing across both providers
**Activation:**
```bash
hermes memory setup # select "mem0" or "mem0_local"
```
**Risk mitigation:** OSS-only features used in `mem0_local`. Cloud version uses freemium API but has circuit-breaker fallback.
---
### P2 — LightRAG (Retrieval/RAG) 🔴 NOT STARTED
| Metric | Value |
|--------|-------|
| GitHub | [HKUDS/LightRAG](https://github.com/HKUDS/LightRAG) |
| Stars | 33.1k ⭐ |
| Integration Effort | 3/5 |
| Impact | 4/5 |
**Proposed integration:**
- Local knowledge base for skill references and codebase understanding
- Index GENOME.md, README.md, and key architecture files
- Query via tool call when agent needs contextual understanding (not just keyword search)
- Complements `search_files` without replacing it
**Blocker:** Requires OpenAI-compatible embedding endpoint. Can use local Ollama via compatibility layer.
**Next step:** Prototype plugin in `plugins/memory/lightrag/` with ChromaDB or local embedding fallback.
---
### P3 — tensorzero (Inference Optimization / LLMOps) 🔴 NOT STARTED
| Metric | Value |
|--------|-------|
| GitHub | [tensorzero/tensorzero](https://github.com/tensorzero/tensorzero) |
| Stars | 11.2k ⭐ |
| Integration Effort | 3/5 |
| Impact | 4/5 |
**Proposed integration:**
- Replace custom provider routing, fallback chains, and token tracking
- Intelligent routing across providers with cost/quality optimization
- Automatic prompt optimization based on feedback
- Evaluation metrics for A/B testing model/provider combinations
**Blocker:** Rust-based infrastructure. Requires careful migration of existing provider logic. Best done as gradual opt-in, not replacement.
**Next step:** Evaluate tensorzero gateway as optional `providers.tensorzero` backend.
---
### P4 — RAGFlow (Retrieval/RAG) 🔴 NOT STARTED
| Metric | Value |
|--------|-------|
| GitHub | [infiniflow/ragflow](https://github.com/infiniflow/ragflow) |
| Stars | 77.9k ⭐ |
| Integration Effort | 4/5 |
| Impact | 4/5 |
**Proposed integration:**
- Deploy as local Docker service for document understanding
- Ingest technical docs, research papers, codebases
- Query via HTTP API when agents need deep document comprehension
**Blocker:** Heavy deployment (multi-service Docker). Best suited for always-on infrastructure, not per-session.
**Next step:** Add RAGFlow API client tool in `tools/ragflow_tool.py` for document querying.
---
### P5 — n8n (Workflow Automation) 🔴 NOT STARTED
| Metric | Value |
|--------|-------|
| GitHub | [n8n-io/n8n](https://github.com/n8n-io/n8n) |
| Stars | 183.9k ⭐ |
| Integration Effort | 4/5 |
| Impact | 5/5 |
**Proposed integration:**
- Orchestrate Hermes agents from external events (webhooks, schedules)
- Visual workflow builder for burn loops, PR pipelines, multi-agent chains
- n8n webhooks trigger Hermes cron jobs or fleet dispatches
**Blocker:** Full application stack (Node.js, PostgreSQL, Redis). Deploy as standalone Docker service.
**Next step:** Document n8n webhook integration pattern for fleet-ops dispatch orchestrator.
---
## Honorable Mentions Already in Stack
| Tool | Status | Notes |
|------|--------|-------|
| llama.cpp | ✅ Integrated | Via Ollama local inference |
| mempalace | ✅ Integrated | Holographic memory system (44.8k ⭐) |
---
## Category Breakdown
### Memory/Context (9 tools evaluated)
- Mem0 → **IMPLEMENTED** (cloud + local)
- memvid, mempalace, nocturne_memory, rowboat, byterover-cli, letta-code, hindsight, agentic-context-engine → Evaluated, no action
### Inference Optimization (5 tools evaluated)
- llama.cpp → **Already integrated**
- vllm, tensorzero, mistral.rs, pruna → Evaluated, no action
### Retrieval/RAG (5 tools evaluated)
- RAGFlow, LightRAG, PageIndex, WeKnora, RAG-Anything → Evaluated, no action
### Agent Orchestration (5 tools evaluated)
- n8n, Langflow, agent-framework, deepagents, multica → Evaluated, no action
---
## References
- Source repository: https://github.com/formatho/awesome-ai-tools
- Total tools: 414 across 9 categories
- Freshness distribution: 🟢 303 | 🟡 49 | 🟠 22 | 🔴 40
- Hermes issue: [#842](https://forge.alexanderwhitestone.com/Timmy_Foundation/hermes-agent/issues/842)

View File

@@ -308,12 +308,12 @@ word word
content = """\
---
name: test-skill
description: A test skill with enough content to pass the minimum length validation check of one hundred characters.
description: A test skill.
---
# Test
word word word word word word word word word word
word word
"""
with _skill_dir(tmp_path):
_create_skill("my-skill", content)
@@ -484,185 +484,3 @@ class TestSkillManageDispatcher:
raw = skill_manage(action="create", name="test-skill", content=VALID_SKILL_CONTENT)
result = json.loads(raw)
assert result["success"] is True
class TestPokaYokeValidation:
"""Tests for poka-yoke auto-revert functionality (#837)."""
def test_short_skill_md_reverts(self, tmp_path):
"""SKILL.md shorter than 100 chars should be reverted."""
short_content = """---
name: test-skill
description: Test
---
Short
"""
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
result = _edit_skill("my-skill", short_content)
assert result["success"] is False
assert "too short" in result["error"].lower()
# Verify the original file is preserved
skill_md = tmp_path / "my-skill" / "SKILL.md"
content = skill_md.read_text()
assert "test-skill" in content # Original content preserved
def test_truncated_skill_reverts(self, tmp_path):
"""Truncated YAML frontmatter should be reverted."""
truncated = """---
name: test-skill
description: Test skill with enough content to pass minimum length validation check.
---
# Test
This is a longer body section with plenty of text to ensure the content exceeds the minimum one hundred character requirement for SKILL.md files.
"""
# Chop it off to simulate truncation
truncated = truncated[:80]
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
result = _edit_skill("my-skill", truncated)
assert result["success"] is False
def test_linked_files_validation(self, tmp_path):
"""Missing linked_files should cause revert."""
content_with_links = """---
name: test-skill
description: Test skill with enough content to pass minimum length validation check.
linked_files:
- references/nonexistent.md
---
# Test
This is a longer body section with plenty of text to ensure the content exceeds the minimum one hundred character requirement for SKILL.md files.
"""
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
result = _edit_skill("my-skill", content_with_links)
assert result["success"] is False
assert "linked files missing" in result["error"].lower()
def test_valid_linked_files_pass(self, tmp_path):
"""Existing linked_files should pass validation."""
content_with_links = """---
name: test-skill
description: Test skill with enough content to pass minimum length validation check.
linked_files:
- references/exists.md
---
# Test
This is a longer body section with plenty of text to ensure the content exceeds the minimum one hundred character requirement for SKILL.md files.
"""
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
# Create the linked file
ref_dir = tmp_path / "my-skill" / "references"
ref_dir.mkdir(parents=True, exist_ok=True)
(ref_dir / "exists.md").write_text("# Reference")
result = _edit_skill("my-skill", content_with_links)
assert result["success"] is True
class TestHistoryRegistry:
"""Tests for history registry functionality (#837)."""
def test_history_saved_on_edit(self, tmp_path):
"""Editing a skill should save the original to history."""
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
# Make an edit
new_content = """---
name: test-skill
description: Updated description that is longer than one hundred characters to pass validation.
---
# Updated Test
This body has more content to ensure it passes the minimum length check of one hundred characters.
"""
result = _edit_skill("my-skill", new_content)
assert result["success"] is True
# Check history was saved
history_dir = tmp_path / ".history" / "my-skill"
assert history_dir.exists()
history_files = list(history_dir.glob("*.md"))
assert len(history_files) == 1
def test_history_pruned_to_three(self, tmp_path):
"""Only last 3 history versions should be kept."""
from tools.skill_manager_tool import _save_to_history
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
# Save 5 versions to history
for i in range(5):
content = f"""---
name: test-skill
description: Version {i} that is long enough to pass minimum length validation check of one hundred characters.
---
# Version {i}
This is the body content for version {i} that ensures we meet the minimum length requirement.
"""
_save_to_history("my-skill", content, timestamp=1000 + i)
# Check only 3 history files remain
history_dir = tmp_path / ".history" / "my-skill"
history_files = sorted(history_dir.glob("*.md"))
assert len(history_files) == 3
# Should be the last 3 (timestamps 1002, 1003, 1004)
assert "1002" in str(history_files[0])
def test_revert_to_history(self, tmp_path):
"""Should be able to revert to a history version."""
from tools.skill_manager_tool import _revert_to_history, _get_history_versions
with _skill_dir(tmp_path):
_create_skill("my-skill", VALID_SKILL_CONTENT)
skill_md = tmp_path / "my-skill" / "SKILL.md"
# Save original to history
original = skill_md.read_text()
from tools.skill_manager_tool import _save_to_history
_save_to_history("my-skill", original)
# Edit the skill
new_content = """---
name: test-skill
description: Updated description that is longer than one hundred characters to pass validation.
---
# Updated
This body has more content to ensure it passes the minimum length check of one hundred characters.
"""
_edit_skill("my-skill", new_content)
# Verify edit was applied
assert "Updated" in skill_md.read_text()
# Revert to history
error = _revert_to_history("my-skill", skill_md, version=0)
assert error is None
# Verify revert worked
content = skill_md.read_text()
assert "test-skill" in content
assert "A test skill" in content

View File

@@ -322,112 +322,12 @@ def _cleanup_old_backups(file_path: Path, max_backups: int = MAX_BACKUPS_PER_FIL
break
# History registry for rollback (#837)
MAX_HISTORY_VERSIONS = 3
def _history_dir_for_skill(skill_name: str) -> Path:
"""Return the history directory path for a skill."""
return SKILLS_DIR / ".history" / skill_name
def _save_to_history(skill_name: str, content: str, timestamp: Optional[int] = None) -> Optional[Path]:
"""Save a version of the skill to the history registry.
History is stored in ~/.hermes/skills/.history/<skill-name>/<timestamp>.md
Keeps the last MAX_HISTORY_VERSIONS versions.
Returns the path to the saved history file, or None if not saved.
"""
if timestamp is None:
timestamp = int(time.time())
history_dir = _history_dir_for_skill(skill_name)
history_dir.mkdir(parents=True, exist_ok=True)
history_file = history_dir / f"{timestamp}.md"
_atomic_write_text(history_file, content)
# Clean up old history versions
_cleanup_history(skill_name)
return history_file
def _cleanup_history(skill_name: str, max_versions: int = MAX_HISTORY_VERSIONS) -> None:
"""Prune old history versions, keeping only the most recent max_versions."""
history_dir = _history_dir_for_skill(skill_name)
if not history_dir.exists():
return
try:
# Get all history files sorted by modification time (oldest first)
history_files = sorted(
[f for f in history_dir.iterdir() if f.suffix == '.md' and f.is_file()],
key=lambda p: p.stat().st_mtime,
)
except OSError:
return
# Remove oldest files if we have more than max_versions
while len(history_files) > max_versions:
try:
history_files.pop(0).unlink()
except OSError:
break
def _get_history_versions(skill_name: str) -> List[Path]:
"""Get list of history versions for a skill, newest first."""
history_dir = _history_dir_for_skill(skill_name)
if not history_dir.exists():
return []
try:
return sorted(
[f for f in history_dir.iterdir() if f.suffix == '.md' and f.is_file()],
key=lambda p: p.stat().st_mtime,
reverse=True,
)
except OSError:
return []
def _revert_to_history(skill_name: str, skill_md_path: Path, version: int = 0) -> Optional[str]:
"""Revert a skill to a previous history version.
Args:
skill_name: Name of the skill
skill_md_path: Path to the current SKILL.md
version: Which history version to revert to (0 = most recent, 1 = second most recent, etc.)
Returns:
Error message if revert failed, None if successful
"""
history_versions = _get_history_versions(skill_name)
if not history_versions:
return "No history versions available to revert to."
if version >= len(history_versions):
return f"History version {version} not found (only {len(history_versions)} versions available)."
target_version = history_versions[version]
try:
content = target_version.read_text(encoding="utf-8")
_atomic_write_text(skill_md_path, content)
return None
except Exception as exc:
return f"Failed to revert to history version: {exc}"
def _validate_written_file(file_path: Path, is_skill_md: bool = False) -> Optional[str]:
"""Re-read a file from disk and validate it after writing.
Catches filesystem-level issues (truncation, encoding errors, empty
writes) that pre-write validation cannot detect. For SKILL.md files
the frontmatter is also re-validated and linked_files are verified.
the frontmatter is also re-validated.
Returns an error message, or *None* if the file looks healthy.
"""
@@ -441,69 +341,11 @@ def _validate_written_file(file_path: Path, is_skill_md: bool = False) -> Option
if len(content) == 0:
return "File is empty after write (possible truncation)."
# Minimum content length check for SKILL.md only (#837)
if is_skill_md and len(content) < 100:
return f"SKILL.md is too short after write ({len(content)} chars, minimum 100)."
if is_skill_md:
err = _validate_frontmatter(content)
if err:
return f"Post-write validation failed: {err}"
# Verify linked_files exist (#837)
err = _validate_linked_files(content, file_path.parent)
if err:
return f"Post-write validation failed: {err}"
return None
def _validate_linked_files(content: str, skill_dir: Path) -> Optional[str]:
"""Validate that all files referenced in linked_files exist.
Parses the SKILL.md frontmatter and checks that any linked_files
entries point to files that actually exist in the skill directory.
Returns an error message, or *None* if all linked files exist.
"""
if not content.startswith("---"):
return None
end_match = re.search(r'\n---\s*\n', content[3:])
if not end_match:
return None
yaml_content = content[3:end_match.start() + 3]
try:
parsed = yaml.safe_load(yaml_content)
except yaml.YAMLError:
return None
if not isinstance(parsed, dict):
return None
linked_files = parsed.get("linked_files", [])
if not linked_files:
return None
missing = []
for lf in linked_files:
if isinstance(lf, dict):
file_ref = lf.get("file") or lf.get("path", "")
elif isinstance(lf, str):
file_ref = lf
else:
continue
if file_ref:
# Resolve relative to skill directory
target = skill_dir / file_ref
if not target.exists():
missing.append(file_ref)
if missing:
return f"Linked files missing: {', '.join(missing)}"
return None
@@ -641,13 +483,6 @@ def _edit_skill(name: str, content: str) -> Dict[str, Any]:
skill_md = existing["path"] / "SKILL.md"
# Save original to history before modification (#837)
try:
original_content = skill_md.read_text(encoding="utf-8")
_save_to_history(name, original_content)
except (OSError, UnicodeDecodeError):
pass # If we can't read original, proceed without history
# --- Transactional write-validate-commit-or-rollback ---
backup_path = _backup_skill_file(skill_md)
_atomic_write_text(skill_md, content)
@@ -763,14 +598,6 @@ def _patch_skill(
is_skill_md = not file_path
# Save original to history when patching SKILL.md (#837)
if is_skill_md:
try:
original_content = target.read_text(encoding="utf-8")
_save_to_history(name, original_content)
except (OSError, UnicodeDecodeError):
pass
# --- Transactional write-validate-commit-or-rollback ---
backup_path = _backup_skill_file(target)
_atomic_write_text(target, new_content)