1. Infrastructure
1
PostgreSQL 16 + pgvector, Redis 7
docker-compose.yml starts pgvector/pgvector:pg16 (user haki,
database haki, exposed on host port 5433 — not 5432, already
taken by a local Windows Postgres on many machines) and redis:7
(provisioned, intended for the queue).2
Python dependencies
uv installs Python 3.12 itself if needed, plus haki (the Python
SDK, a local editable dependency declared in pyproject.toml).3
Migrations
alembic/versions/0001 through 0008):
the pgvector extension, Ledger tables, full-text search columns,
forget_receipts, auth/RLS/feedback, episodic events, organizations.4
The API
2. Proof that it works
In a second terminal:haki connect tests /health and writes ~/.haki/config.json. haki verify runs the full scenario in a few seconds: it memorizes a
preference, opens a new conversation (new thread_id), and checks
that the agent remembers it — with the latency of every step.
haki verify attempts a key bootstrap for
the prj_haki_verify project (works on a fresh server without
HAKI_ADMIN_KEY, or in dev-open mode); on a server that refuses that
bootstrap, the scenario fails with a clear message instead of a silent
error.
Multilingual by default: Haki understands and memorizes in French,
English, Spanish and ~50 other languages (local multilingual
embeddings,
paraphrase-multilingual-MiniLM-L12-v2). A memory captured
in English is recalled by a question in French — verified by
scripts/check_multilingual.py (3/3 PASS on the last documented run in
docs/SECURITY.md).3. First manual call: capture then context
First, create a key (the very first creation is free as long as no key exists yet — see API keys):key (hk_...) only once — copy it. Add
-H "Authorization: Bearer hk_..." to every call below.
1
Capture a preference
2
Consolidate (dev/ops — extracting the durable fact)
HAKI_LLM_PROVIDER=fake, the default), extraction
makes no network call. In production
(HAKI_LLM_PROVIDER=openai), this same call triggers a real LLM
extraction.3
Ask for memory before an answer
invoice_language: {"language": "fr"}, its validity date, the id of the source event, and a
trace_id inspectable via GET /v1/inspect/{trace_id}.What’s next
Concepts
Understand the Ledger, bitemporality, supersession and the Context
Assembler before you integrate.
Python SDK
HakiClient, build_prompt_context, capture_turn, the haki CLI.Cursor
One-click MCP server, or Cursor Hooks for guaranteed capture.
OpenAI gateway
Automatic memory by changing only
base_url.
