-
Notifications
You must be signed in to change notification settings - Fork 4
Word Graph
Language: English · 简体中文
The Word Graph reveals shared vocabulary across a bounded sample of Wiki Pages and Sources. If Page A and Page B both contain a selected term, the graph connects both documents through that term node.
It is a discovery view, not a corpus-wide word index and not a semantic graph. A shared word proves sampled occurrence only; it does not prove equivalence, causality, or dependency.
Use the Word Graph when a focused search finds several documents and you need to see:
- which vocabulary connects the result set;
- which Pages and Sources share a product name or technical term;
- which document deserves full inspection next;
- whether a mixed Chinese and English vocabulary cluster exists in the sample.
Skip it for a known Page or Source, an exhaustive frequency study, or code structure. Use Page/Source reads, external analysis, or CodeGraph instead.
Token density grows much faster than document count. Building a browser graph for every token in a real Wiki would consume excessive database time, response bytes, layout work, and memory while producing an unreadable hairball.
LWC uses a query-first bounded pipeline:
focused query
-> FTS candidate selection
-> one page of documents
-> bounded metadata and passage samples
-> shared-term selection
-> bounded term-document graph
The full vocabulary is never returned. Pagination changes the document sample instead of expanding one unbounded graph.
| Budget | Maximum |
|---|---|
| Searchable query terms | 8 |
| Documents per sample page | 25 |
| Selected terms | 30 |
| Passage samples per document | 4 |
| Inspected text across the sample | 4 MiB |
| Nodes | 200 |
| Edges | 500 |
| Pagination offset | 10,000 |
| Metadata sample per document | 16 KiB |
Requests above supported document, term, or offset limits are clamped and reported through truncation_reasons. Empty queries and queries with more than eight searchable terms are rejected.
These limits are correctness contracts, not UI suggestions. A client must not try to bypass them by issuing an all-corpus request.
- LWC tokenizes the focused query with the same deterministic search rules used by the Wiki.
- Indexed Page and Source candidates are selected by FTS rank, with stable type and identifier tie-breakers.
- At most 25 documents are retained for the requested offset.
- For each document, LWC inspects bounded title, summary, and path metadata plus at most four active passage spans.
- Query terms present in the sample are retained first.
- Additional terms must occur in at least two sampled documents. They are ordered by sample document frequency, then sample occurrences, then lexical order.
-
SAMPLE_CONTAINSedges connect selected terms to sampled documents and report sample occurrences.
This process is deterministic for the same canonical Wiki state, query, limits, and offset.
Start the local read-only Viewer:
lwc --scope project viewUse --no-open when browser launch is unwanted:
lwc --scope project view --no-open --port 0Open Word graph, enter a focused query with at most eight searchable terms, and submit it. The graph stays empty until a query is submitted.
Use Previous and Next to inspect another bounded 25-document sample. Do not interpret a later page as an extension of one global graph; each page is its own sample window.
The response includes:
- normalized
query_terms; - document and term nodes;
-
SAMPLE_CONTAINSedges with sample occurrence counts; -
has_morefor another document page; -
truncatedandtruncation_reasons; - enforced
limits; -
diagnosticsfor inspected documents, spans, bytes, and tokens.
Common truncation reasons include document pagination, requested-limit clamping, metadata or byte budgets, selected-term limits, and edge limits. They describe the sample boundary; they are not errors to suppress.
The Viewer uses a bounded GET endpoint:
/api/graphs/words?query=projection&limit=25&term_limit=30&offset=0
The endpoint is read-only. It does not enable the document graph, build a CodeGraph index, refresh Sources, or mutate Wiki content. Unsupported write methods are rejected.
- Open the full Page or Source before promoting a visible relationship to a durable claim.
- A high sample occurrence count is not a corpus-wide frequency.
- A missing term may have fallen outside the selected sample, passage, byte, term, or edge budget.
- CJK and Latin tokens follow deterministic LWC tokenization; they are not dictionary-derived concepts.
- Use explicit document-graph relations only after evidence proves a semantic relationship.
A Word Graph investigation is complete when:
- the query is focused and within eight searchable terms;
- the enforced limits and offset are recorded;
- pagination was used instead of requesting the whole corpus;
-
has_more, truncation reasons, and diagnostics were considered; - important connections were verified against full documents;
- sampled co-occurrence was not misreported as semantic fact.
Next: Tags and strong context
LWC Wiki
- Home · 首页
- Project overview · 项目简介
- Basic concepts · 基本概念
- Use cases · 应用场景
- Installation and upgrades · 安装与升级
- Quick start · 快速开始
- Persistent memory · 持久记忆体系
- Agent workflow and memory policy · Agent 工作流与主动记忆策略
- Sources and ingestion · 来源与知识整合
- Wiki pages and provenance · Wiki 页面与来源证明
- Search and context · 搜索与上下文载入
- Document knowledge graph · 文档知识图(记忆图网)
- Code graph · 代码图
- Word graph · 词图
- Tags and strong context · 标签与强上下文
- Document conversion · 文档转换
-
MCP server and
lwc_explore· MCP 服务与lwc_explore - Skills, Hooks, and Instructions · Skills、Hooks 与 Instructions
- AgentTarget installation · AgentTarget 安装与集成
- Changesets · Changeset 原子变更
- Work system · Work 任务系统
- Checkpoints and rollback · Checkpoint、恢复与回滚
- Read-only Viewer · 只读可视化界面
- Architecture overview · 总体架构
- Storage and data model · 存储与数据模型
- Retrieval and indexing · 检索与索引设计
- Graph projection and performance · 图投影与性能设计
- MCP, Hooks, and AgentTarget design · MCP、Hook 与 AgentTarget 设计
- Safety and trust boundaries · 安全模型与信任边界
- Maintenance and diagnostics · 维护与诊断
- Troubleshooting and FAQ · 故障排查与常见问题
- Migration and compatibility · 迁移与版本兼容
- Support and issue reporting · 获取帮助与问题反馈
- CLI and configuration reference · CLI 与配置参考
- JSON output and error contract · JSON 输出与错误契约
- Limits and glossary · 系统限制与术语表
- Contributing and development · 贡献与开发指南
- Testing and release process · 测试与发布流程
- Wiki style guide · Wiki 编写规范