Skip to main content

hippo-memory-sdk (Python SDK)

One memory for every agent you'll ever use. Hippo writes what you teach a coding agent into a store in your repo, and your other agents read that same store.

This package is a thin HTTP client for the same store your coding agents read. Run hippo serve from the npm package alongside, then use this SDK to talk to it from Python. The memories stay in SQLite on your machine, and storing one makes no model call. More at hippo-memory.com.

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:6789 by default

hippo serve takes no request without an API key, from this machine too. With no api_key, the client sends HIPPO_API_KEY, else, for a server on 127.0.0.1, ::1 or localhost, the member key hippo serve wrote to server.key: in the .hippo folder nearest the working folder, else in the global store (HIPPO_HOME). This is the rule the hippo CLI follows. To act as another key, mint one (see Authentication).

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:6789") 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

The server refuses a request with no key (401), from this machine too. Mint an API key via the CLI:

hippo auth create --label my-key
# Prints the plaintext key 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; on a shared server in place (global_id == source_id); the SDK sends no project, so a member key gets 400 "a shared store needs the caller's project", a host admin key works
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 (admin key only; a member key gets 403)

Every method returns a Pydantic v2 model. Failed HTTP responses raise HippoError with status_code and parsed body.

What's new in v0.2.0

  • Sync client (HippoSync). A line-for-line mirror of Hippo using httpx.Client. Use when your code already runs synchronously (CLI scripts, notebooks, threading.Thread callbacks) and you don't want to manage an event loop. Wire-compatible: same routes, same models, same errors.
  • ContextEntry.projected() helper. Projects the full MemoryEntry surface to the CLI's narrower json shape (id, score, strength, tags, confidence, content, global). Use when piping SDK results into LLM context or CLI-shaped downstream consumers.
  • auth_create(role=) parameter. Matches hippo-memory v1.12.3 server: pass role="admin" or role="member". Member keys are 403-blocked from admin-gated routes (e.g. /v1/sleep). Both AuthCreated.role and AuthKey.role populated by v1.12.3+ servers.

Limitations (v0.2)

  • /v1/sleep is loopback-only + admin-gated on the server side. The route refuses non-loopback connections (v1.11.4) and member-role Bearer tokens (v1.12.0 sub-1). This SDK is intended for use against a co-located hippo serve with an admin key.
  • /v1/sleep operates host-wide (cross-tenant). Matches the CLI's hippo sleep semantic. Per-tenant scoping deferred until non-loopback serving lands.
  • recall does NOT populate last_retrieval_ids, by design (locked in hippo-memory v1.11.5). To prime the last-recall outcome path, call get_context first. The CLI's hippo recall populates it because the CLI is interactive (user is about to run hippo outcome --good); the SDK is programmatic and SDK callers batch recall calls, where overwriting last_retrieval_ids each call would break the outcome workflow. Source: api.ts:412-421 JSDoc + tests/api/api-recall-no-side-effects.test.ts.
  • Server connector webhook routes (/v1/connectors/{slack,github}/events) are not wrapped in the SDK: they face servers, not clients.
  • lead_in needs a hippo-memory 3.13.0 server. remember(..., lead_in=...) sends leadIn. A server older than 3.13.0 stores the memory without the lead-in and returns no error.

Versioning

PyPI: hippo-memory-sdk. npm: hippo-memory@>=1.12.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.

Metadata

Release files for hippo-memory-sdk 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hippo-memory-sdk 0.3.4
File Size Uploaded Provenance Actions
hippo_memory_sdk-0.3.4.tar.gz 27.6 kB With provenance Details for hippo_memory_sdk-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hippo-memory-sdk 0.3.4
File Interpreter ABI Platform Actions
hippo_memory_sdk-0.3.4-py3-none-any.whl Python 3 none any Details for hippo_memory_sdk-0.3.4-py3-none-any.whl

Total release size: 58.5 kB

Release files / hippo_memory_sdk-0.3.4.tar.gz

Download URL hippo_memory_sdk-0.3.4.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3465b591a484ebc683b006e029fd747555180a1f8dc71413d24590e0e9e5665a
BLAKE2b-256 checksum
How to use checksums
ba2f3cd40a5e5940df0263b4087df4b27d77a98f36f5745d710003d34fb61ef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / hippo_memory_sdk-0.3.4-py3-none-any.whl

Download URL hippo_memory_sdk-0.3.4-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad34d6970e30187ec0580163055767c6e18cfa77b9b26c8b201a90ffd8833b7b
BLAKE2b-256 checksum
How to use checksums
e82cd1a893e4fb8235999ca2276f239762b95239a7e21ee85283bcd00e359e15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for hippo-memory-sdk 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hippo_memory_sdk-0.3.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page