Skip to main content
Glama

Palimpsest Memory

Palimpsest hero: layered manuscript pages with a scraped passage rewritten in teal, beside the Palimpsest wordmark, the tagline Evidence-first memory for AI agents, chips for SQLite or OpenSearch storage, hybrid BSC ranking and bounded citations, and a dot grid for 8,192-bit Binary Spatter Codes.

Persistent, scoped memory and grounded code context for AI agents — with evidence you can inspect.

Palimpsest is a memory engine for agents that work across conversations and clients. It retains what was recorded, where it came from, who may use it, and how it changed; nothing becomes durable context merely because it was said. It also indexes authorized Git repositories so an agent can request current code evidence with file, line, revision and hash citations.

Use it from Python, a local CLI, authenticated HTTP or MCP, with supported installers for Claude Code, Codex, OpenCode and Hermes. The deterministic core in local SQLite mode runs without a model or embedding API. The project is pre-1.0; treat every capability claim as tied to a specific revision.

Product tour · Getting started · Task guides · Operation catalog · Evidence and limits

What you can do

Task

Where to go

Capture a conversation turn, inspect the proposed candidate, approve or reject it

Capture and review

Correct or forget a durable record and inspect its revision history

Memory lifecycle

Search memories and understand why something was — or was not — returned

Retrieval

Recall explicitly recorded subject/relation/value associations and position-bound episode steps

Techniques

Keep bounded task context, export a handoff, resume in a later session

Sessions and handoffs

Index an authorized repository and ground a coding task in cited evidence

Code intelligence

Connect documents and Git sources with freshness checks

Connected sources

Attach Claude Code, Codex, OpenCode or Hermes over MCP

Agent setup

Browse inventory, search, proposals and the memory sphere in a local viewer

Local viewer · Brain map

Deploy, secure and recover an authenticated service

Operations · Deployment

Judge claims: implemented, fixture-verified or deployment-verified

Evidence · Acceptance matrix

These are different kinds of state. A captured source turn is evidence; a candidate is a proposal; a durable fact is a reviewed or explicitly sourced assertion; a working-session item is temporary task context. Saving any of them does not by itself make it eligible for every query. For example, an agent can capture an explicit project preference, leave it pending for review, recall the approved claim in a later conversation, cite it in a decision, and supersede it when the preference changes — the prior claim and its correction lineage stay inspectable. Repository evidence follows a separate path: changed source hashes cause stale snippets to be withheld until an explicit refresh.

Related MCP server: Sugar

Quickstart

This walkthrough uses local SQLite. It requires Git and Python 3.10+ with venv, and installs the current source checkout. For a pinned source install, check out a published release tag before installing and use its matching documentation.

If the version you want has been published, see release assets and install commands for the Python wheel, source distribution, and Linux amd64 Docker image (GHCR or offline archive). Palimpsest itself is not published to PyPI for this release. The source commands below do not require a release or registry image.

git clone https://github.com/starhound/palimpsest-memory.git
cd palimpsest-memory
python3 -m venv .venv
. .venv/bin/activate
python -m pip install '.[mcp,code,audit]'

DEMO_DIR="$(mktemp -d "${TMPDIR:-/tmp}/palimpsest-demo.XXXXXX")"
export DEMO_DB="$DEMO_DIR/memory.sqlite3"
palimpsest-cli --db "$DEMO_DB" health
palimpsest-cli --db "$DEMO_DB" ingest-turn demo-conversation session-A turn-1 \
  'Remember that Cedar | step:0 | Verify backup' --request-id demo-capture-1 \
  > "$DEMO_DIR/capture.json"
cat "$DEMO_DIR/capture.json"
palimpsest-cli --db "$DEMO_DB" candidate-list --status pending --limit 5

Capture writes immutable source evidence and a pending candidate — not a durable fact. Inspect it before deciding:

CANDIDATE_ID="$(python -c 'import json, sys; print(json.load(sys.stdin)["candidate_id"])' < "$DEMO_DIR/capture.json")"
palimpsest-cli --db "$DEMO_DB" candidate-inspect "$CANDIDATE_ID"
palimpsest-cli --db "$DEMO_DB" candidate-explain "$CANDIDATE_ID"
palimpsest-cli --db "$DEMO_DB" bsc-sequence-recall Cedar     # abstains before review

Approve only after checking that the candidate contains the synthetic statement above. If you decline it, use candidate-reject instead; rejection writes no durable fact.

palimpsest-cli --db "$DEMO_DB" candidate-approve "$CANDIDATE_ID" --request-id demo-review-1

Then recall it in a fresh process, with an unrelated negative control:

palimpsest-cli --db "$DEMO_DB" bsc-sequence-recall Cedar     # the reviewed step, with its citation
palimpsest-cli --db "$DEMO_DB" bsc-sequence-recall Unknown   # abstains

Use a disposable database while learning — never an existing production database. The review walkthrough covers the full lifecycle, and getting started separates a new local engine, attaching an agent to an existing service, and dashboard setup.

Connect an agent

palimpsest install codex --db /absolute/local/memory.sqlite3 \
  --namespace team/default --workspace project
palimpsest doctor --client codex --probe --timeout 15

Use claude for Claude Code or opencode for OpenCode. Installation preserves unrelated configuration and supports uninstall. This configures local stdio; remote authenticated HTTP/MCP and Hermes have their own setup instructions. A successful probe establishes connectivity, tool discovery and health — confirm actual recall with a known reviewed fixture in the intended client and scope.

Ground a coding task

palimpsest-cli --db "$DEMO_DIR/code.sqlite3" code_index_repository /absolute/git/repository
palimpsest-cli --db "$DEMO_DIR/code.sqlite3" \
  code_task_context /absolute/git/repository 'Registry.rotate' --max-bytes 7000
palimpsest-cli --db "$DEMO_DIR/code.sqlite3" \
  code_project_overview /absolute/git/repository --max-bytes 6000

The server must be able to read the authorized repository. Context returns revision/path/line/hash evidence; freshness detects drift; refresh updates the index. Suggested tests describe structural relationships and are not executed coverage. See the coding workflow.

Browse the dashboard

With an existing authenticated JSON HTTP engine, on its host:

palimpsest-ui --backend http://127.0.0.1:15400 --port 17840

Open http://127.0.0.1:17840 and enter the viewer's private one-time code. The backend credential stays server-side; the normal viewer session is read-only. Viewer setup · Brain-map controls and bounds.

How retrieval works

In SQLite mode, search_hybrid uses native holographic/BSC scoring by default; the HTTP/MCP path and the direct Store path share the native scorer, and no provider, vector server or rebuild step is needed to compute request-local BSC scores.

  1. SQLite selects query-supported evidence and enforces scope, visibility, provenance, lifecycle, time and conflict rules.

  2. The bounded native scorer encodes the query and eligible text into 8,192-bit Binary Spatter Codes and measures Hamming similarity.

  3. Hybrid ranking combines lexical, BSC and entity signals, with bounded rehearsal contribution.

  4. Consumers receive cited evidence or an explicit insufficient-evidence result.

Plain search (including CLI search) and search_page stay lexical. Explicit policy paths follow their declared contracts. BSC work-budget or scoring failures retain lexical order and report their status. Optional embedding reranking is a separate server configuration; it does not replace evidence admission. BSC represents deterministic token patterns and explicit structure — it is not a trained semantic model or a guarantee of paraphrase understanding. See routing, bounds and a runnable verification, diagnosing missing recall and the technique reference.

In OpenSearch authority mode, MCP memory_search_hybrid combines lexical, vector and entity candidates, reads back the current scoped records, and ranks them with those signals plus native BSC similarity. This mode requires an embedding endpoint and does not fall back to SQLite.

One authoritative backend per deployment

Choose SQLite for the default local deployment or OpenSearch for the experimental MCP authority. Each mode owns its own durable records; OpenSearch authority stores the record and its embedding together in one document.

The following diagram shows the SQLite path:

flowchart LR
    C[Agents / CLI / viewer] --> A[Python / authenticated HTTP / MCP]
    A --> S[Service: contracts and authorization]
    S --> D[Local SQLite: evidence and lifecycle]
    D --> R[Eligible retrieval candidates]
    R --> B[Default hybrid: lexical + native BSC + entity]
    R -. optional .-> E[Configured embedding reranking]
    S --> I[Derived repository index]
    B --> P[Cited results / bounded context]
    E --> P

In SQLite mode, SQLite owns facts, source/review evidence, revisions and lifecycle. Code and vector projections are derived. Similarity cannot widen permissions or revive forgotten, expired or unsupported evidence. Keep SQLite on local storage — never NFS or a shared NAS mount — and back it up. Architecture explains the request and transaction boundaries.

Storage: an honest matrix

Storage

Role

Status

Limits you should know

SQLite (default)

Authoritative in SQLite mode: facts, sources, review evidence, revisions, consent, audit, lifecycle

Current core

Local filesystem only, never NFS or a shared NAS mount; back it up

Elasticsearch / OpenSearch / MongoDB / Weaviate vector adapters

Optional derived candidate projections

Protocol fixtures verify the derived adapter contracts

Similarity never authorizes recall — SQLite eligibility still applies; switching is restart-scoped, with no backfill

Remote embedding provider

Optional vector enrichment for derived indexes

Separate configuration

Provider failure falls back to deterministic retrieval; model or dimension changes need validation

OpenSearch memory authority (--storage-backend opensearch)

A separate authority mode that opens no SQLite database

Experimental — not full parity

No retained revision history, evidence attribution, source connectors, document sync, candidate review, SQLite migrations or bundled automatic Hermes memory capture; ranking weights provisional; unsupported operations are refused, not delegated; needs a dedicated index, explicit initialization and a configured embedding endpoint

The OpenSearch authority mode is experimental and is not feature parity with SQLite. It is guarded on purpose — compare-and-swap corrections, payload-free tombstone forgets that are not proof of erasure, and refused unsupported operations. Validate the requirements and migration plan before moving a live service. Read OpenSearch as the authoritative memory backend first, and backend switching for the restart-scoped rules that govern every projection change. The adapter overview covers the derived clients.

What a graph or a test result proves

The brain map is an orbitable 3D atlas of authorized active inventory. It is a view: returned-evidence receipts describe recorded selection and citation events, not a neural network or an internal ranking traversal. Code on main, a published package and an active deployment can differ. These docs describe source behavior; check the exact installed version before relying on a feature, and use the acceptance matrix and evaluation evidence to distinguish implementation, synthetic verification, client-task results and deployment.

It provides

Do not infer

Scoped records, source linkage and revision history

Every stored claim is true or current

Deterministic retrieval and optional configured ranking

General semantic recall or a learned memory model

Bounded context and citations

Proof that using memory improves every task

Tests, evaluation reports and recovery checks

Every vendor or boot scenario has passed live acceptance

Benefit over a good summary or ordinary file tools remains task-dependent. Graph activity documents observation scope and gaps.

Documentation, development and security

Read the product tour for the complete workflow, then choose a task guide. Exact fields and replay semantics live in the operation catalog; the HTTP and Python API and optional backends have their own reference pages.

python -m unittest discover -s tests -p 'test_*.py' -q
mkdocs build --strict
python scripts/check_docs.py
git diff --check

See development prerequisites, CONTRIBUTING.md, SECURITY.md and the MIT LICENSE. Public release review is tracked in the disclosure checklist.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Gives AI coding agents persistent memory by storing observations, decisions, and learnings in a local SQLite database with vector search, full-text search, and a rules engine.
      4
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents to store, search, and recall persistent project-specific and cross-project context — decisions, preferences, error patterns, and guidelines — from a local-first SQLite memory store with semantic search, so knowledge survives across sessions. An optional companion task server lets agents queue and autonomously execute work using that same memory.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides persistent memory and local retrieval-augmented generation for AI coding agents, enabling semantic code and documentation search, lesson recording and recall, GitHub issue and PR import, and cross-project knowledge sharing.
      8
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables AI coding agents to persist typed memories, retrieve them through structured filtered queries, and rank them by usefulness from feedback. Project scoping and lifecycle hooks help maintain relevant context across sessions.
      MIT