Skip to main content

This package installs harny.

Harny Python SDK

Harny gives each person your app's AI serves a private memory that keeps up when facts change. This package is the Python client: ingest timestamped text, check its status, delete it when required, and recall current facts with evidence.

#1 on BEAM at 128K tokens, the public benchmark for long-term memory in agents. Results and methodology

Documentation: Quickstart · Memory API overview

Installation

pip install harny

Requires Python 3.10+.

Key

Sign up at console.harny.ai and create an app key, or run harny init in your project folder and the key is saved to .env. The client reads it from HARNY_API_KEY.

Quickstart

from harny import SyncHarnyClient

with SyncHarnyClient() as harny:  # reads HARNY_API_KEY
    harny.provision_user("demo-user", "demo@example.com")  # add each person once; repeating it is safe
    receipt = harny.ingest_data_point(
        "Budget for the Acme pilot moved to 40k.",
        timestamp="2026-07-28T16:00:00Z",
        user="demo-user",
    )
    harny.wait_for_ingestion(receipt.ingestionId, user="demo-user")
    page = harny.recall("What is the Acme pilot budget?", user="demo-user")
    print(page.results[0].content)

user names the person; each recall returns that person's memory and nothing from anyone else's. HarnyClient is the async client: async with HarnyClient() as harny: and await each call.

The same calls from the command line: harny ingest "<fact>" --user <id> and harny query "<question>" --user <id>.

Methods

  • ingest_data_point — send one fact with the time it happened. The same id with changed text replaces the old memory.
  • ingest_batch — send 1 to 1,000 facts at once.
  • get_ingestion / wait_for_ingestion — processing, completed or failed. nothingNew is true when the send added nothing new.
  • recall — ranked, dated facts for a question; level (low to extra-high) or max_tokens sets how much comes back.
  • delete_data_point, delete_data_points, delete_ingestion — remove a fact, or a whole send, and the memories that rest only on it.
  • get_usage — this month's usage for the app.

For agents, the client also has provision_user, assemble_context, record_action and list_actions. See the agent harness overview.

Errors

from harny import HarnyAPIError, HarnyConnectionError

try:
    page = harny.recall("What is the Acme pilot budget?", user="demo-user")
except HarnyConnectionError:
    ...  # nothing reached Harny; retry
except HarnyAPIError as e:
    print(e.status_code, e.error_code, e.recovery_hint, e.retry_after_s)

Where next

License

Apache-2.0.

Metadata

Release files for harny-ai 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harny-ai 0.1.2
File Size Uploaded Provenance Actions
harny_ai-0.1.2.tar.gz 6.8 kB Without provenance Details for harny_ai-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harny-ai 0.1.2
File Interpreter ABI Platform Actions
harny_ai-0.1.2-py3-none-any.whl Python 3 none any Details for harny_ai-0.1.2-py3-none-any.whl

Total release size: 13.7 kB

Release files / harny_ai-0.1.2.tar.gz

Download URL harny_ai-0.1.2.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fe48af9d1fed4725376c1da71bb87c03f4e65997a2a7267fc14482265955120b
BLAKE2b-256 checksum
How to use checksums
a480f0cbc6f8bda098633da16aedc7eff2e5908f1fe2b053e9e6768dcdb60a54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / harny_ai-0.1.2-py3-none-any.whl

Download URL harny_ai-0.1.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b5b585fb6d3fc372976f923c41e651bcf317b3de37a15f4b6e8ca8c9d4c7fae
BLAKE2b-256 checksum
How to use checksums
d93deb5a8481cdd14e406d426ede946f74041a9b43f1122c7fa5727d10a6c035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for harny-ai 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page