EN 中文
1

Three-Tier Memory (L / M / S)

seek doesn't start from zero every session. Three layers of persistence capture knowledge at different timescales:

📁 pkg/agent/memory/ · internal/memory/ · docs/guide-memory.md
2

Permission System (Pref × Workflow, two axes)

After R1 refactor, permission lives on two orthogonal axes — never crammed into a single enum:

R1 重构后,权限走两条正交轴——不再合并成一个 enum:

Workflow trumps Preference where they conflict. PrefYolo + WorkflowPlanAnalyze is still read-only — that's plan mode's raison d'être. The workflow is a user-chosen safety boundary; pref can't override it.

Workflow 永远 trump PreferencePrefYolo + WorkflowPlanAnalyze 仍然是只读——这正是 plan mode 存在的意义。Workflow 是用户选定的安全边界,pref 不能反过来覆盖。

Permission denials are tool results, not errors — the agent sees the denial message and asks the user (or reconsiders), rather than crashing the loop.

权限拒绝是工具结果,而非错误——agent 看到拒绝消息后会询问用户(或重新考虑),而不是中断循环。

📁 internal/permission/ · see docs/prd/feature-permission-refactor.md
3

Tool System

seek exposes tools to the LLM as JSON schema definitions. Current tools:

Key constraint: Tool schemas are []byte constants at package level (built once at init, not at call time). This ensures identical bytes across turns → DeepSeek's prefix cache hits.

关键约束:工具 schema 是包级别的 []byte 常量(在 init 时构建一次,而非每次调用)。这确保跨轮次的字节一致性,从而命中 DeepSeek 的前缀缓存。

📁 internal/tools/ · each tool in its own package with a New(...) constructor
4

Prefix Cache Optimization

前缀缓存优化

DeepSeek charges ~10× less per token on cache hits. The cache key is an exact byte sequence of the entire prior message history. This drives several architecture decisions:

DeepSeek 对缓存命中收取约 1/10 的价格。缓存键是完整历史消息的精确字节序列。这驱动了以下架构决策:

📁 internal/pricing/ · pkg/deepseek/ (cache stats in API response)
5

Multi-Provider Layer

多 Provider 层

seek is DeepSeek-first but provider-agnostic. The architecture splits into two tiers:

seek 以 DeepSeek 为第一优先,但与 Provider 无关。架构分为两层:

Critical rule (CI-enforced): pkg/deepseek must not import pkg/llm. DeepSeek-specific optimisations must never be lowered into a generic interface.

关键规则(CI 强制)pkg/deepseek 不能导入 pkg/llm。DeepSeek 专属优化绝不能被降级到通用接口中。

📁 pkg/deepseek/ · pkg/llm/ · pkg/agent/ (type switch between tiers)
6

Session Persistence

会话持久化

Sessions are stored as JSONL files (schema_version=2):

会话以 JSONL 格式存储(schema_version=2):

📁 internal/session/ · docs/guide-sessions.md
7

Plan Mode v2 — confirmation-gated workflow

/plan is more than read-only exploration. The model analyzes context, proposes a problem definition + step list via the propose tool, waits for user approve / adjust / cancel, then enters EXECUTE substate with per-step gating via the plan tool.

📁 internal/tools/propose/ · internal/tools/plan/ · docs/prd/feature-plan-mode.md
8

Subagent & Worktree (v5 柱 G)

The parent agent can spawn subagents — each with its own session, token budget, and optionally an isolated git worktree — to run parallel research, drafting, or experimentation. Only the summary crosses back, so the parent's prefix cache stays warm.

📁 internal/subagent/ · internal/worktree/ · internal/tools/agent/ · 📖 Subagent docs
9

Cron / Wakeup / Triggers (v5 柱 H)

seek runs no resident daemon. Scheduling delegates to the OS (launchd / systemd / cron / Task Scheduler), which invokes seek cron tick once a minute. tick reads jobs.jsonl + triggers/, fires what's due, exits.

📁 internal/routines/ · internal/routinescli/ · 📖 Cron docs · guide-cron.md
📖 For the full design rationale, see docs/prd/v0.md and the book series. 📖 完整设计原理见 docs/prd/v0.md系列丛书