Skip to main content

Local-first AI memory cartridge: persistent, cross-session memory for Claude and any LLM via MCP

Project description

llm-kosh

llm-kosh is a local-first memory cartridge for MCP-compatible AI clients. It stores user-controlled memory as plain files, indexes it with SQLite FTS5, and records mutations in a tamper-evident ledger.

The project is designed for developers who want durable AI context without handing a private workspace to a hosted memory service.

What it provides

  • A Python CLI for creating, searching, packing, and verifying memory cartridges.
  • A read-only-by-default MCP server for AI clients such as Claude Desktop.
  • A background service for local intake processing and maintenance jobs.
  • Optional desktop packaging with a bundled CLI sidecar.
  • Plain-file storage that remains inspectable, backupable, and Git-friendly.

Install and run

Python 3.10 or newer is required.

python -m pip install --upgrade llm-kosh
llm-kosh install --yes
llm-kosh status

llm-kosh install creates the default cartridge at ~/.llmkosh/cartridge, configures local defaults, and registers a read-only MCP entry for supported desktop clients where possible.

To manage the background service manually:

llm-kosh service start
llm-kosh service status
llm-kosh service stop

Minimal manual setup

Use --root when you want a cartridge outside the default location:

llm-kosh --root ./my-cartridge init --owner "Local User"
llm-kosh --root ./my-cartridge add --kind note --title "First memory" --body "Hello"
llm-kosh --root ./my-cartridge query "Hello"

Run the MCP server over stdio:

llm-kosh --root ./my-cartridge mcp-server

Or run local streamable HTTP:

llm-kosh --root ./my-cartridge mcp-server --http --port 8000
# endpoint: http://127.0.0.1:8000/mcp

The MCP server starts read-only. Enable stronger capabilities only for clients that should be allowed to write, mutate, or export private context:

llm-kosh --root ./my-cartridge mcp-server --allow-write
llm-kosh --root ./my-cartridge mcp-server --allow-write --allow-mutate
llm-kosh --root ./my-cartridge mcp-server --allow-private

Optional features

python -m pip install "llm-kosh[watch]"     # filesystem events
python -m pip install "llm-kosh[server]"    # FastAPI service
python -m pip install "llm-kosh[semantic]"  # local vector search
python -m pip install "llm-kosh[ingest]"    # document conversion helpers
python -m pip install "llm-kosh[all]"       # all optional features

MCP support is included in the base installation.

Desktop app status

The Electron desktop app is packaged separately from the Python package. Local developer builds and Windows installer smoke tests are supported. Public GA desktop distribution still requires verified Windows code signing and macOS Developer ID signing/notarization.

For the current release posture across package, MCP, service, and desktop, see GA_READINESS.md.

Security model

  • Storage and search are local by default.
  • There is no automatic cloud sync or telemetry in the Python package.
  • MCP starts read-only.
  • Write, mutation, and private-export capabilities require explicit opt-in.
  • Context exports are checked for common secret patterns before sharing.
  • Cartridge files are plaintext; use operating-system disk encryption if local data at rest needs encryption.

See SECURITY.md and docs/SECURITY.md for boundaries and limitations.

Development

python -m pip install -e ".[server,watch,ingest]"
python -m pytest -q

Native C++ math acceleration is optional. Set LLM_KOSH_BUILD_NATIVE=1 and install pybind11 before building if you want to test it. Release wheels use the portable pure-Python fallback.

Documentation

Licensed under the MIT License.

Project details


Download files

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

Source Distribution

llm_kosh-2.1.2.tar.gz (184.0 kB view details)

Uploaded Source

Built Distribution

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

llm_kosh-2.1.2-py3-none-any.whl (218.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_kosh-2.1.2.tar.gz.

File metadata

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

File hashes

Hashes for llm_kosh-2.1.2.tar.gz
Algorithm Hash digest
SHA256 f974212bd762df6992e5dc021573fe346a28091e53c799f2d067d6b02625762e
MD5 007fdeac49710e200e9e6f662ad40d0a
BLAKE2b-256 41c0dacd670dee935a3043219c34591a9ae515de34d27ea37be3538867de7d37

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_kosh-2.1.2.tar.gz:

Publisher: publish.yml on rastogivaibhav/llm-kosh

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

File details

Details for the file llm_kosh-2.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for llm_kosh-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0a24d05116548d8e638163f0d585e0bcde01722f319be239bc1086c5711a5aa5
MD5 4b5cae57ec52575d3a25cc5482c760f7
BLAKE2b-256 ab1ba1fe6fe33e0c7fc99069b1bfa3e46d302385079e6b39900f3bbf14605263

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_kosh-2.1.2-py3-none-any.whl:

Publisher: publish.yml on rastogivaibhav/llm-kosh

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page