🧠 Frames
Timestamped work session snapshots with summary, blockers, next action, and module_scope.
Stored locally in SQLite. Indexed by the same module vocabulary used in policy. Designed to be small, explicit, and agent-friendly.
Lex is the open-source memory + policy engine in the smartergpt stack. It combines architecture policy-as-code with episodic memory (Frames) and Atlas Frames so you can ask "why is this blocked?" and get receipts from timestamped sessions, not vibes.
Transport: MCP stdio • Storage: Local SQLite • Telemetry: None
Timestamped work session snapshots with summary, blockers, next action, and module_scope.
Stored locally in SQLite. Indexed by the same module vocabulary used in policy. Designed to be small, explicit, and agent-friendly.
Fold-radius neighborhoods (default 1) around touched modules to keep context precise and small.
When you recall a Frame, you can also recall its neighboring modules—just enough context, not the whole repo.
Machine-readable boundaries in lexmap.policy.json: ownership, allowed/forbidden edges, flags, permissions.
Lex surfaces policy violations as first-class data in Frames and CLI output.
Describes architectural boundaries: which modules exist, who owns them, what edges are allowed or forbidden.
Describes workflows and expectations: what kinds of work exist in this repo, what inputs they expect, and which policies apply.
Together they form the contract surface that agents, CI, and runners consume. lex.yaml is intent-level—it does not describe how any runner implements orchestration.
Lex is the part that knows what you said is allowed, what actually happened, and why something is blocked. Anyone can build an executor that consumes lex.yaml; LexRunner just happens to be the one we are building first.
Lex 2.0.0 is the AX‑native release that matures agent experience guarantees: structured AX errors, Frame Schema v3, CLI improvements, and a behavioral socket for LexSona integration.
Frames, Atlas Frames, lexmap.policy.json, and lex.yaml form a stable, documented surface for agents and runners.
Commands like lex remember, lex recall, and lex check are shaped for automation: JSON output, schema-checked payloads, and consistent status fields.
Violations, ownership, and module IDs line up across policy files and Frames, so answers always come with receipts.
Attach images to Frames (base64-encoded with MIME type). Uses Sharp for image processing.
Local-first persistence with better-sqlite3. No cloud dependencies, no telemetry. Full control over your data.
Included schemas: profile.schema.json, feature-spec-v0.json, cli-output.v1.schema.json for validation and tooling integration.
The surprising part of Lex 1.0.0 is not the version number; it is how quickly we moved once we stopped treating Lex as "just memory" and started treating it as the contractual backbone of the stack.
lexmap.policy.json), and contracts (lex.yaml).We do not present the GitHub throttling as "look how hardcore we are." We present it as evidence that the architecture works, and as a reminder that responsible velocity means respecting platform limits and leaning on coding agents intelligently, not just pushing harder.
Frames use the same module IDs as policy and the same workflow names as lex.yaml. Assistants and tools can cite which policy rule was violated, which Frame observed it, and which workflow it is blocking.
That's explainable recall with receipts, not guesses.
Local SQLite. No cloud dependency. MCP stdio transport so agents can talk to Lex like any other tool. No telemetry; your history stays on your machine.
v2.0.0 released! Available on npm as @smartergpt/lex. AX guarantees are stable and documented — see AX Contract & Frame Schema v3. Lex now exports a LexSona behavioral socket for persona integrations. Recent private work (LexSona 0.2.0) adds offline-capable persona modes that can run with limited memory availability; standalone LexSona packages and deeper integrations remain controlled-access.
Node ≥20 • MIT Licensed
Install globally for CLI access or as a dependency for programmatic use.
# Global install (CLI)
npm install -g @smartergpt/lex
# Or as a project dependency
npm install @smartergpt/lexAfter installation, run npx lex init to set up your workspace, then use lex remember, lex recall, lex check, lex instructions and more. For AX details see AX Contract v0.1.
See the GitHub repo for full documentation and examples.