memory-layer

memory-layer is a skill for Claude Code, Codex from GeneGulanesJr/LaPis. It costs 29 tokens per session (4,136 once invoked), scanned A, original, MIT.

A standalone persistent memory system for the Pi coding agent, using a local SQLite database to store searchable memories and code and document indexes.

In plain words
What is it for?
Use it to save, search, update, and remove observations; inspect code structure and dependencies; find documentation; and recover unfinished sessions.
Why use it?
It lets the agent recover useful project knowledge across sessions without relying on cloud services, Python, or API keys.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/genegulanesjr/lapis/memory-layer
Any agent
npx skills add GeneGulanesJr/LaPis --skill memory-layer
Clone the repo
git clone --depth 1 https://github.com/GeneGulanesJr/LaPis

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/genegulanesjr/lapis/memory-layer.svg)](https://agentmods.dev/skills/genegulanesjr/lapis/memory-layer)
Your own site
<a href="https://agentmods.dev/skills/genegulanesjr/lapis/memory-layer"><img src="https://agentmods.dev/badge/skills/genegulanesjr/lapis/memory-layer.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,136 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.04136
Opus 5 $0.00015 $0.02068
Sonnet 5 $0.00006 $0.00827
Haiku 4.5 $0.00003 $0.00414

Measured 6d ago against content hash bb89fbc01527, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

memory-layer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/memory-layer/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pi Memory Layer v6.2

Persistent memory via a single SQLite database (~/.pi/memory/memory.db). All operations through memory-store.js — zero Python dependency, zero MCP servers. Code parsing uses web-tree-sitter (WASM) in-process. Code analysis (imports, call graph, complexity, dead code, churn) and doc indexing (markdown sections, links, glossary, code examples) built in — no external tools needed. Optional HTTP server for programmatic access to the Aurex domain (missions, milestones, working units) and code analysis endpoints.

CLI Quick Reference

Session lifecycle

  • session-start --project NAME → auto-recovers incomplete sessions, returns { sessionId, recoveredSession }
  • session-end --id INT --memories INT [--auto] → trust-recovery + close

LaPis install/update

  • Install: pi install git:github.com/GeneGulanesJr/LaPis
  • Update: pi update --extensions or pi update --extension git:github.com/GeneGulanesJr/LaPis
  • Restart/reload Pi after updating so the refreshed prompt and extension resources are loaded

Observations

  • save --title TEXT --content TEXT [--type TYPE] [--project NAME] [--scope project|personal] [--topic-key KEY] [--session-id ID] [--force]
    • Dedup pipeline: trigram overlap checked against existing observations of the same type+project.
    • ≥85% overlap → auto-merges (keeps new, soft-deletes old, records observation_relations).
    • 60-84% overlappotential_duplicate warning, lists matching IDs.
    • Use --force to bypass dedup entirely.
  • update --id INT [--title TEXT] [--content TEXT] [--type TYPE] [--scope SCOPE] [--topic-key KEY]
    • Update an existing observation in-place by ID. Only provided fields are changed.
    • Use instead of saving a correction entry to avoid duplicate/misleading memories.
  • delete --id INT
    • Soft-delete an observation by ID. The memory is marked deleted but can be recovered.
    • Use to clean up stale, incorrect, or superseded memories.
  • search --query TEXT [--project NAME] [--type TYPE] [--scope SCOPE] [--limit N] [--session-id ID]
    • Hybrid ranking: FTS5 relevance × recency × trust × recall history.
    • Recall auto-logged when --session-id is provided.
    • Results include _score for transparency.
    • --include-code flag returns both memories AND indexed code symbols.
  • get --id ID — Read full memory details. In the Pi tool, memory-get rejects project-scoped memories from another project unless allow_cross_project=true is set, to avoid accidentally pulling stale or unrelated context.
  • context --project NAME [--limit N] [--session-id ID] [--topic-key KEY] [--query TEXT] [--deep true]
    • Priority-weighted: decisions/architecture first, then bugfixes/patterns, then discoveries.
    • Includes cross-project personal-scope observations.
    • Excludes skill type from project context.

Read the full file on GitHub · 277 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 277 lines · 29 tokens per session scan A bb89fbc01527

Subscribe to this mod's changes

memory-layer is a skill published in the GitHub repository GeneGulanesJr/LaPis (43 stars, last pushed 3d ago), licensed MIT. It adds 29 tokens to every session and 4,136 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

brainctl

Unified agent memory CLI — read, write, search, and maintain the shared memory spine (brain.db). Use for persistent cross-session memory, knowledge graph, event logging, decisions, affect tracking, and consolidation.

TSchonleber/brainctl · 45 tokens

memory-compounding

Review and sharpen persistent memory so it compounds instead of accumulating. Use when pruning pi-hermes-memory entries, doing monthly memory hygiene, or when the same lesson has been recorded multiple times.

romiluz13/auto-pi · 41 tokens

session-handoff

Hand off work to another Pi session — write a handoff doc, save key decisions to memory, and notify the target session via intercom. Use when a session is getting long, when you need to continue work in a fresh context, or when transferring work between projects/sessions. Composes handoff.ts (doc writer) + memory…

romiluz13/auto-pi · 83 tokens

memory-manager

Persistent project memory using SQLite + FTS5 + BM25. Fast, zero dependencies (stdlib only), production-ready. Progressive disclosure with 3 layers (compact/index/detailed).

buiphucminhtam/forgewright · 39 tokens

build-with-tinybase

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, configuring browser or database persistence, configuring MergeableStore…

tinyplex/tinybase · 76 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens