HotMem
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 databaseswap.jsonl- portable JSONL backupmanifest.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
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 hotmem-0.2.0.tar.gz.
File metadata
- Download URL: hotmem-0.2.0.tar.gz
- Upload date:
- Size: 74.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11f6ed63ff5630ef73a1375c6414a5a87ba4f7612563a253d380d65075541a41
|
|
| MD5 |
d63db79795a58cacc7062b5fe7dbcb63
|
|
| BLAKE2b-256 |
fd52eb561c8ce27aa6c4cc2dc8c865f169fb3a0bc08b90eccb4e1c070e905196
|
Provenance
The following attestation bundles were made for hotmem-0.2.0.tar.gz:
Publisher:
release.yml on KnowGuard-AI/HotMem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotmem-0.2.0.tar.gz -
Subject digest:
11f6ed63ff5630ef73a1375c6414a5a87ba4f7612563a253d380d65075541a41 - Sigstore transparency entry: 2124415731
- Sigstore integration time:
-
Permalink:
KnowGuard-AI/HotMem@bd8b1698ca154f99ab6ec0e055cdf260ead704ae -
Branch / Tag:
refs/heads/main - Owner: https://github.com/KnowGuard-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bd8b1698ca154f99ab6ec0e055cdf260ead704ae -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hotmem-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hotmem-0.2.0-py3-none-any.whl
- Upload date:
- Size: 62.0 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 |
e056150e935ef1d943a5e0ff40895c13220c7920cf3366ef1100aee0ec2ce6df
|
|
| MD5 |
745578d5a75d72a0fa5d15d6cb7f18c9
|
|
| BLAKE2b-256 |
75f21a1dd2be990583ada19932a66bad546c575e986cdcc28f7d39dd07172207
|
Provenance
The following attestation bundles were made for hotmem-0.2.0-py3-none-any.whl:
Publisher:
release.yml on KnowGuard-AI/HotMem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotmem-0.2.0-py3-none-any.whl -
Subject digest:
e056150e935ef1d943a5e0ff40895c13220c7920cf3366ef1100aee0ec2ce6df - Sigstore transparency entry: 2124415772
- Sigstore integration time:
-
Permalink:
KnowGuard-AI/HotMem@bd8b1698ca154f99ab6ec0e055cdf260ead704ae -
Branch / Tag:
refs/heads/main - Owner: https://github.com/KnowGuard-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bd8b1698ca154f99ab6ec0e055cdf260ead704ae -
Trigger Event:
workflow_dispatch
-
Statement type: