Skip to main content

Behavioral intelligence for your LLM apps. Every AI should know who it's talking to.

Project description

Humane AI SDK

Behavioral intelligence layer for LLM applications. One line to make your AI emotionally aware, relationally continuous, and safety-gated.

Install

pip install humane-ai

Quick Start

from humane_ai import HumaneClient

client = HumaneClient(api_key="hx_your_key")

# Single message
response = client.process("user_123", "I need help with my order")
print(response.response)           # AI response shaped by behavioral context
print(response.user.mood)          # 0.35 — frustration detected
print(response.context.empathy)    # 0.95 — auto-increased
print(response.timing.delay_ms)    # 400  — faster for urgent user
print(response.safety.action)      # PROCEED

# Multi-turn (history auto-managed)
client.process("user_123", "My name is Sarah, I work at TechCorp")
r = client.process("user_123", "Do you remember my name?")
# AI responds: "Yes, you're Sarah from TechCorp"

# Check behavioral state
if response.user.is_frustrated:
    print("User needs extra care")

# Proactive triggers
if response.proactive:
    for event in response.proactive:
        print(f"TRIGGER: {event.trigger}{event.suggested_action}")

# Reading the analysis payload (mirrors the JS SDK exactly since 0.4.0)
a = response.analysis
if a:
    print(a.signal_magnitude)         # "normal" | "strong" | "pivot"
    print(a.mood_delta, a.energy_delta)
    for tg in a.triggers:
        print(f"  {tg.phrase}{tg.emotion} ({tg.polarity})")
    for reason in a.reasons:
        print(f"  why: {reason}")

# Safety detail
print(response.safety.action)         # PROCEED | HOLD | BLOCK
for m in response.safety.matched:
    print(f"  matched {m.phrase} ({m.category})")
print(response.safety.override)       # e.g. "combo_a_force_block" or None

# A/B experiment assignments for this request
for ex in response.experiments:
    print(f"{ex.experiment_name}: variant {ex.variant_name}")

# Streaming
for event in client.stream("user_123", "Explain how engines work"):
    if event["type"] == "token":
        print(event["data"]["content"], end="", flush=True)

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

humane_ai-0.3.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

humane_ai-0.3.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file humane_ai-0.3.1.tar.gz.

File metadata

  • Download URL: humane_ai-0.3.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for humane_ai-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d55e6f1736dfbb1de90905e9bb233478afec09a3024468f3d475d03666282ae7
MD5 e1e007f8958d3cd935d8a1bf301cfed3
BLAKE2b-256 817a83c0beaae5c6efe9ab784d4e9d960fb20aa2321b3fedae8c30004ce8d463

See more details on using hashes here.

Provenance

The following attestation bundles were made for humane_ai-0.3.1.tar.gz:

Publisher: publish.yml on amar-vaarak/humane-ai

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

File details

Details for the file humane_ai-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: humane_ai-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for humane_ai-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb77db7755c190dc77afeaa19b138f40e76e2a47d5b321dbbcaad7f564181b2f
MD5 a12ea6fb25dd63bf09ef524a7bc606ce
BLAKE2b-256 78780d81b6ade806b081d4679e253abcff92d424c15e4599cbdc7e0d5c8c8307

See more details on using hashes here.

Provenance

The following attestation bundles were made for humane_ai-0.3.1-py3-none-any.whl:

Publisher: publish.yml on amar-vaarak/humane-ai

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

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