
Lexicon
io.github.ashlrai由 GitHub 账号 ashlrai 发布v0.5.4更新于 Nov 10, 2026
Fixes the names and jargon speech-to-text gets wrong before your agent acts on a dictated prompt.
概览
Lexicon 在 AI 代理读取语音转写之前改写文本,纠正听错的专有名词和术语。
- 可以做什么
- 纠正一段听写文本,返回修正结果、是否发生变化,以及每处替换的原因和置信度
- 记录用户刚做出的纠正,或添加带别名和读音提示的词条
- 预览并应用词库初始化,并运行结构化健康检查
- 把服务器安装到 Claude Code、Codex、Cursor 等受支持客户端,写入前先预览
- 在明确信任后合并项目级词库文件
- 适用场景
- 适合经常向编程或聊天代理口述提示词、而代理总是听错公司名、产品名或 Kubernetes、PostgreSQL 等技术术语的场景。它在转写生成之后运行,因此是听写应用的补充而非替代。
- 运行要求
- 以本地 stdio 进程运行,通常通过 npx 配合 Node 20 或更高版本,或全局安装。可选环境变量 LEXICON_CWD 和 LEXICON_PATH 分别指向项目级和全局词库 YAML 文件。无需账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Lexicon,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Lexicon
Speech-to-text gets English right and your names wrong.
Lexicon is one YAML file of the words you actually say. It rewrites the transcript before an agent reads it. It is not a dictation app.
[](package.json)Live demo · Docs · llms.txt · llms-full.txt · lexicon.ashlr.ai
Start here (60 seconds)
Agents are first-class users. One command checks for Node 20+, installs the CLI, and runs lexicon setup when it has a terminal. Without a terminal (CI, a Dockerfile), under sudo, or with LEXICON_NO_SETUP=1, it only installs and ends with run: lexicon setup.
No global install:
Do not install it unasked. Preview the plan, show it, then apply. --dry-run writes nothing. Stdout is one JSON document. Read ok first.
--packs, --harvest and --serve stay opt-in even with --yes, because each writes a lot or installs a service.
Correct one sentence. With no lexicon of your own, arguments (not piped input) are corrected against a built-in example, and stderr says so. Nothing is written.
example: true means those terms are the built-in sample, not the user's file yet.
Add the spelling, still as JSON:
When the user corrects you, record it. --dry-run writes nothing.
Check the install. Read ready, summary and nextStep.
The same contract, in one fetch: llms.txt (index) and llms-full.txt (install, tools, privacy, FAQ). The page written to an agent is docs/AGENTS.md. Copy-paste only, no commentary: docs/COPY-PASTE.md.
This tree is source version 0.5.9. At this candidate's 2026-11-06 preparation, npm latest was 0.5.8. Check lexicon --version and npm view @ashlr/lexicon version before you pin.
MCP server
Preview, then write. Without --apply, nothing is written. --json returns { ok, client, scope, applied, written, output }.
Paste these only when lexicon-mcp is already on PATH (a global install). lexicon install writes the path that matches how Lexicon was installed, which is the safer call.
Claude Code, Cursor (~/.cursor/mcp.json), and any other client that reads mcpServers:
Codex (~/.codex/config.toml):
Claude Code also gets a SessionStart hook and a UserPromptSubmit hook from lexicon install claude --apply. Restart the client after --apply. Cursor needs a window reload.
Environment variables the server reads (LEXICON_PATH, LEXICON_HARVEST_ROOTS, LEXICON_REGISTRIES and the rest): docs/MCP.md.
These calls cover almost every session. The server has twenty-one MCP tools, three resources and two prompts. The full table is docs/MCP.md.
normalize_transcript { text }corrects a dictated string and returnsoutput,changedandreplacements.learn_correction { heard, meant }records a correction the user just made.add_term { canonical, aliases?, phonetic? }adds a spelling. Omitaliasesand the server proposes the mis-hearings.setup_lexicon { apply? }returns a plan and writes nothing untilapply: true.lexicon_doctor {}is the structured health check. Readready,summaryandnextStep.
setup_lexicon, install_client and trust_project preview first. Do not set LEXICON_TRUST_ALL=1 on a user's behalf.
Plugin, if you would rather not install a CLI:
How it works
Exact alias first, then double-metaphone phonetic, then Damerau-Levenshtein fuzzy above a confidence floor. Exact hits win the span. Matches never overlap. A stoplist of common English words blocks phonetic and fuzzy guesses, but explicit aliases override it. Per-term never lists and protectedWords also restrict replacements; code spans, URLs, emails and paths are skipped by default. Every replacement reports reason and confidence.
The same sentence, as a person would read it. Replacements go to stderr. The corrected line is stdout.
Rules: docs/MATCHING.md.
What you get
- One file,
~/.config/lexicon/lexicon.yaml. Project.lexicon.yamlmerges only afterlexicon trust. - Twenty-one MCP tools for Claude Code, Codex, Cursor, Windsurf, Gemini CLI, VS Code and Claude Desktop.
- A CLI with 29 commands.
lexicon --helplists them.docs/CLI.mdis generated from that help. - 271 terms across the nine packs (developer, AI, business, voice tools, cloud and DevOps, legal profession, law and litigation, Ashlr.AI fleet, architecture). Community packs install from a registry after a checksum preview.
- Sixteen export formats and eight importers, including Wispr Flow, Superwhisper, macOS Text Replacement and espanso.
lexicon exportwith no format lists them. - Correction in supported browser composers, eligible macOS text fields, and your own pipeline (
normalize()). LexiconBar requires Accessibility access and skips secure fields and apps without suitable Accessibility text support; see its limitations.
Try it in the browser. The matcher runs on the page. The Dictate button uses the browser's speech recognizer, which in Chrome sends audio to Google.
Watch the terminal setup recording. It shows version 0.5.1; use the current CLI reference for today's prompts and flags.
Which of those exist on Windows and Linux: docs/PLATFORMS.md.
FAQ
Why does dictation get my company name wrong?
The name is out of vocabulary. The recognizer picks the nearest common-sounding sequence it does know. "Ashlr.AI" becomes "Ashler". "Kubernetes" becomes "Cuban eats". The audio was fine. The vocabulary was missing. Lexicon maps the spelling you got back to the one you meant.
How does an agent install it?
curl -fsSL https://ashlrai.github.io/lexicon/install.sh | sh, or npx @ashlr/lexicon@latest setup. Preview with lexicon setup --dry-run --json. The script runs setup only in a terminal. Under sudo, without a terminal, or with LEXICON_NO_SETUP=1, it prints run: lexicon setup.
Does this replace Wispr Flow or Superwhisper?
No. It runs after whatever produced the transcript, and it exports into those dictionaries: lexicon export wispr, lexicon export superwhisper, lexicon export macos. lexicon import reads them back.
Is the transcript sent anywhere?
Ordinary correction is local. There is no account, no sync and no telemetry. The CLI, hooks, MCP server, loopback API and extension do not send transcripts to a remote service. Three features use the network, and only when you turn them on: lexicon voice downloads a whisper.cpp model the first time (audio stays on the machine), lexicon pack fetches a community pack from a registry URL you choose, and the GitHub source in lexicon import --guided calls the GitHub API through your existing gh login. Email and chat are not imported. Threat model: SECURITY.md.
What does it cost?
Nothing. MIT license. No paid tier.
More answers: docs/FAQ.md.
Measured
On 330 clips of synthesized speech through whisper.cpp small.en (three voices, the same 70-term lexicon in every row), Lexicon recovered 91.0% of the proper nouns. Raw whisper.cpp recovered 45.9%. Clean prose wrongly changed: 0 of 72. The audio is macOS text-to-speech read into whisper.cpp, cleaner than a phone microphone. Method, the other rows, and every failing case: docs/BENCHMARK.md. Reproduce with npm run bench:audio (see audio benchmark setup).
Other installs
Plain brew install lexicon is dns-lexicon, a different project. Use the full tap name.
After 0.5.9 is published, npm i -g github:ashlrai/lexicon#v0.5.9 installs that tag from GitHub and builds on install.
Homebrew formula: ashlrai/homebrew-tap. Release zips (extension, LexiconBar, checksums): GitHub releases.
lexicon doctor --fix previews safe repairs and writes nothing. lexicon doctor --fix --apply makes them, after a backup. Details: docs/doctor-fix.md.
Docs
Changing the code: CONTRIBUTING.md, docs/ARCHITECTURE.md.
Lexicon is one of the open-source tools from Ashlr.AI. It does not need the others to run. How it sits next to Phantom: docs/PHANTOM-USAGE.md.
Pellucid is now part of lexicon. Pellucid's ambiguity engine - the INCOSE rule layer, span resolution and confidence calibration - lives in src/ambiguity/. The two-stage design it feeds is in docs/design/two-stage-correction.md.
Roadmap and non-goals
This is not a dictation app. There is no hosted account and no sync. It is a file.
- The extension installs from the release zip. It is not in the Chrome Web Store or on Firefox Add-ons yet.
- LexiconBar is ad-hoc signed, not notarized. The first launch needs right-click and Open.
- Linux has no tray app. The Windows tray app is built and unit-tested, and it has never been run on Windows: docs/WINDOWS-APP.md.
- Double metaphone is tuned for English. Names in other languages fall back to fuzzy matching.
- The audio benchmark is text-to-speech read into whisper.cpp, not a phone microphone.
Star Lexicon
If this stopped an agent from shipping the wrong name, star the repo. That is how the next person who dictates a company name finds it.
Star ashlrai/lexicon on GitHub
Found a name it gets wrong? Open a misheard term issue.
License
MIT. Copyright 2026 AshlrAI, Inc.
来源:README.md,提交 df2eb57
工具
0版本历史
1- v0.5.4最新Sep 28, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分