Technical Overview

Everything SLM does

A governed, local-first memory brain: three-tier recall that never bluffs, layered recall under a token budget, documents and pictures, Memory health, SLM-Mesh, outcome learning, cache and compression, and governance — per-workspace isolation, role-based access, GDPR controls, and a per-mode EU AI Act self-assessment. Optional network features are disclosed per capability.

AGPL v3 Hybrid retrieval Local-first signals Three-phase learning RBAC MCP + CLI Mode C: flagged
CORE CAPABILITIES

Every capability area.

From recall that admits what it does not know to agents and web bots that talk to each other. Each card links to its guide; optional network features are disclosed separately.

01 · Recall tiers

Recall that knows when it doesn't know

Every recall ends in one of three tiers: a supported answer; “I don’t have this exactly — here are the closest memories” (up to three, labelled); or “That isn’t in SuperLocalMemory.” for nonsense. While models load, recall says it is still warming up and to try again in a few minutes. Hooks that inject memory automatically only ever inject supported answers.

02 · Layered recall

Never floods your context

Depth 0 is a one-line glance, depth 1 the facts, depth 2 adds the source, session neighbours, related entities and corrections. A hard max_tokens cap bounds the reply, and the expand tool drills into one result only when the agent needs it.

03 · Retrieval

Traceable Hybrid Retrieval

Semantic, keyword (BM25), entity-graph, temporal, associative (Hopfield), spreading-activation and picture channels feed fusion and reranking, with inspectable diagnostics; slm trace shows each channel's score.

04 · Time

A sense of time

Bi-temporal facts: ask what was true then (--valid-at) or what SLM knew then (--known-as-of). Corrections replace a fact and stay undoable; unused memories fade the way human memory does.

05 · Documents and pictures GoogleEmbeddingGemma 2 · off by default · needs 16 GB

Screenshots, PDFs and pictures you can ask

Google's EmbeddingGemma 2, on your computer, is the one model for text and pictures in one search space, so a description finds the image. OCR runs locally too. Pictures are found by describing them, PDFs are indexed page by page, and every answer cites its file and page. Folders and Obsidian vaults mirror in read-only. No generative model ever looks at your files.

06 · Knowledge base

Karpathy's LLM-wiki idea, built in

A document index of every file with its people, projects and dates, and a document health check that finds empty pages, unlinked documents, duplicate pages and contradicted facts. Hybrid search is kept for finding things.

07 · Memory health

It looks after itself

While your computer is idle, older memories get dates, names, projects and kinds filled in — only by adding, never over what you wrote. Repairs that move or delete wait for your Fix, and Undo puts everything back.

08 · Answer check

Laya on your Mac, Jev online

A second opinion on whether the memories found really answer the question. Laya runs on-device and is on by default on Apple Silicon; Jev runs online only after you consent, through TypeSafe or OpenRouter.

09 · Governance

Governed, not just stored

Roles and workspaces, save receipts, a hash-chained audit trail, per-profile retention, and GDPR export and erasure that reach every derived copy — summaries, caches, indexes, picture mirrors — with a verifiable receipt. Engineering controls, not a certification.

10 · Many agents

Many agents, one brain

Every write records which agent made it, with Bayesian trust scores against memory poisoning, so several agents can share one memory without poisoning it.

11 · SLM-Mesh

Agents and web bots that talk, across the internet

Messages, waits, locks and shared state between Claude Code, Codex and Hermes sessions on one machine or several. ChatGPT, Claude on the web, Grok Bot and Muse join with your permission: message a named peer and read the inbox. Messages arrive labelled as data, never as instructions.

12 · Learning

Learns every day, can't quietly get worse

Outcomes teach the ranker; stable habits become soft prompts; agent skills are measured and revised. A new ranker is promoted only on a statistically valid win and rolled back automatically if it slips.

13 · Bounded loops and graphs

Done means a gate passed

Loops end only when an independent gate passes (tests, a linter, a schema), never on the agent's word, and every lap is stored as auditable memory. Multi-step graphs run in Bounded Loops, and SLM keeps their finished runs as read-only evidence.

14 · Storage

SQLite Core + Scale Engine

SQLite with WAL, FTS, and profile isolation is the canonical path. Optional CozoDB graph and LanceDB vector copies serve only once they match SQLite. A restore point is taken before every store update.

15 · Interface

MCP, CLI, Hooks, and Skills

Profile-selected MCP tools, structured CLI commands, and additive client assets support Claude Code, Codex, Cursor, Copilot, Antigravity, Hermes and any harness that speaks MCP or runs a command, without overwriting a user's configuration.

16 · Console

Local Operations Console

Search, knowledge graph, Entity Explorer, answer check, Memory health, documents and images, connected apps, bot messages and governance, all through the local service.

More depth: Answer check, Governance, Skill evolution and Plugins and bots. Memory kinds are covered under Workflows. The full README is at GitHub.

OPERATING ARCHITECTURE

Ten-layer operating stack.

An inspectable stack from SQLite-backed storage through retrieval diagnostics, lifecycle controls, optional optimization, and local visualization.

01 Capture: CLI, MCP, hooks, dashboard actions, and opt-in adapters
02 Durable ingestion: dated evidence, provenance, idempotency, profile, and operation state
03 Structure: facts, entities, relations, temporal signals, FTS, embeddings, and lifecycle
04 Recall: semantic, BM25, temporal, Hopfield, and spreading-activation candidates
05 Fusion: provenance-aware ranking, optional reranking, and graph score enhancement
06 Brain: behavioral signals, optional LightGBM model loading, and pattern views
07 Optimize: exact cache, explicit semantic cache, safe compression, optional lossy prose mode
08 Mesh: authenticated messages, inbox, locks, queue, and optional mDNS — not database replication
09 Operate: dashboard, health, entities, skill evolution, settings, CLI, and MCP profiles
10 Storage: SQLite core; explicit CozoDB and LanceDB Scale Engine projection lifecycle
BEHAVIORAL LEARNING

Learning to rank, locally.

SuperLocalMemory records local behavioral signals that influence ranking without a separate LLM call for the learning step. Three phases: baseline observation, rule-based heuristics, optional ML model activation. Inspect signals, thresholds, and rank changes; optional modes and integrations retain their own network paths.

Three retrieval mechanisms

Semantic, graph, and adaptive channels feed the ranking pipeline. Each channel is independently inspectable.

01 · Semantic

Semantic Search

Dense vector candidates from a local embedding model. Finds memories conceptually related to a query even when keywords do not match exactly.

02 · Graph

Graph Association

Entities — files, functions, concepts — are extracted and linked. Querying one entity can surface linked neighbours via graph traversal, not keyword matches alone.

03 · Adaptive

Adaptive Re-Ranking

Local behavioral signals — access patterns, explicit feedback, recency — adjust candidate rank without an additional LLM call for the learning step itself.

Three-phase adaptive learning

Recall emits local exposure telemetry. Exposure alone is not positive feedback and does not increase truth or trust scores stored in memory.

Phase 1 · 0–49 signals

Baseline

Optional reranking and channel diagnostics can record exposure. Explicit positive, negative, or corrective feedback remains separate from stored-memory confidence and trust. No model activation at this phase.

Phase 2 · 50–199 signals

Rule-Based

Heuristic boosts from learned patterns: recency weight, access frequency, and trust score. The ranking influence is deterministic and inspectable — no trained model is loaded at this phase.

Phase 3 · 200+ signals

ML Model

When the learning path has sufficient valid signals and model activation is enabled, it can train on local behavioral state. Verify activation, model state, and rank impact in the installed release.

Inspectable learning signals

Each signal type has distinct semantics. Read the source before inferring intent from a rank change.

Co-Retrieval Records co-exposure of memories in the same result set. Not correctness feedback by itself; does not update stored-memory confidence or trust.
Confidence Lifecycle Stored assertion confidence remains distinct from access telemetry. Retrieve count does not automatically upgrade confidence.
Channel Performance Requires explicit outcomes before changing quality claims for a retrieval channel. Exposure alone is not an outcome.
Diagnostics Trace the signal source, update path, and resulting rank impact with slm trace. The dashboard surfaces per-signal contributions for each recall.

Integration and activation paths

These features require hooks, background workers, or explicit configuration. Each needs independent verification for a complete deployment review.

Hook Capture Supported tool events can be captured when hooks are installed and the client supports them. Inspect event coverage, truncation, redaction, storage cost, and omissions.
Auto-Recall Project context can be injected at session start via Claude Code hooks. Verify hook installation, event coverage, and any content redaction before enabling.
Sleep-Time Work A background worker can deduplicate, decay stale signals, and conditionally retrain. Verify the worker is running and review its output before relying on its changes.
Pattern Detection Tech preferences, temporal patterns, and interests can be mined from behavioral state. Treat derived patterns as weighted context, not verified fact.

The retrieval pipeline

Query enters, candidate producers run, re-ranking applies behavioral weights, ranked context exits. Every stage is traceable.

slm trace "token expiry"
# Five candidate producers run in parallel
stage candidates
  semantic            (dense, local embedding)
  bm25                (full-text lexical)
  temporal            (recency)
  hopfield            (associative)
  spreading activation

stage re-rank
  fusion score · entity-graph adjustment · access weight · trust score · decay
✓ ranked context returned · rank deltas inspectable in the dashboard

# Per-channel score breakdown for any query
$ slm trace "token expiry"
  names the channels that contributed to each result
✓ signal sources visible · no black-box ranking

Entity-graph information can adjust a post-fusion score but is not a separate candidate producer.

CACHE AND COMPRESSION

Content-aware compression. Exact cache reuse.

An exact cache path, content-aware compression controls, provider-prefix preparation, and release-gated semantic-cache safeguards. Cache reuse and compression results remain workload- and configuration-specific. Defaults: exact cache on, semantic cache off, safe compression on, aggressive compression off.

Three surfaces

Proxy slm wrap claude (or ANTHROPIC_BASE_URL). Intercepts the full context, so it is the only surface that caches the main Claude turn.
MCP tools Five tools, no proxy required. They work on content you explicitly route through SLM and do not intercept the primary context window.
Skills slm-cache and slm-compress, shipped in the SLM plugins with an slm-optimize-advisor agent. Instruction files: the effect depends on the agent following them.

The primary Claude conversation turn cannot be cached without the proxy; the MCP tools and skills cache results you explicitly route through SLM. Optimization is designed to fail open: handled optimization errors pass through to the provider, though provider and transport failures remain possible.

MCP optimize tools

slm_compress Compress text or tool output. mode is normalize (lossless), auto, or aggressive. Returns a ccr_id when the result is lossy and reversible.
slm_retrieve Recover the exact original from a ccr_id (CCR round-trip).
slm_cache_set Cache any string result the agent routes through SLM: file reads, bash output, search results.
slm_cache_get Retrieve a cached result by key. Returns hit true or false.
slm_optimize_stats Session compression and cache statistics.
Feature 01 · Semantic Cache

Semantic caching is experimental.

The exact cache is the stable path. Semantic caching is opt-in because a similarity threshold can return the wrong response. The implementation contains threshold-learning machinery, but it is not a production claim until the frozen release proves calibration, invalidation, tenant isolation, and false-hit behavior on a representative corpus.

Measured Hit and false-hit rates per corpus
Isolated Tenant and provider-aware keys
slm cache — semantic mode
# Opt-in experimental path
$ slm cache semantic on
↳ Enabled locally; this is not evidence of production precision

# Inspect the cache
$ slm cache status
Entry count, DB size, TTLs, hit rate
Feature 02 · Compression

Lossless by default, prose-only when aggressive.

Safe mode is lossless: whitespace and compact-JSON normalisation only. It never removes content and leaves code untouched, so reduction may be small or zero. Aggressive mode is opt-in and applies LLMLingua-2 to prose only, never code, numbers, structured data, instructions, or the current turn. A lossy result can be made reversible by storing its original in the CCR path and using the returned identifier before its TTL expires.

Corpus-specific Reduction may be zero in safe mode
Best-effort Byte-exact originals via CCR
slm compress
$ slm compress status
↳ Mode and per-channel state
$ slm compress mode safe
↳ Lossless normalisation (aggressive is the opt-in alternative)
$ slm compress prose on
↳ Prose compression, aggressive mode only
Feature 03 · Prefix Alignment

Stabilise prefixes, then verify provider reuse.

Alignment stabilises the prompt prefix to improve reuse of native provider prefix caching, and is on when compression is on. It helps only when the configured provider supports prompt caching and its cache conditions are met. Pricing, minimums, TTLs, and discounts belong to the provider's current contract; measure actual usage instead of publishing a fixed saving.

Provider-measured Prompt-cache eligibility and hit rate
Separated Compression and provider-cache evidence
slm optimize
$ slm wrap claude
↳ Starts the proxy, sets ANTHROPIC_BASE_URL, launches Claude Code
$ slm optimize status
↳ Show all settings (also: on, off)
$ slm optimize savings --since 7
↳ Token and cost report; compare against provider accounting

✓ No fixed hit-rate or cost multiplier without release-linked evidence
EXPLORE FURTHER

Architecture, research and installation.

Read the full technical architecture or the published research behind the memory design, then follow the installation guide and compare cache correctness, token use, latency, and provider accounting on your own workload.

★ Star on GitHub