-
Notifications
You must be signed in to change notification settings - Fork 4
Agent Workflow and Memory Policy
Language: English · 简体中文
The most important LWC capability is not a command. It is the Agent's ability to recognize the right moment to recall, verify, write back, or deliberately skip memory work.
classify -> recall once -> inspect current evidence -> solve
-> capture at verified milestones -> validate -> finish
This loop keeps LWC proactive without turning every small task into knowledge maintenance.
| Situation | Agent action |
|---|---|
| New substantive session | Resolve the project once, load bounded context, and run one task search. |
| Context compaction or resume | Restore enabled strong tags and only task-relevant memory. |
| Research, debugging, or design | Recall prior evidence and decisions before repeating the investigation. |
| Structural code question | Check CodeGraph once and use it if ready. |
| Document relationship question | Check the document graph once and use it if ready. |
| Non-Markdown input | Explain and configure one optional converter only when conversion is needed. |
| Verified milestone | Update one existing Page or create one distinct retrievable Page. |
| Contradiction or stale claim | Inspect cited evidence, then revise, qualify, or retract the claim. |
| Task end after Wiki changes | Lint the changed scope and run fixed retrieval acceptance. |
Skip memory work for:
- spelling or formatting changes;
- a one-line literal edit;
- a self-contained translation with no project context;
- a fact with no plausible future reuse;
- routine test output or progress updates.
If a task is substantive but no durable result has been verified yet, use LWC for recall and leave write-back for the milestone.
The Agent should bootstrap the current working root once and require one unambiguous project boundary. It then performs bounded recall:
lwc --scope all context --limit 25
lwc --scope all search "task terms" --limit 20Do not repeatedly rerun bootstrap or broad recall in the same working root. Widen retrieval by one query, kind, scope, or granularity at a time after a miss.
Lifecycle Hooks can report:
- whether the project Wiki exists;
- document graph configuration and projection readiness;
- CodeGraph runtime and project-index readiness;
- optional Markdown conversion configuration;
- Agent integration checks;
- enabled strong-tag context.
Detection is not consent. Automatic activation may read bounded authorized memory, but it may not:
- initialize a missing project Wiki unless invocation or project policy authorizes it;
- enable a document graph;
- build a CodeGraph project index;
- install or select a converter;
- write durable memory without a verified milestone and the required scope authority.
When graph capabilities are missing and relevant, ask once in plain text:
1. Enable the document graph and CodeGraph (recommended)
2. Enable the document graph only
3. Enable CodeGraph only
4. Later
Choosing “Later” changes nothing and must not block the primary task.
Start with a budget, not with the whole Wiki:
-
context --limit 25; - one
search --limit 20; - one to five full Pages;
- cited Sources only when exact evidence or freshness matters.
Strong-tag autoload is also bounded by tag priority, Page count, character budget, and Page boundaries. Hooks report omissions instead of truncating a selected Page in the middle.
Write back only after verification. Strong triggers include:
- a user-accepted decision;
- a root cause proven by code or runtime evidence;
- a corrected stale claim;
- a reusable recovery procedure;
- a source-backed synthesis;
- a stable preference or project rule.
Update an existing Page when possible. Do not create a new Page solely to mirror the current chat.
Memory maintenance is complete only when:
- every persisted claim has current evidence or explicit provenance;
- dependent writes published atomically when needed;
- lint reports no issues introduced by the update;
- fixed original and paraphrased queries retrieve the expected Page in the top five;
- optional Work reached
succeededand graph verification passed where relevant; - no secret, transient detail, or unsupported conclusion was stored.
- If project scope is ambiguous, stop project-memory work rather than falling back to global writes.
- If Wiki knowledge conflicts with checked-out code, treat current code as implementation evidence and investigate the difference.
- If a Work is queued or running, watch it instead of treating command exit as completion.
- If a changeset conflicts, preserve live work and rebuild the draft; do not force it.
- If optional maintenance would delay the user's deliverable, finish the deliverable first.
Next: Sources and ingestion
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 编写规范