Skip to main content
Glama
README.md
# SPM Lite

Self-hosted, offline memory for agents. Answers must be backed by a stored
source; unsupported questions are refused with a reason (`no_candidate`,
`no_semantic_support`) instead of invented. Memory follows a partition you
choose — by default the repository — and an MCP client can use it over stdio.

Everything runs on your machine: Postgres with pgvector and a bundled ONNX
embedding model. No account, no telemetry, no external API. This repository
holds the deployment assets; the runtime images are public on GHCR and the
core is proprietary under the [Community licence](LICENSE-COMMUNITY.md).

## 60-second verification

Fresh data directory on an ordinary machine, output trimmed to the decisive
lines (the real run keeps every waiting line):

```console
$ bin/spm-local doctor
state: /data/local.json (present)
api /readyz: 200 {"status":"ok","mode":"saas","embedding_mode":"self_hosted","dependencies":{"metadata_db":"ready","vector":"ready"}}
embedding /health: 200 {"status":"ok","backend":"_onnxbackend","model":"BAAI/bge-small-zh-v1.5","dimensions":512}

$ bin/spm-local demo
{"source_id": "mcp_a0a7cb808e27a549735785e7421e870be3684f4996737911", "status": "accepted"}
--- supported question ---
"gate_reason": "passed"
"source_id": "mcp_a0a7cb808e27a549735785e7421e870be3684f4996737911"
--- no shared term ---
"gate_reason": "no_semantic_support"
--- empty partition ---
"gate_reason": "no_candidate"
```

A supported question returns the stored text and the source it came from. A
paraphrase without a shared term is refused as `no_semantic_support`; an empty
partition is refused as `no_candidate`. Neither is answered with a guess.

![passed verdict with source](docs/verdict-passed.png)

![refused verdict with reason](docs/verdict-refused.png)

## Quick start

Requirements: Docker with Compose v2, 8 GB RAM, 20 GB free disk.

```bash
git clone https://github.com/VeridicalTech/spm-lite && cd spm-lite
bin/spm-local init      # generates secrets, migrates, writes ./data/local.json
bin/spm-local up
bin/spm-local remember "Retry cap is 3; upstream 502s spike under load."
bin/spm-local recall "What is the retry cap?"
bin/spm-local demo        # passed, refusal, and empty-partition side by side
bin/spm-local destroy     # stop everything and delete ./data (export first)
```

The loopback UI at <http://127.0.0.1:8790/local> does the same by hand.
Register the stdio server with an MCP client (no URL or key needed):

```bash
claude mcp add spm -- "$PWD/bin/spm-local" mcp
```

Full steps, the state file and the CLI: [INSTALL.md](INSTALL.md). Backup,
restore and upgrade: [OPERATIONS.md](OPERATIONS.md). Every image digest is
signed keyless; [SECURITY.md](SECURITY.md) has the `cosign verify` command.
History: [CHANGELOG.md](CHANGELOG.md).

## Status

Preview. Source purge, partition wipe, export/import, the loopback UI and full
teardown (`bin/spm-local destroy`) work. Images build for amd64 and arm64; a
Raspberry Pi has not been run yet. Signed licences are still open. Recall is
lexical-first: a paraphrase without a shared term can be refused.

## Licence

[Community Edition](LICENSE-COMMUNITY.md); the everyday questions (team use,
consulting, redistribution, forks) are answered in plain language in the
[licence FAQ](LICENSE-FAQ.md). The `@spmos/spm-mcp` client is MIT in its own
repository.