Skip to main content

gethaki

Python SDK for Haki — a long-term memory layer for AI agents. Every fact carries a date, a source and a status, so your agent uses what's true today and can prove it.

Install

pip install gethaki

Usage

from haki import HakiClient
from haki.runtime import build_prompt_context, capture_turn

client = HakiClient("http://localhost:8100")

# Before the LLM call: memory becomes an instruction block
packet = client.context(subject_id="usr_42", query=user_msg, project_id="prj")
prompt = build_prompt_context(packet) + "\n" + system_prompt

answer = my_llm(prompt, user_msg)  # your LLM call and app code stay unchanged

# After the LLM call: the conversation turn goes back into memory
capture_turn(client, "usr_42", "prj", user_msg, answer)

AsyncHakiClient is available for async codebases. Typed errors (HakiApiError, HakiConnectionError) instead of bare exceptions.

CLI

The haki command ships with this package:

haki connect --api-url http://localhost:8100
haki verify      # memorizes a preference, then a correction to it, then proves
                 # a new conversation serves the current value and can show
                 # the one it replaced
haki status
haki mcp          # package this SDK for Cursor's MCP integration

Requires

A running Haki API (self-hosted via docker compose up -d from the main repo, or a Haki Cloud project). This package is the client only — see the repo for the server.

Metadata

Release files for gethaki 0.2.0

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

Source distribution (sdist)

Source distribution for gethaki 0.2.0
File Size Uploaded
gethaki-0.2.0.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gethaki 0.2.0
File Interpreter ABI Platform
gethaki-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.6 kB

Release files / gethaki-0.2.0.tar.gz

Download URL gethaki-0.2.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
205dcbbcec4164037e9869d5e68a19d2da0aaf6b151cd51763c86345363c5ec6
BLAKE2b-256 checksum
How to use checksums
92001def4319dac1cf1d07f8cc29e85ae56edae5d5bca36c9f9f6c2548be8c3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / gethaki-0.2.0-py3-none-any.whl

Download URL gethaki-0.2.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1de6e94e9cb8add341b517d7f8dc16dc98d3cf6818e916042de8b1479e90b6d
BLAKE2b-256 checksum
How to use checksums
3bfd6ea9f0e05cccbd103c87132946c14b9089071044da6022d5448c682fa2b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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