Append-only JSONL memory store with type-aware indexing and BM25 search
Project description
siftmem
Append-only JSONL memory store for AI agents and workflows. Siftmem provides type-aware indexing, BM25 keyword search, and optional Gemini-assisted importance scoring, consolidation, and session capture.
Install
From PyPI (when published):
pip install siftmem
From source:
git clone https://github.com/josefrancisco81788/siftmem.git
cd siftmem
pip install -e .
Or install dependencies only:
pip install -r requirements.txt
Gemini-powered features (--score-assist, consolidation, session capture) require a GEMINI_API_KEY (see below).
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
SIFTMEM_MEMORY_DIR |
No | ~/.siftmem/memory |
Canonical JSONL store |
GEMINI_API_KEY |
For Gemini features | — | Importance scoring, consolidation, session capture |
SIFTMEM_HOME |
No | ~/.siftmem |
Base dir for session capture (agents/main/sessions) |
Usage
export SIFTMEM_MEMORY_DIR=~/.siftmem/memory
export GEMINI_API_KEY=your-key # optional unless using --score-assist / consolidate / capture
# Append a memory
siftmem-append --type decision --topic my-topic \
--content "Always validate inputs before indexing." --importance 0.9
# Build markdown + BM25 index
siftmem-build-index
# Keyword search
siftmem-search "workflow-email-triage" --json
Module invocation (without console scripts):
python -m siftmem.append --type fact --topic my-topic --content "Example." --importance 0.7
python -m siftmem.build_index
python -m siftmem.search "my-topic" --json
Package layout
| Module | Role |
|---|---|
siftmem.lib |
Shared library (load, dedup, BM25, Gemini helpers) |
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.consolidate |
Weekly topic synthesis (Gemini) |
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 |
|---|---|
| decision | 0.85 |
| preference | 0.80 |
| lesson | 0.70 |
| fact | 0.60 |
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).
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 siftmem-0.1.0.tar.gz.
File metadata
- Download URL: siftmem-0.1.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8be102284e7516b0663686a7f1dc979367badfdeadc011391c182e02703fe7c
|
|
| MD5 |
2e813900a158da80344c31a6069d676a
|
|
| BLAKE2b-256 |
886b63b5e725e35c827c527c3925d0f4b69f55aec9bb6026a4c42f4605665f33
|
File details
Details for the file siftmem-0.1.0-py3-none-any.whl.
File metadata
- Download URL: siftmem-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ab5ff1a30c634527dfb02fb63e61a5e6ec95f29a49eb9ddca1fba26d588bf9f
|
|
| MD5 |
af5a44c997d95eb4e0cd0a80de1bf789
|
|
| BLAKE2b-256 |
6312942c793b47f8b624878d961c29979edcfec2992659dc4ef576940c38f56b
|