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 fact, opens a new conversation, proves recall
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.1.tar.gz (21.0 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.1-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gethaki-0.1.1.tar.gz
  • Upload date:
  • Size: 21.0 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.1.tar.gz
Algorithm Hash digest
SHA256 03e9ffa5fa18190553dc96f3602cab79d5f5f2ffc5d250d680ef8699e6e81179
MD5 06483438aa053a4439d99a9405f4e24d
BLAKE2b-256 86ca344b9f82263d13ffa0e36fd82c92d4422a41875b7b82537b8a2e2e500f51

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gethaki-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c516a91a1346d3f910348d85c14d7fdc64d81955433c796e9743046a022af262
MD5 5ab3b81019471d1fa22a6dc10be2c1ea
BLAKE2b-256 45c107aedf257cd1b5e52b385862c5acb1c80db96e820b063d61e2121d2fc824

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