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 gives your agents durable memory without handing your workspace to a hosted memory service.

Think of it as a structured, inspectable memory layer for agents:

  • plain files you can back up, diff, and review
  • a tamper-evident ledger for every mutation
  • a read-only-by-default MCP server
  • a background service for intake and maintenance
  • a CLI for local control and automation

Why teams use it

  • Keep AI context local and auditable.
  • Separate the cartridge root from the repository root.
  • Drop receipts or intake files into watched folders and let the service absorb them.
  • Connect MCP clients with minimal privilege by default.
  • Publish and verify the same artifact through GitHub Actions.

What works today

The core project is usable now:

  • the CLI runs locally
  • the Python package installs and works
  • the MCP server runs locally
  • the service can watch intake folders
  • the GitHub Actions publish path is working

The remaining work is release polish for Windows, macOS, and Linux packaging.

Quick start

Python 3.10 or newer is required.

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

That installs the package, creates the default cartridge at ~/.llmkosh/cartridge, configures local defaults, and registers the supported desktop integration where possible.

To manage the background service:

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

If you want to work in a custom cartridge location, set the root explicitly:

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"

Core concepts

There are three folders worth knowing:

  • the repository root: the code checkout you are reading now
  • the cartridge root: the live memory store selected by --root or LLMKOSH_ROOT
  • watched intake folders: receipts/, intake/, and any configured external drop folders

If you drop files into the cartridge’s intake areas, the service can process them asynchronously. If you configure external folders through [daemon].watched_directories, the service can absorb those too.

Use with MCP clients

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

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

You can also run MCP over local HTTP:

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

What’s included

  • Python CLI for creating, searching, packing, importing, and verifying cartridges
  • read-only-by-default MCP server
  • local background service for intake and maintenance jobs
  • optional desktop packaging with a bundled CLI sidecar
  • plain-file storage that stays inspectable, backupable, and Git-friendly
  • optional extras for filesystem watching, service integration, semantic search, and ingest helpers

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.

Developer workflow

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

If you are changing packaging or release behavior, also run:

python -m build
python -m twine check dist/*

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.

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.

Documentation

Native acceleration

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.

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.3.tar.gz (186.1 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.3-py3-none-any.whl (219.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_kosh-2.1.3.tar.gz
  • Upload date:
  • Size: 186.1 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.3.tar.gz
Algorithm Hash digest
SHA256 790e81713ae546d9c808d349cf1047795a455f76f52aca773425d5e9c1ffbf75
MD5 155b6b2f0f50728c9e8268f45598b239
BLAKE2b-256 0ea149693eb683c2081fe7b2aeacb991744189585b5a225fdf6a0663dbc976be

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: llm_kosh-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 219.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1636426e7dd89685b967662214592c187f554ab62c1827ff0c3377b7f236ac2c
MD5 0651003953ade0ff8026c174c281a9b7
BLAKE2b-256 708ba022c10576c60a4aa4041d3ccb7413662f7c8e0bc5c1137e45112d930369

See more details on using hashes here.

Provenance

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