Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
Episodic memory and architectural policy for AI agents. Frames, Atlas, and Policy.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
LEX_WORKSPACE_ROOT, LEX_MEMORY_DB, LEX_DEBUG你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"lex": {
"command": "npx",
"args": [
"-y",
"@smartergpt/lex-mcp"
],
"env": {
"LEX_WORKSPACE_ROOT": "your-value",
"LEX_MEMORY_DB": "your-value",
"LEX_DEBUG": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add lex --env LEX_WORKSPACE_ROOT=your-value --env LEX_MEMORY_DB=your-value --env LEX_DEBUG=your-value -- npx -y @smartergpt/lex-mcp运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"lex": {
"command": "npx",
"args": [
"-y",
"@smartergpt/lex-mcp"
],
"env": {
"LEX_WORKSPACE_ROOT": "your-value",
"LEX_MEMORY_DB": "your-value",
"LEX_DEBUG": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"lex": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@smartergpt/lex-mcp"
],
"env": {
"LEX_WORKSPACE_ROOT": "your-value",
"LEX_MEMORY_DB": "your-value",
"LEX_DEBUG": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
LEX_WORKSPACE_ROOT envLEX_MEMORY_DB envLEX_DEBUG env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
注册名称已通过 GitHub 账户 Guffawaffle 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(1.0.2)于10个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
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.
Work happens → Lex remembers what mattered → the next session continues
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.
lex remember \
--summary "Kept authentication token validation in API middleware" \ --next "Add the service grant and rerun tests" \ --modules unscoped \ --blockers "Missing PermissionService grant"
lex recall "authentication"
lex context "authentication" --max-tokens 500
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.
Decision: token validation belongs in API middleware
Blocker: the service grant is still missing Next: add the grant and rerun the authentication tests
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:
Read https://github.com/Guffawaffle/lex/blob/main/docs/agent-evaluation.md and evaluate this
repository against it. Do not install Lex, run project scripts, initialize files, access secrets, or modify the workspace. Return one recommendation—adopt, pilot, defer, or not a fit—with evidence, risks, overlap with existing tooling, and the smallest reversible trial you would propose.
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 and verify the bundled SQLite binary. Lex 4.4.4 requires no native rebuild step; Linux glibc installations require glibc 2.35 or newer.
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 npx @smartergpt/lex remember \
--reference-point "Lex pilot" \ --summary "Evaluating whether durable agent handoffs help this repository" \ --next "Recall this checkpoint in a new session" \ --modules unscoped
LEX_STORE=sqlite prevents existing PostgreSQL configuration from redirecting the pilot into a shared store.
LEX_STORE=sqlite npx @smartergpt/lex recall "Lex pilot"
LEX_STORE=sqlite npx @smartergpt/lex context "Lex pilot" --max-tokens 500
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.
lex remember \
--reference-point "Authentication refresh" \ --summary "Moved token validation into API middleware" \ --next "Add password-reset coverage" \ --modules "services/auth,api/middleware" \ --blockers "Need PermissionService access"
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:
lex remember \
--summary "Finished context wiring" \ --next "Run validation" \ --modules auto
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:
lex recall --list 5 --summary
lex --json context --branch main --limit 5
Learn the continuity workflow
| 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:
| Project | Responsibility | Relationship |
|---|---|---|
| Lex | Durable work context, repository policy, optional neighborhood context, instructions, and scoped Frame storage | Core library and CLI |
| AXF | Inspectable workspace capabilities and their execution boundaries | Independently usable; composes with Lex |
| LexRunner | Fanout, attempts, worker/workspace coordination, verification, and merge-weave | Consumes Lex for continuity |
| Lex-MCP | Thin MCP transport for Lex capabilities | Pins the matching Lex release |
| LexSona | Behavioral constraints derived from personas and reviewed rules | Integrates through Lex storage contracts |
The short version: Lex remembers and explains; AXF exposes capabilities; LexRunner coordinates work; Lex-MCP transports Lex over MCP; LexSona derives behavior constraints.
Lex exposes the same core through several entry points:
@smartergpt/lex-mcp or the embeddable server exportFrame Schema v8 is the current canonical Frame contract. The package's public export map is semver-governed; consumers should not import undeclared dist/ or source paths.
CLI output contract · MCP tools · Public package entry points · Contract surface
| If you are… | Read… |
|---|---|
| Deciding whether Lex fits | Agent Evaluation |
| Trying Lex for the first time | Quick Start |
| Designing agent handoffs | Agent Continuity |
| Connect
只显示了开头部分;其余内容请在仓库中阅读