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.1.tar.gz (183.7 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.1-py3-none-any.whl (217.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_kosh-2.1.1.tar.gz
  • Upload date:
  • Size: 183.7 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.1.tar.gz
Algorithm Hash digest
SHA256 a68b374d01604bc1214730a1a98b2180a570f268ed52c8cea1b0b99aa444bc57
MD5 492acf5f6c80e27f901e8c22fd8d3497
BLAKE2b-256 f082a71d8585a074409c93bc6000be157bdf591a0e4007b5a6ee0f2de1be36e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_kosh-2.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: llm_kosh-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 217.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8cbfd8a6d4b3b858332678a031ccc5592131348bf6667fb741c69eeb7cc40288
MD5 8168f761af9f2a422ef909f76c1a3894
BLAKE2b-256 a804965a6f6285a519f2b46a917c42a6d50f683f79fc02ad79e78b726dd61e94

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_kosh-2.1.1-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