Skip to main content

HotMem banner

HotMem

CI PyPI Python codecov License: MIT Ruff

A local-first memory sidecar for agent applications. One SQLite DB. One port: 8711.

HotMem provides fast, queryable working memory with hybrid vector + keyword search. Store facts, retrieve them ranked, and get back LLM-ready message objects you can stitch directly into prompts.

Supports Python 3.11, 3.12, 3.13, and 3.14.

Install

pip install hotmem
# or
uv pip install hotmem

Quick Start

# Start with a mount directory (portable memory)
hotmem serve --mount ./hotmem

# Or just start (uses temp DB)
hotmem serve

CLI

hotmem serve --port 8711 --mount ./data/hotmem
hotmem serve --db ./my.sqlite
hotmem hydrate --file swap.jsonl --db ./my.sqlite
hotmem hydrate --file swap.jsonl.gz --db ./my.sqlite
hotmem snapshot --file swap.jsonl --db ./my.sqlite
hotmem status

API

All endpoints under /v1. Default: http://127.0.0.1:8711

GET /v1/health

{"status": "ok", "memory_count": 42, "db_path": "...", "uptime_s": 120.5}

POST /v1/add

{"identifier": "vendor_x", "fact": "Invoice total was $5000", "importance": 0.8}

POST /v1/search

{"query": "duplicate invoice risk", "top_k": 5, "max_chars": 1500}

Returns ranked message objects ready for LLM stitching:

{
  "memories": [
    {"role": "system", "content": "...", "memory_id": "...", "identifier": "...", "score": 0.87}
  ],
  "count": 5,
  "trace_ms": 2.1
}

POST /v1/hydrate

{"file": "swap.jsonl"}

POST /v1/snapshot

{"file": "swap.jsonl"}

Python Client

from hotmem.client import HotMemClient

with HotMemClient("http://127.0.0.1:8711") as client:
    client.add("vendor_x", "Invoice total $5000", importance=0.8)

    memories = client.search("duplicate invoice risk", top_k=5, max_chars=1500)

    # memories are LLM-ready message objects
    messages = memories + [{"role": "user", "content": "Analyze this vendor."}]

Ecosystem

HotMem core stays zero-dep. Framework adapters live in adapters/, each a separate pip-installable package wrapping HotMemClient:

Package Framework
hotmem-langchain LangChain (BaseChatMessageHistory, BaseRetriever)
hotmem-crewai CrewAI memory backend
hotmem-autogen AutoGen memory plugin
hotmem-pydanticai Pydantic AI dependency + tools
hotmem-hermes Hermes Agent memory provider plugin

The hotmem-hermes adapter is the deep integration: HotMem implements the Hermes Memory Provider Plugin interface, so Hermes calls into HotMem at every lifecycle point automatically (prefetch, sync, memory-write mirroring, pre-compress extraction, session-end snapshot).

A typed TypeScript client (npm install hotmem) lives in ts/ — zero-dependency, works in Node 18+, Deno, Bun, and edge runtimes.

Mounting

Any directory can be a HotMem mount. The mount contains:

  • hotmem.sqlite - the database
  • swap.jsonl - portable JSONL backup
  • manifest.json - mount metadata

Plain .jsonl is the canonical portable swap format. HotMem can also hydrate from and snapshot to .jsonl.gz for compressed archives.

hotmem serve --mount /mnt/usb/hotmem     # portable memory on USB
hotmem serve --mount ./data/hotmem        # local project memory

Development

uv sync                          # install deps
uv run pytest                    # run tests
uv run ruff check src/ tests/    # lint
uv run ruff format src/ tests/   # format
uv build                         # build wheel

Architecture

Each source module is self-contained with a docstring header describing its purpose and interface:

Module Purpose
trace.py Structured JSON logging
embed.py Hash-based embedder (dim=64)
db.py SQLite storage + cosine similarity UDF
search.py Hybrid ranking (cosine + keyword + importance)
swap.py JSONL hydrate/snapshot
mount.py Portable directory management
server.py FastAPI endpoints
cli.py Click CLI
client.py Python SDK (httpx)

Every operation emits structured JSON traces to stderr with component tags:

hotmem serve --mount ./data 2>&1 | grep '"component": "search"'

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT - see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hotmem-0.1.9.tar.gz (51.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hotmem-0.1.9-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file hotmem-0.1.9.tar.gz.

File metadata

  • Download URL: hotmem-0.1.9.tar.gz
  • Upload date:
  • Size: 51.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hotmem-0.1.9.tar.gz
Algorithm Hash digest
SHA256 7224c0cb1a2fc11309c81c0f13fefee5abc450c3f1556dbb9981a5b188c6264e
MD5 9583b6730c2fa1d4f2e94cf828a0672f
BLAKE2b-256 6e2eed107a6bd73f73ff2eb85351b096511b8952560ad554da1c2dbef7d0c2a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotmem-0.1.9.tar.gz:

Publisher: release.yml on KnowGuard-AI/HotMem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hotmem-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: hotmem-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hotmem-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 fd240f1f9400abf12564b795f32f44cb7423ebb9ed5ec8c0dbc0fb3834d9a3c8
MD5 b5abeb9c948f881d1135920c5042b295
BLAKE2b-256 3a35a6bcbc48e35f1307f150aa0ed70221b1d47978decc7eb5b037608baee6ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotmem-0.1.9-py3-none-any.whl:

Publisher: release.yml on KnowGuard-AI/HotMem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.4

2 files

0.2.3

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

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