get_user_context
Retrieve tiered user context at conversation start to restore identity, work preferences, quality standards, lessons, and project snapshot. Choose quick, standard, or full level to control latency and detail.
Instructions
获取用户的个性化上下文(冷启动,分层延迟可控)。 / Get tiered cold-start user context with latency control.
**Lifecycle: startup** — 对话开始时调用,为 AI 注入用户身份和上下文。
Lifecycle: startup — call at conversation start to inject user identity and context.
用途:在每次新对话开始时调用,了解用户是谁、如何工作、学到了什么、质量标准是什么。
Purpose: Call at the start of each new conversation to understand who the user is, how they work, what they have learned, and their quality bar.
分层说明 / Tiered behaviour:
- "quick": 仅身份画像 + 工作偏好(纯 JSON 读取,无文件扫描,最低延迟)。
Profile + preferences only — pure JSON reads, no filesystem scans. Lowest latency.
- "standard"(默认): 加上质量标准、经验领域、相关教训/决策、项目快照。跳过昂贵的 reconcile。
Default. Adds quality, domains, top lessons/decisions, project snapshot. Skips expensive reconciliation.
- "full": 完整上下文,含冲突检测、过期/暂存提醒、自动同步副作用。仅在用户明确要求"全量回顾"时使用。
Full context including conflict detection, stale/staging warnings, auto-sync side effects. Use only when the user explicitly asks for a comprehensive memory review.
注意:默认 "standard" 已覆盖绝大多数冷启动需求;只有用户问"我们之前所有决定/经验"或要做记忆健康检查时才用 "full"。
Note: "standard" covers most cold-start needs. Use "full" only when the user asks for a comprehensive memory review.
Args:
project_folder: 当前项目文件夹路径(可选)。 / Current project folder path (optional).
level: "quick" | "standard" | "full",默认 "standard"。 / Tier — defaults to "standard".
token_budget: 上下文 token 预算(可选)。设定后按优先级裁剪 section,低优先级 section 先丢弃。不设则返回全量。
Optional token budget. When set, sections are included by priority until budget is exhausted.
user_prompt: 用户当前提问(可选)。传入后会追加到上下文末尾,并与已存 Playbook 的
triggers 关键词匹配,命中时浮现「相关 Playbook」小节(标题 + ID;用 get_playbooks(mode="get") 查看完整步骤)。
Optional current user prompt. Appended to the context and matched against stored
playbook trigger keywords; hits surface a "Matched Playbooks" section (title + id;
call get_playbooks(mode="get") for the full steps).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | standard | |
| user_prompt | No | ||
| token_budget | No | ||
| project_folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |