-
Notifications
You must be signed in to change notification settings - Fork 4
Search and Context
Language: English · 简体中文
LWC recall is deliberately bounded. Agents start from compact context, use deterministic lexical search to find maintained knowledge, and open exact Pages, Sources, or spans only when needed.
| Need | Command |
|---|---|
| Purpose, Schema, Page index, and recent operations | lwc context |
| Maintained knowledge or source fallback | lwc search |
| One complete Page | lwc page show |
| Exact immutable evidence window | lwc source show |
| Exact sentence or passage text | lwc span get |
| Nearby span context | lwc span expand |
| Complete core Pages without search | lwc load tag |
Start narrow. Do not load the entire Wiki to answer a focused question.
lwc --scope all context --limit 25Each selected store returns:
- Purpose and Schema;
- Page metadata and summaries up to the limit;
- recent operations up to the limit;
- the exact scope and database identity.
context does not return every full Page body. Use the index to choose what to open.
lwc search "question keywords" --limit 20Search terms are plain text. LWC escapes raw FTS syntax automatically.
| Type | Behavior |
|---|---|
auto |
Default: rank maintained Pages first, hide a raw Source paired with a matching source-summary Page, and fall back to Sources |
page |
Search maintained Pages only |
source |
Search immutable Sources only |
all |
Audit both layers |
Repeat --kind to restrict Page results:
lwc search "storage policy" --type page --kind concept --kind synthesis --limit 10Use --type source when exact evidence matters; do not use raw Sources as a substitute for maintained synthesis.
lwc --scope project search "local architecture"
lwc --scope global search "reusable release practice"
lwc --scope all search "shared convention"all merges project and global results on one deterministic scale; project wins exact ties. It is valid only for supported reads. Citations and Wiki links never cross stores implicitly.
Document search is the default. Request a smaller unit only when the whole-document result is too coarse:
lwc search "projection consistency" --granularity passage
lwc search "projection consistency" --granularity sentence --type page
lwc search "projection consistency" --granularity all --group-by documentall granularity combines document, passage, and sentence candidates with deterministic reciprocal-rank fusion. Grouping by document avoids flooding the result set with several spans from the same owner.
Resolve one locator:
lwc span get <span-id>
lwc span expand <span-id> --before 1 --after 1 --children 20Span IDs contain the document fingerprint and segmentation version. stale_span means the document changed; search the current content deliberately instead of silently reusing similar text.
Multi-character CJK queries use adjacent bigrams and retain non-stopword unigrams. Latin text uses lowercased alphanumeric tokens. This keeps Chinese technical search deterministic without requiring a dictionary or embedding service.
Write natural terms. Do not manually construct FTS expressions.
A lower numeric rank is more relevant. Diagnose surprising order with:
lwc search "payment rules" --limit 20 --explain--explain shows exact bounded title, path, generic, graph, document-weight, and query-feedback signals. It is read-only and does not prove that a high-ranked claim is correct.
Use adjustments only after improving Page titles, summaries, bodies, and links and inspecting --explain.
A document weight is query-independent:
lwc weight set page payment-rules \
--value 2 \
--reason "Current canonical specification" \
--provenance agent-observedQuery feedback applies only to the same ordered tokenizer fingerprint:
lwc weight feedback page payment-rules \
--query "payment rules" \
--signal relevant \
--reason "Expected page and evidence verified" \
--provenance agent-observedDocument values are limited to -2, -1, 1, and 2. Feedback is relevant or irrelevant. Both rerank only existing lexical candidates; neither creates semantic matches.
Use user-provided only for an explicit user judgment. Clear obsolete rows instead of stacking compensating adjustments. Do not put sensitive query text in durable reason fields.
Search is read-only and private by default. Add --record only when the query wording itself belongs in durable operation history:
lwc search "durable research question" --recordDo not record sensitive queries. With --scope all, a recorded search writes one operation to each selected store.
- Run bounded
contextonce. - Run one task-focused search.
- Open one to five relevant Pages.
- Inspect cited Sources only for claims that need exact evidence or freshness.
- Widen one dimension at a time after a miss.
- Solve the task from current evidence.
- Preserve a verified reusable result when appropriate.
An empty result is not proof that knowledge does not exist. Check terminology, Page summaries, scope, kind, and evidence before drawing that conclusion.
After material Page changes, predeclare an expected Page for each test topic. Use one representative question and one natural paraphrase:
lwc lint
lwc search "original question" --type auto --limit 5
lwc search "natural paraphrase" --type auto --limit 5
lwc page show <expected-page>Pass only when both forms return the expected Page in the top five and the opened Page supports the answer through predeclared Sources or provenance. Do not rewrite a failed query after seeing results.
Recall is successful when:
- the selected scope and limits are explicit;
- the Agent opened only task-relevant documents;
- stale spans and stale Sources were not silently reused;
- ranking adjustments, if any, were evidence-based and bounded;
- material Wiki updates passed fixed retrieval acceptance.
Next: Document knowledge graph
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 编写规范