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.
- Docs: https://docs.gethaki.space
- Source / self-hosting: https://github.com/GetHaki/Haki
- License: Apache-2.0
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
205dcbbcec4164037e9869d5e68a19d2da0aaf6b151cd51763c86345363c5ec6
|
|
| MD5 |
b101d44aadf93f2a1d1b21eaa1a7db3b
|
|
| BLAKE2b-256 |
92001def4319dac1cf1d07f8cc29e85ae56edae5d5bca36c9f9f6c2548be8c3d
|
Provenance
The following attestation bundles were made for gethaki-0.2.0.tar.gz:
Publisher:
publish-sdk-python.yml on GetHaki/Haki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gethaki-0.2.0.tar.gz -
Subject digest:
205dcbbcec4164037e9869d5e68a19d2da0aaf6b151cd51763c86345363c5ec6 - Sigstore transparency entry: 2495112619
- Sigstore integration time:
-
Permalink:
GetHaki/Haki@93bf8bd4b9e8a8acc9b1c5bed71fe2c0d1a04653 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GetHaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-python.yml@93bf8bd4b9e8a8acc9b1c5bed71fe2c0d1a04653 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1de6e94e9cb8add341b517d7f8dc16dc98d3cf6818e916042de8b1479e90b6d
|
|
| MD5 |
165485e1f7b57d1ebc5c9bb540b6477d
|
|
| BLAKE2b-256 |
3bfd6ea9f0e05cccbd103c87132946c14b9089071044da6022d5448c682fa2b5
|
Provenance
The following attestation bundles were made for gethaki-0.2.0-py3-none-any.whl:
Publisher:
publish-sdk-python.yml on GetHaki/Haki
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gethaki-0.2.0-py3-none-any.whl -
Subject digest:
d1de6e94e9cb8add341b517d7f8dc16dc98d3cf6818e916042de8b1479e90b6d - Sigstore transparency entry: 2495112649
- Sigstore integration time:
-
Permalink:
GetHaki/Haki@93bf8bd4b9e8a8acc9b1c5bed71fe2c0d1a04653 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GetHaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-python.yml@93bf8bd4b9e8a8acc9b1c5bed71fe2c0d1a04653 -
Trigger Event:
workflow_dispatch
-
Statement type: