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.2.tar.gz (25.4 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.2-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gethaki-0.1.2.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for gethaki-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5c78449bbadfa3b778b624a6e80a5bd0e0b197e71ac675906eff13da4b5aa96c
MD5 b5549e86b7fab68f255fc2ce94ebc23d
BLAKE2b-256 c56bd9d4d4553b21e295af9034cd0f85ab27c45685de3488efa680c6ef425155

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gethaki-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for gethaki-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c5f62a191d212906c8794d8be7020406144ec81d2fabc2d40368e83ea1aabc75
MD5 68e7199ae0f007bf2c1c8f7c66ff8985
BLAKE2b-256 900e2a1a2aae5e200534c02d96f397e2929e91a969204c528f17e4ab5dcb5cb6

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