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.

Download files

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

Source Distribution

gethaki-0.2.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

gethaki-0.2.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file gethaki-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for gethaki-0.2.0.tar.gz
Algorithm Hash digest
SHA256 205dcbbcec4164037e9869d5e68a19d2da0aaf6b151cd51763c86345363c5ec6
MD5 b101d44aadf93f2a1d1b21eaa1a7db3b
BLAKE2b-256 92001def4319dac1cf1d07f8cc29e85ae56edae5d5bca36c9f9f6c2548be8c3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gethaki-0.2.0.tar.gz:

Publisher: publish-sdk-python.yml on GetHaki/Haki

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

File details

Details for the file gethaki-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for gethaki-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1de6e94e9cb8add341b517d7f8dc16dc98d3cf6818e916042de8b1479e90b6d
MD5 165485e1f7b57d1ebc5c9bb540b6477d
BLAKE2b-256 3bfd6ea9f0e05cccbd103c87132946c14b9089071044da6022d5448c682fa2b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for gethaki-0.2.0-py3-none-any.whl:

Publisher: publish-sdk-python.yml on GetHaki/Haki

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 Sentry Error logging StatusPage Status page