Skip to main content

hermes-rubric

Evidence-first assessment for agent outputs and applications.

PyPI Python License: MIT CI

Hermes turns an artifact into cited evidence, dimension scores, honest coverage facts, and caller-controlled feedback. It measures and explains; your application decides what to do next.

from hermes_rubric import FeedbackPolicy, assess

result = assess(
    target=agent_output,
    intent="Answer accurately and support material claims with checkable evidence.",
    context=task_context,
    target_type="agent-output",
    backend="openai-sdk",
)

print(result.aggregate)
print(result.coverage.status)
print(result.feedback(FeedbackPolicy(minimum_score=7)).to_prompt())

The same call can sit inside LangChain, the OpenAI Agents SDK, Semantic Kernel, PydanticAI, a bespoke loop, a notebook, CI, or a plain Python service. Those frameworks are not core dependencies, and Hermes does not run an agent loop for you.

Install

The base package requires Python 3.10 or newer and PyYAML:

pip install hermes-rubric

For the example above, install the OpenAI extra and set OPENAI_API_KEY:

pip install "hermes-rubric[openai]"

You can instead use local Ollama, Claude Code, another built-in backend, or a backend plugin. Automatic selection checks authenticated Claude Code first, then local Ollama; cloud providers are always explicit opt-ins. See Backends.

One transaction, three evidence-first stages

Hermes keeps the measuring process separate from runtime policy:

  1. Synthesize a task-specific rubric, load a bundled deterministic template, or accept a caller-provided frozen rubric.
  2. Collect and validate citations for each dimension.
  3. Score only against accepted evidence, applying the existing hedge, no-evidence, and source-authority clamps.

The returned AssessmentResult has attribute access plus to_dict() and to_json(). Its JSON preserves the established CLI keys and adds a versioned schema and coverage report.

payload = result.to_dict()

assert payload["schema_version"] == "1.0"
print(payload["evidence_citations"])
print(payload["per_dim_scores"])
print(payload["receipt"])

The aggregate is a signal, not a verdict.

Choose the measuring stick

Synthesize from intent and context when the criteria should be task-specific:

result = assess(
    target=answer,
    intent="Evaluate whether this answer is accurate and well-supported.",
    context="The answer must distinguish observation from inference.",
    target_type="agent-output",
)

Reuse a frozen rubric when runs must share the same dimensions:

import json
from hermes_rubric import assess

with open("rubric.json") as handle:
    frozen_rubric = json.load(handle)

result = assess(target=answer, rubric=frozen_rubric)

Use a bundled deterministic artifact class for common publishing surfaces:

result = assess(target=readme_text, artifact_class="repo-readme")

Bundled classes are social-post, show-hn-post, linkedin-post, outreach-email, and repo-readme.

Coverage is part of the result

Version 1.1 uses the existing UTF-8-safe prefix strategy for evidence collection. The default target window is 8,000 bytes. Hermes reports coverage.status as complete or partial, includes visible and total byte facts when they are knowable, discloses directory source limits, and lists plain-language limitations.

if result.coverage.status == "partial":
    for limitation in result.coverage.limitations:
        print(limitation)

partial means relevant material may not have been inspected. It must not be translated into “the evidence is absent.” Full chunked retrieval is a later engine capability, not a v1.1 claim.

Feedback without hidden policy

Hermes distinguishes three next-step types:

  • quality_gap: inspected evidence supports a score below a threshold you supplied.
  • evidence_gap: accepted evidence is absent or hedged.
  • coverage_gap: the relevant material may not have been inspected.

No pass/fail threshold is built in. FeedbackPolicy(minimum_score=...) is caller policy, and to_prompt() only creates deterministic instructions—it never mutates a runtime or retries an agent. A coverage-only gap asks for wider inspection, not an automatic rewrite.

File and CLI workflows

Use assess_path() for a file or directory:

from hermes_rubric import assess_path

result = assess_path(
    "paper.md",
    intent="Evaluate publication readiness.",
    context_path="STYLE-GUIDE.md",
    target_type="paper",
)

The CLI is the equivalent file and automation surface:

hermes-rubric \
  --intent "Evaluate publication readiness" \
  --context STYLE-GUIDE.md \
  --target paper.md \
  --out result.json

Existing flags, output keys, and stage exit codes remain available. See the full CLI reference.

Async wrappers keep synchronous providers off the event loop:

from hermes_rubric import assess_async

result = await assess_async(answer, rubric=frozen_rubric)

They use asyncio.to_thread; cancellation cannot interrupt a provider call already running in its worker thread.

When to use Hermes

Use it when:

  • an agent or application needs cited, inspectable assessment rather than a raw judge score;
  • weak or missing evidence must remain visible;
  • the same assessment contract should work across different runtimes;
  • receipts and frozen rubrics matter for reviewing repeated runs.

Use a deterministic validator instead when the rule can be expressed exactly. Do not use Hermes as proof of factual truth, as a compliance certification, or as an automatic release decision. If the artifact is longer than the inspected window, review coverage before acting on missing evidence.

Documentation

Contributing

git clone https://github.com/hermes-labs-ai/hermes-rubric
cd hermes-rubric
pip install -e ".[dev]"
pytest

The adversarial tests in tests/test_adversarial.py are release gates. See CONTRIBUTING.md.

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_rubric-1.1.0.tar.gz (224.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_rubric-1.1.0-py3-none-any.whl (57.9 kB view details)

Uploaded Python 3

File details

Details for the file hermes_rubric-1.1.0.tar.gz.

File metadata

  • Download URL: hermes_rubric-1.1.0.tar.gz
  • Upload date:
  • Size: 224.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hermes_rubric-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0388ff2ec9bed70db4b1f058657e856a8578fb3d9bce13af366a8785d731667f
MD5 d4d7e847a4030c3185bad1067041f1bd
BLAKE2b-256 7e18d881180988530202c06c26f37c80b4f020305f3207c4831a792fdf4e46d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_rubric-1.1.0.tar.gz:

Publisher: publish.yml on hermes-labs-ai/hermes-rubric

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hermes_rubric-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: hermes_rubric-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hermes_rubric-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52c415e6df1e8c03d2afdb78f81b8fb0c738d3f1a21582a11d91cda30b402a2b
MD5 097485aa9dca6fc4ad82621d629ed4cf
BLAKE2b-256 ee030fc3c5456c68e338e0a4cbe196f7bf4837f22f814662345646047ce5f36e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hermes_rubric-1.1.0-py3-none-any.whl:

Publisher: publish.yml on hermes-labs-ai/hermes-rubric

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.1.1

2 files

This release

1.1.0 This release

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page