Async Python SDK for hippo-memory (biologically-inspired memory for AI agents). Wraps the HTTP API of the hippo-memory npm package.
Project description
hippo-memory-sdk (Python SDK)
Async Python SDK for hippo-memory, a biologically-inspired memory system for AI agents. Decay by default, strength through use, sleep consolidation.
This package is a thin async HTTP wrapper. Run hippo serve from the npm package alongside, then use this SDK to talk to it from Python.
Install
pip install hippo-memory-sdk
The Python import name is hippo_memory (the distribution name hippo-memory-sdk only matters at install time; pip install hippo-memory-sdk was chosen because PyPI's similarity check blocked the bare hippo-memory name due to an existing hippomem project).
Requires Python 3.10+. Runtime deps: httpx>=0.27, pydantic>=2.0.
Server setup
You also need the hippo-memory npm package running locally:
npm install -g hippo-memory
hippo init # creates a .hippo directory
hippo serve # binds 127.0.0.1:3737 by default
The Python SDK talks to this loopback server. Requires hippo-memory@>=1.11.4 server (the /v1/outcome, /v1/context, /v1/sleep routes land in v1.11.4).
Quickstart
import asyncio
from hippo_memory import Hippo
async def main():
async with Hippo(base_url="http://127.0.0.1:3737") as client:
# Persist a memory
mem = await client.remember(content="bug fix lesson", tags=["error"])
print(mem.id)
# Search the store
results = await client.recall(q="bug fix", limit=5)
for r in results.results:
print(r.id, r.score, r.content)
# Assemble a context bundle (for prompt injection)
ctx = await client.get_context(budget=1500)
for item in ctx.entries:
print(item.entry.content)
# After your agent uses recalled memories, mark them good/bad
await client.outcome(good=True) # uses last-recall path
asyncio.run(main())
See examples/ for 3 runnable scripts: basic remember+recall, context injection, outcome feedback.
Authentication
Default is unauthenticated localhost (tenant default). For multi-tenant deployments, mint an API key via the CLI:
hippo auth create-key --label my-key
# Outputs a plaintext sk_... key (saved ONCE — store it)
Then pass it to the client:
async with Hippo(api_key="sk_...") as client:
# All operations now scoped to the key's tenant
...
API surface
| Method | HTTP | Notes |
|---|---|---|
health() |
GET /health |
server version + pid |
remember(content, ...) |
POST /v1/memories |
returns slim envelope (id + kind + tenant_id) |
recall(q, ...) |
GET /v1/memories |
search; scored results + token usage |
drill(id, ...) |
GET /v1/recall/drill/:id |
drill into a memory's children (DAG) |
forget(id) |
DELETE /v1/memories/:id |
hard-delete |
archive(id, reason?) |
POST /v1/memories/:id/archive |
soft-archive (append-only raw memories) |
supersede(id, by) |
POST /v1/memories/:id/supersede |
mark superseded |
promote(id) |
POST /v1/memories/:id/promote |
local -> global |
outcome(good, ids?) |
POST /v1/outcome |
apply outcome; last-recall path if no ids |
get_context(...) |
GET /v1/context |
assemble context bundle for prompt injection |
sleep(dry_run?, no_share?) |
POST /v1/sleep |
consolidation (loopback-only) |
assemble(session_id) |
GET /v1/sessions/:id/assemble |
Phase 2 context-engine assembly |
auth_create(label?) |
POST /v1/auth/keys |
mint a key (plaintext returned ONCE) |
auth_list(active?) |
GET /v1/auth/keys |
list keys for caller's tenant |
auth_revoke(key_id) |
DELETE /v1/auth/keys/:keyId |
revoke a key |
audit(op?, since?, limit?) |
GET /v1/audit |
read audit events |
Every method returns a Pydantic v2 model. Failed HTTP responses raise HippoError with status_code and parsed body.
Limitations (v0.1)
- Async-only. Sync wrappers (
HippoSync) are a v0.2 candidate. /v1/sleepis loopback-only on the server side. The route refuses non-loopback connections; this SDK is intended for use against a co-locatedhippo serve./v1/sleepoperates host-wide (cross-tenant). Matches the CLI'shippo sleepsemantic. Per-tenant scoping is tracked for a future hippo-memory minor release.get_contextlast_retrieval_idsparity gap. HTTPGET /v1/memories(recall) does NOT populatelast_retrieval_ids— onlyGET /v1/context(get_context) does. CLIhippo recallpopulates it; the SDK'srecalldoes not. To prime the last-recall outcome path, callget_contextfirst. Tracked in TODOS.md.ContextResult.entriesexposes the fullMemoryEntrysurface (richer thanhippo context --format jsonwhich projects to a subset). A.projected()helper is a v0.2 candidate.- Server connector webhook routes (
/v1/connectors/{slack,github}/events) are not wrapped in the SDK — they are server-side facing, not client-shaped.
Versioning
PyPI: hippo-memory v0.1.0. npm: hippo-memory@1.11.4 (the server). The two version lines move independently; the SDK reads the server's /health version to confirm compatibility.
Source
Lives in python/ of the kitfunso/hippo-memory monorepo. CHANGELOG entry: Python SDK v0.1.0 (2026-05-23) at the top of the root CHANGELOG.md.
License
MIT.
Project details
Release history Release notifications | RSS feed
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 hippo_memory_sdk-0.1.0.tar.gz.
File metadata
- Download URL: hippo_memory_sdk-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcd90cef00db2f21e595e86e0a03a33d52f013e8f8caa2d714e545d0b2884a1d
|
|
| MD5 |
68f7039ab6c443e09278d67ed11edfb6
|
|
| BLAKE2b-256 |
1c8fb1ccedc40d4a25e3b35403960dfe4a8a812269c711a3b5599c494d891094
|
Provenance
The following attestation bundles were made for hippo_memory_sdk-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on kitfunso/hippo-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hippo_memory_sdk-0.1.0.tar.gz -
Subject digest:
bcd90cef00db2f21e595e86e0a03a33d52f013e8f8caa2d714e545d0b2884a1d - Sigstore transparency entry: 1615694505
- Sigstore integration time:
-
Permalink:
kitfunso/hippo-memory@4ed371b808f16efe7dc7c1f4a15fdeb559e0cce4 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/kitfunso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4ed371b808f16efe7dc7c1f4a15fdeb559e0cce4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hippo_memory_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hippo_memory_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89c112d82b0b028bb32dc80739c69a624d3a8c4f51fe262238beb8a68a4a81b8
|
|
| MD5 |
835921898b5216064b2987325d32b315
|
|
| BLAKE2b-256 |
28ab50897cb99eb1faec29bbdca86c69aefd4c56841ad8810e9be19e59e1bb9d
|
Provenance
The following attestation bundles were made for hippo_memory_sdk-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on kitfunso/hippo-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hippo_memory_sdk-0.1.0-py3-none-any.whl -
Subject digest:
89c112d82b0b028bb32dc80739c69a624d3a8c4f51fe262238beb8a68a4a81b8 - Sigstore transparency entry: 1615694538
- Sigstore integration time:
-
Permalink:
kitfunso/hippo-memory@4ed371b808f16efe7dc7c1f4a15fdeb559e0cce4 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/kitfunso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4ed371b808f16efe7dc7c1f4a15fdeb559e0cce4 -
Trigger Event:
push
-
Statement type: