Skip to main content

HB-Eval SDK for reliable agent evaluation, semantic memory, and LangChain/LangGraph integration

Project description

HB-Eval SDK

Secure Python SDK for HB-Eval Reliability OS — the first cognitive runtime for evaluating and ensuring AI agent reliability.

Features

  • AES-256-GCM encrypted payloads for all API communication
  • HMAC-SHA256 request signing with replay-attack protection
  • Safe Halt protocol — automatic failure handling on connection loss
  • Semantic memory retrieval for agent context
  • Native LangChain / LangGraph callback integration

Installation

pip install hb-eval-sdk

Quick Start

from hb_eval_sdk import HBEvalClient

client = HBEvalClient(
    api_key="your_api_key",
    aes_key="your_base64_encoded_32byte_aes_key",
)

result = client.evaluate({
    "trajectory": [{"step": 1, "action": "query_memory", "input": "..."}],
    "sub_tasks": 1,
    "constraint_violations": 0,
    "recovery_attempts": 1,
    "context": "my agent task",
    "agent_id": "my-agent",
})

print(result.verdict)      # Verdict.SAFE or Verdict.UNSAFE
print(result.metrics.pei)  # float
print(result.metrics.irs)  # float

Memory Retrieval

matches = client.retrieve_memory(context="my task context")
for match in matches:
    print(match.trajectory_summary, match.similarity)

LangChain Integration

from hb_eval_sdk import HBEvalCallback

callback = HBEvalCallback(
    api_key="your_api_key",
    aes_key="your_base64_encoded_32byte_aes_key",
)

# Pass the callback to your LangChain agent
agent.invoke({"input": "..."}, config={"callbacks": [callback]})

Exception Handling

from hb_eval_sdk import (
    HBEvalError,
    AuthenticationError,
    EncryptionError,
    SafeHaltError,
    ConnectionError,
)

try:
    result = client.evaluate({...})
except SafeHaltError as e:
    print(f"Safe halt triggered: {e.reason}")
except AuthenticationError as e:
    print(f"Auth failed: {e}")
except ConnectionError as e:
    print(f"Connection error: {e}")

Requirements

  • Python >= 3.8
  • requests >= 2.28.0
  • cryptography >= 41.0.0
  • pydantic >= 2.0.0
  • langchain-core >= 0.1.0
  • langgraph >= 0.0.10

Documentation

Full documentation: https://hb-eval.readthedocs.io

License

MIT License — Copyright (c) 2026 Abuelgasim Mohamed Ibrahim Adam

Project details


Download files

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

Source Distribution

hb_eval_sdk-2.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

hb_eval_sdk-2.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file hb_eval_sdk-2.0.0.tar.gz.

File metadata

  • Download URL: hb_eval_sdk-2.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for hb_eval_sdk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a86593dd51a9d9729acb3fb34bd394a491d474d95444e7615c3b4f00424d311c
MD5 882b2d2523de2817cbb18be8daf71da4
BLAKE2b-256 859cb4e60a4e15768c091de92721c650b48684f0f21dfaf95ea2c04e44aa709a

See more details on using hashes here.

File details

Details for the file hb_eval_sdk-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: hb_eval_sdk-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for hb_eval_sdk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bd766654bd916510a143a8c903a0912e2b59a5cb9e1cba9955d1cbd47d64f6a
MD5 8c8cc81e33c4eebfbbcaa89babc7c954
BLAKE2b-256 cc9069bd80c7b71378fd60b14edee7abdab1405bee45054e8429a72151eed665

See more details on using hashes here.

Supported by

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