perlith-mcp
OfficialThis server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Perlith
Persistent memory for AI agents. File-based. Git-native. Zero database.
npm install perlithPerlith gives your AI agents memory that survives between sessions. Every fact is a markdown file. Every change is a git commit. No vector database, no infrastructure, no configuration — just files on disk.
Quick Start
const perlith = require('perlith')
// Initialize an agent
await perlith.initAgent('./memory', 'my-agent')
// Store a memory
await perlith.addMemory('./memory', 'my-agent', {
layer: 'L1',
body: 'The user prefers dark mode and uses VS Code.',
tags: ['preferences', 'editor'],
})
// Retrieve memories
const config = await perlith.loadConfig('./memory', 'my-agent')
const results = await perlith.retrieve('./memory', 'my-agent', 'editor preferences', config)Related MCP server: Perenna
MCP Server
Plug Perlith into Claude Code, Cursor, or any MCP-compatible tool:
{
"mcpServers": {
"perlith": {
"command": "npx",
"args": ["perlith-mcp"],
"env": { "PERLITH_BASE_DIR": "./memory" }
}
}
}Five tools available: perlith_init, perlith_store, perlith_retrieve, perlith_list_agents, perlith_status.
How It Works
Perlith organizes memory into layers inspired by human cognition:
Layer | Purpose | Analogy |
L0 | Working memory | What you're thinking about right now |
L1 | Episodic | What happened today |
L2 | Semantic | Facts you know to be true |
L3 | Procedural | How you do things |
L4 | Archive | Things you mostly forgot |
Every memory is a markdown file with YAML frontmatter:
---
id: MEM-20260408-my-agent-0001
type: episodic
layer: L1
created: 2026-04-08T12:00:00.000Z
salience: 1.0
tags: [preferences, editor]
status: active
---
The user prefers dark mode and uses VS Code.Changes are committed to git automatically. Your agent's memory has a full audit trail — git log, git diff, git blame all work exactly as you'd expect.
Architecture
Retrieval uses a multi-stage pipeline: inverted index lookup, tag overlap scoring, salience weighting, recency decay, MMR diversity reranking, and conflict detection.
Temporal edges track how facts evolve over time. When a fact is updated, the old version is preserved with a
superseded_byedge pointing to the new one.Shared namespaces let multiple agents contribute to and read from a common knowledge base, with confidence-gated writes and conflict resolution.
Decay follows the ACT-R cognitive model — memories that aren't accessed gradually lose salience and eventually archive.
Why Files?
Most memory systems use vector databases. Perlith uses plain files because:
Auditability.
git logshows every decision your agent ever made. Try that with pgvector.Portability. Copy a directory. That's your backup. That's your migration.
Debuggability. Open a file in your editor. Read it. The memory is right there, in plain text.
No infrastructure. No Docker, no database, no connection strings.
npm installand go.
API Reference
Agent Lifecycle
initAgent(baseDir, agentId)— Create agent namespaceloadConfig(baseDir, agentId)— Load agent configurationgenerateId(baseDir, agentId)— Generate a unique memory ID
Memory Operations
addMemory(baseDir, agentId, { layer, body, tags })— Store a memoryreadMemory(filePath)— Read a memory filepatchMemory(filePath, patches)— Update frontmatter fieldsarchiveMemory(baseDir, agentId, filePath, memoryId, salience)— Archive a memorylistActiveFiles(baseDir, agentId, layers)— List active memories
Retrieval
retrieve(baseDir, agentId, query, config, taskId, redisClient, options)— Multi-stage retrieval
Activation Contract
preFlight(baseDir, agentId, query, taskId, perlith, metaDir)— Pre-task memory loadwriteL1Sync(record, config, baseDir, agentId)— Sync L1 write with fsyncpostTask(record, preFlightResult, baseDir, agentId, metaDir)— Post-task cleanup
Requirements
Node.js >= 20
Git (for automatic commit tracking)
License
Apache-2.0. See LICENSE.
"Perlith" and "Griffinley" are trademarks of Griffinley LLC.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
One memory for every AI you work with: your rules, notes and decisions in your own Git repo.
Versioned memory for agents: markdown docs with history, safe concurrent commits, human claim links.
Shared Markdown memory for your agents: docs, typed collections, files, skills and Dispatch.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Related MCP Servers
- AlicenseAqualityAmaintenanceAudit-grade, git-versioned memory for AI coding agents that enables saving, searching, editing, and rolling back facts through markdown files served via MCP.39143 PyPI46MIT
- AlicenseAqualityBmaintenanceA lightweight, Git-backed permanent memory for AI agents.321 PyPI60MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to persistently store, recall, and manage atomic markdown knowledge cards with bidirectional links across sessions. It provides MCP tools for searching, reading, writing, linking, archiving, organizing, and syncing memory via git without a vector database.9 npmISC
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to save, recall, read, list, and forget plain Markdown memories shared across tools and sessions, so facts are retrieved on demand instead of being repeated.12 npmMIT