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.1.3.tar.gz (25.8 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.1.3-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gethaki-0.1.3.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gethaki-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6231faf6bab398b42b6c8c2d41628864b3394c724706233deea5462fd7a5a012
MD5 38e9420e75ebbd8517a01aeb683c20be
BLAKE2b-256 2c1aaa9ee0b3468135331fa21e8d3d6c83b7e3f5aa9de1a46820c427cde3d481

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gethaki-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gethaki-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 83ddfb76719d9f18b3f1e8801c5116fbf04358716933baf4b8397c7e9678605d
MD5 2cd9166b340ef00c35ad4085976078c9
BLAKE2b-256 53d3850edadc7cbf824d60dd3298fbcd327e5e07c4e9d5d0c74b0900d2af00d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page