Daemon-free distributed storage over Cloud Drives for developers and AI agents — multi-process, immutable history, zero dependencies.
pip install jsonpit==4.6.3 Copy PIP instructions
JsonPit change requests and release notes are centralized in the RAIkeep doc/ directory under JsonPit_... filenames; they are not stored separately in this child repository.
JsonPit stores JSON documents with value history across processes, machines, and servers using asynchronous persistence with eventual durability.
CLI tools: use pits (see PitSeeder) or jpit to seed, export, inspect, and maintain JsonPits. Use amafu init to detect cloud drives and create the shared RAIkeep configuration.
The canonical reference (lead) implementation is C# JsonPit and the pits CLI in RAIkeep. jsonpit is the pure-Python implementation engineered for 100% behavioral and physical storage parity with zero deviation.
Seed receipts count source entries, including repeated IDs, using the engine's accepted-fragment result:
[jpit] 3 source items: 1 written, 2 unchanged (Pit 'Object'). [jpit] 3 source items: 0 written, 3 unchanged (Pit 'Object'). A no-op exits 0. --debug / -b lists unchanged IDs on stderr. “Written” means newly accepted source fragments whose required local persistence completed; it is neither a physical file-write count nor confirmation of cloud replication. The success line follows Save and required disposal/process-window cleanup. Persistence failures return nonzero without that receipt. --window retains its existing explicit opt-out from window release; Save must still succeed.
All source entries and strict -x / --id-exists / --patch targets are validated before mutation. Equality is against the latest fragment ignoring Modified, not against the projected state. A sparse patch matching projected values may therefore still append a fragment; distributed ordering and tombstones are preserved.
Without -c, jpit export Object -r AfricaStage --out-dir ./exports resolves the bare tenant name beneath the configured default cloud, matching status. Use -c to select a cloud explicitly, or -r ./AfricaStage / an absolute path for local storage. A same-named local directory does not override a bare tenant name. This also applies to report-only WWWA maintenance, audit, and grep's default target with -r.
Export exits 1 with the missing canonical .pit path on stderr when a source snapshot is absent. It emits no JSON or success receipt and leaves existing export files intact. --wwwa requires all four snapshots; a valid existing empty snapshot still exports [] successfully.
Latest release notes: jsonpit-python 4.6.3 release notes.
jsonpit models distributed state through rich, encapsulated domain classes implementing standard Python protocols (MutableMapping, ContextManager):
Core Living Entity Model · Vector SVG: jsonpitCD.svg
Maintenance & Recovery Audit · Vector SVG: jsonpit_opsCD.svg
📖 Architecture, Guides & Full API: • For a hands-on practical walkthrough with Python library and CLI examples, see GettingStarted.md. • For the complete unified architecture across all subsystems, see jsonpit_unifiedCD.svg. • For comprehensive method signatures, exception contracts, and protocol details, see API.md.
pipx install "jsonpit==4.6.3" jpit --version jsonpit --version To upgrade:
pipx upgrade jsonpit The expected outputs are jpit v4.6.3 and jsonpit v4.6.3. Do not install both jsonpit and the jpit companion into separate pipx environments: both expose the same commands. If both were previously installed, remove the redundant companion environment and restore the command links:
pipx uninstall jpit pipx install --force "jsonpit==4.6.3" On Ubuntu/Debian, install pipx with sudo apt install pipx if needed. On macOS, use brew install pipx. Run pipx ensurepath and start a new shell if the commands are not on PATH. System Python may reject direct pip installation with externally-managed-environment; use pipx for the CLI.
python3 -m venv .venv source .venv/bin/activate python -m pip install "jsonpit==4.6.3" The jpit companion distribution is an alternative installation name for the same CLI and depends on the matching jsonpit release. Prefer jsonpit for a new installation.
Given a machine configured with ~/.config/RAIkeep.json5:
from jsonpit import Pit, PitItem # Automatically resolves cloud storage (OneDriveData/AfricaStage/Person/): with Pit.open("Person", cloud="OneDrive", root="AfricaStage") as pit: # Get an entity (projected state) sipho = pit.get("Sipho") if sipho: print(f"Sipho's current role: {sipho.get('Role')}") # Mutate an entity: sparse append-only mutation, auto-sets Deleted=False sipho.set_property({"Status": "Active", "Location": "RehearsalStage"}) # Add a new entity hugh = PitItem(id="HughMasekela") hugh.set_property({"Genre": "Jazz", "Instruments": ["Flugelhorn", "Cornet"]}) pit.add(hugh) # On exit of the context manager: # 1. Point-in-time snapshot captured # 2. In-place sibling temporary file written (CR022 cloud-safe) # 3. Atomically replaces Person.pit on the cloud volume # 4. Owned process activity flag cleanly released 2. Local / Explicit Filesystem Path For local test directories or custom scripts:
with Pit.open("/path/to/my/Person") as pit: for item in pit.values(): print(item.id, item.modified) 3. Developer Companion CLI: jpit The package installs both jpit and jsonpit commands:
# Fast semantic search across one or all pits ("Pit-Grep"): jpit grep "Adele" Person jpit grep "Burkhardt" --root AIA # Pipe search results directly into jq: jpit grep "Jazz" Person --json | jq '.[].Genre' # Inspect entity living state or full immutable history: jpit get Person Rainer jpit history Person Rainer # Pipe JSON5 / JSON mutations directly into a pit: cat update.json5 | jpit put Person echo '{id: "AlanKay", dynabook: true}' | jpit put Person # Set individual properties or tombstone an entity: jpit set Person AlanKay Status "Visionary" jpit del Person ObsoleteEntity # Automated maintenance and dead flag pruning (100% C# pits maintain parity): jpit maintain Activity -c OneDrive -r AIA jpit maintain Activity -c OneDrive -r AIA --apply --prune-process-flags --older-than 01:00:00 --json jpit maintain --wwwa -c OneDrive -r AIA --apply --prune-process-flags --older-than 7.00:00:00 # Read-only audit of durable recovery events (100% C# pits audit parity): jpit audit Activity -c OneDrive -r AIA jpit audit Activity -c OneDrive -r AIA --machine local --level Warning jpit audit --wwwa -c OneDrive -r AIA --json The Physical Structure of a Pit A Pit is not a single file—it is a Directory Ecosystem:
Person/ ├── Person.pit # Canonical point-in-time snapshot ├── Master.flag # Master writer lease ticket (Owner|Timestamp) ├── Nkosikazi-python-59346.flag # Process activity window ({Machine}-{App}-{PID}.flag) ├── Events/ # Immutable change streams & compaction archives └── Changes/ # Hashed, collision-safe change files & receipts Autonomous Agents & Cross-Platform State jsonpit solves the distributed state dilemma for autonomous AI agents:
To ensure 100% interoperability with C# JsonPit, this repository includes a dedicated Differential Cross-Testing Suite (tests/suites/*.json5 & tests/sequence_runner.py). The test harness orchestrates bidirectional interaction between the Python runtime (jpit) and the C# CLI binary (pits):
For full suite descriptions, architecture diagrams, and certification tables, see: 👉 doc/CROSS_ENGINE_PARITY_SPECIFICATION.md
# Run the full test battery (Unit Tests + 7 Cross-Engine Parity Suites): python3 tests/run_all.py # Run a specific declarative parity suite directly: python3 -m tests.sequence_runner tests/suites/01_persistence_and_crud.json5 Key dates PyPI data Data sourced directly from PyPI's database. Released: Nov 7, 2026 Latest release 1 maintainer PyPI data Data sourced directly from PyPI's database. burkhardt Credits Author: Dr. Rainer Burkhardt
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
None of the files in this release were uploaded with provenance metadata.
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.




