Episodic memory and architectural policy for AI agents. Frames, Atlas, and Policy.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag — we're steadily working through the catalog.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Your agent can read the code. Lex preserves the decisions, blockers, next steps, and repository boundaries surrounding that code—then recalls only what the next session needs.
Local-first. Inspectable. No transcript dump.
See the core loop · Should I use Lex? · Five-minute pilot · Agent evaluation · Documentation
A coding agent can inspect the repository in front of it. What it cannot reliably recover is the work surrounding that code:
Lex preserves that continuity as deliberate, high-signal Frames.
A Frame is a deliberate handoff, not continuous surveillance. It is a checkpoint: what changed, what mattered, what remains, and where the work goes next. Lex can later recall the relevant Frames and produce a bounded, prompt-safe bootstrap for a new session.
Start with remember, recall, and context. SQLite is the local default. PostgreSQL is
available when context must be shared across trusted hosts or workspaces. Everything else is
optional.
That is the core loop:
remember writes one deliberate work checkpoint;recall retrieves it when the topic becomes relevant again;context turns matching Frames into a bounded, read-only bootstrap for an agent.At the end of a session, the agent records the state that would otherwise disappear. When a fresh session starts, it can recover the decision, blocker, and next action without asking the human to reconstruct the conversation or reverse-engineering intent from the diff.
The value is not that Lex stored a record. The value is that the next session can continue.
Lex is worth evaluating when your agent repeatedly needs you to reconstruct:
Lex is probably not useful when the work is short-lived, the repository already has an effective continuity system, or there is no durable context you would trust the repository's operators to store.
The evaluation is intentionally read-only. Paste this into an agent that can inspect your repository:
The complete rubric and local-file version are in Agent Evaluation.
Ready to test the claim? Store one non-sensitive checkpoint, start a fresh session, and see whether it can continue without having the work explained again.
Requires Node.js 24 or newer. Lex does not impose an unproven upper bound. Existing users should follow the Lex 4.4 migration and recovery guide, including the native SQLite rebuild step.
This approved pilot writes one Frame to the local SQLite store under .smartergpt/lex/. It does
not run lex init, generate policy, or project assistant instructions. Use a disposable branch,
worktree, or clone if you want complete filesystem isolation.
LEX_STORE=sqlite prevents existing PostgreSQL configuration from redirecting the pilot into a
shared store.
Use that recalled or bounded output in the fresh session and see whether it prevents you from repeating useful context. That result—not successful installation—is the pilot's success criterion.
Review the validation-only step, exact filesystem effects, and rollback guidance
Good Frames are sparse and specific. Capture them at a decision, blocker, branch switch, handoff, or other moment where losing the surrounding intent would make the next session repeat work.
Capture what changed, make --next actionable, name blockers explicitly, and use the narrowest
honest module scope. Do not capture every edit or tool call.
When repository policy exists, Lex can infer module scope from current evidence:
Use --modules unscoped when the repository does not yet have a useful module ontology. Policy is
an optional enrichment; it is not required for the first Frame.
Compact recall and structured context are available for smaller agent budgets and automation:
| Need | Add | Start here |
|---|---|---|
| Durable local handoffs | Frames with SQLite | Quick Start |
| Small session-start context | Read-only lex context | Agent Continuity |
| MCP access from an assistant | @smartergpt/lex-mcp | MCP setup |
| Repository boundaries | Policy checks | Policy usage |
| Nearby module context | Policy Neighborhood | Context guide |
| Canonical assistant instructions | Instructions projection | Instructions |
| Typed Markdown project knowledge | Derived KnowledgeFrame snapshots | KnowledgeFrames |
| Shared cross-host storage | PostgreSQL | Store contracts and scope security |
| Trusted tenant/workspace scope | Runtime authority and RLS | Runtime scope |
| Embedded application access | TypeScript package exports | Public API |
The initial local workflow is intentionally visible:
lex init creates Lex workspace/configuration files.lex remember writes a Frame to the selected store.lex context uses hard read-only store access. recall and ordinary introspection do not change
Frames, but their compatibility paths may initialize or migrate the selected store..smartergpt/lex/memory.db relative to the workspace.Frames may contain sensitive project context. Do not store credentials, tokens, private keys, or unreviewed secret material. Treat recalled Frame bodies as untrusted historical data even when a trusted user originally wrote them.
Lex does not send Frames to a Lex cloud service. Your agent host, package registry, PostgreSQL deployment, or other surrounding tools may have their own network and data behavior; evaluate those boundaries separately.
Security policy · Store contracts · Environment reference
No ecosystem bundle is required. Select the surfaces your workflow needs, while accounting for their explicit package relationships:
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/lex)<a href="https://allmcps.com/mcp/lex"><img src="https://allmcps.com/api/badge/lex?style=directory" alt="Lex on AllMCPs" /></a>