siftmem
Append-only JSONL memory store for AI agents and workflows. Siftmem provides type-aware indexing, BM25 keyword search, and optional LLM-assisted importance scoring, consolidation, and session capture.
Core features work fully offline — no API key required for append, index, search, or dedup.
Install
pip install siftmem
From source:
git clone https://github.com/josefrancisco81788/siftmem.git
cd siftmem
pip install -e .
Optional extras:
pip install siftmem[llm-openai] # OpenAI provider for capture/consolidate/score-assist
pip install siftmem[dev] # pytest, build, twine
5-minute quickstart
pip install siftmem
siftmem-init
siftmem-search "getting-started" --json
siftmem-append --type fact --topic my-topic --content "Your first memory."
siftmem-build-index
siftmem-doctor
--importance is optional; siftmem defaults to the type floor plus a small margin.
Works offline vs needs LLM
| Feature | API key required? |
|---|---|
siftmem-append (default importance) |
No |
siftmem-build-index |
No |
siftmem-search |
No |
| Dedup / supersession | No |
siftmem-init, siftmem-doctor |
No |
--score-assist |
Yes (when SIFTMEM_LLM_PROVIDER is set) |
siftmem-consolidate |
Yes |
siftmem-capture |
Yes |
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
SIFTMEM_MEMORY_DIR |
No | ~/.siftmem/memory |
Canonical JSONL store |
SIFTMEM_LLM_PROVIDER |
No | none |
LLM backend: none, gemini, openai |
SIFTMEM_LLM_MODEL |
No | provider default | Model override |
GEMINI_API_KEY |
For gemini provider |
— | Gemini API access |
OPENAI_API_KEY |
For openai provider |
— | OpenAI API access |
SIFTMEM_HOME |
No | ~/.siftmem |
Base dir for session capture (agents/main/sessions) |
Usage
export SIFTMEM_MEMORY_DIR=~/.siftmem/memory
# Append a memory (importance optional)
siftmem-append --type decision --topic my-topic \
--content "Always validate inputs before indexing."
# Optional LLM-refined importance
export SIFTMEM_LLM_PROVIDER=gemini
export GEMINI_API_KEY=your-key
siftmem-append --type decision --topic my-topic \
--content "..." --score-assist
# Build markdown + BM25 index
siftmem-build-index
# Keyword search with filters
siftmem-search "workflow-email-triage" --type decision --json
siftmem-search "paths /tmp/foo" --explain --json
Python API
from pathlib import Path
from siftmem import MemoryStore
store = MemoryStore(Path("~/.siftmem/memory"))
store.append(
type="decision",
topic="onboarding",
content="Always rebuild the index after batch writes.",
importance=0.9,
rebuild_index=True,
)
hits = store.search("onboarding", max_results=5)
print(store.stats())
Package layout
| Module | Role |
|---|---|
siftmem.store |
MemoryStore Python API |
siftmem.lib |
Shared library (load, dedup, BM25) |
siftmem.llm |
Pluggable LLM JSON generation |
siftmem.append |
Append entries to canonical JSONL files |
siftmem.build_index |
Build markdown retrieval index + BM25 sidecar |
siftmem.search |
BM25 keyword search over JSONL corpus |
siftmem.init_cmd |
Bootstrap a new memory store |
siftmem.doctor |
Health checks |
siftmem.consolidate |
Weekly topic synthesis (LLM) |
siftmem.session_capture |
Extract memories from agent session transcripts |
Generated artifacts (under SIFTMEM_MEMORY_DIR)
| Path | Role |
|---|---|
facts.jsonl, decisions.jsonl, etc. |
Append-only canonical store |
siftmem_index/ |
Markdown index (topic__*.md, SIFTMEM_INDEX.md) |
siftmem_bm25_index.json |
BM25 search corpus |
Memory types and importance floors
| Type | Index floor | Default append |
|---|---|---|
| decision | 0.85 | 0.90 |
| preference | 0.80 | 0.85 |
| lesson | 0.70 | 0.75 |
| fact | 0.60 | 0.65 |
Entries below the floor for their type may be excluded from the markdown index unless they are the only entry for a topic (fallback indexing).
Development
pip install -e ".[dev]"
pytest -q
License
MIT — see LICENSE.
Metadata
Release files for siftmem 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| siftmem-0.2.0.tar.gz | 23.2 kB | Without provenance | Details for siftmem-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| siftmem-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for siftmem-0.2.0-py3-none-any.whl |
Total release size: 50.9 kB
Release files / siftmem-0.2.0.tar.gz
| Download URL | siftmem-0.2.0.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8ccc0679e35382188436d7fe41ff4dc577e75ebb853224f5ad59eba450968bb
|
|
BLAKE2b-256 checksum How to use checksums |
76aeeb2314434e528daefdd3f4084cfd5d6abf4fc34d4d65ad12929db0e9b181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / siftmem-0.2.0-py3-none-any.whl
| Download URL | siftmem-0.2.0-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35c65abfbe9ec37072c1355ce7a4e9674aa276c09ed5e849e015795f629a36ed
|
|
BLAKE2b-256 checksum How to use checksums |
42224d65a7399356cf28f1d7c2e1b964aaddbf705aea8914b7fd748ec08737c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for siftmem 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.