mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:20:43 +00:00
docs: typography hygiene + Related CardGroups across 4 pages
docs/concepts/context.md: replaced 12 curly quote and italic-marker typography characters with ASCII equivalents so grep, copy-paste, and Mintlify search hit clean tokens. Converted the 4-bullet Related list into a CardGroup linking context-engine, compaction, system-prompt, and agent-loop. Verified all four targets exist. docs/concepts/soul.md: replaced 7 typography characters (curly apostrophe in 'agent's' and similar) with ASCII equivalents. Renamed '## Related docs' to '## Related' for consistency with sibling pages and converted the 3-bullet list into a CardGroup linking agent-workspace, system-prompt, and the SOUL.md template. docs/tools/perplexity-search.md: removed the duplicate '# Perplexity Search API' H1 (Mintlify renders title from frontmatter). Replaced 2 typography characters and converted the 4-bullet Related list into a CardGroup; verified web/brave-search/exa-search targets. docs/tools/apply-patch.md: converted the 3-bullet Related list into a CardGroup linking diffs, exec, and code-execution.
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
---
|
||||
summary: "Context: what the model sees, how it is built, and how to inspect it"
|
||||
read_when:
|
||||
- You want to understand what “context” means in OpenClaw
|
||||
- You are debugging why the model “knows” something (or forgot it)
|
||||
- You want to understand what "context" means in OpenClaw
|
||||
- You are debugging why the model "knows" something (or forgot it)
|
||||
- You want to reduce context overhead (/context, /status, /compact)
|
||||
title: "Context"
|
||||
---
|
||||
|
||||
“Context” is **everything OpenClaw sends to the model for a run**. It is bounded by the model’s **context window** (token limit).
|
||||
"Context" is **everything OpenClaw sends to the model for a run**. It is bounded by the model's **context window** (token limit).
|
||||
|
||||
Beginner mental model:
|
||||
|
||||
- **System prompt** (OpenClaw-built): rules, tools, skills list, time/runtime, and injected workspace files.
|
||||
- **Conversation history**: your messages + the assistant’s messages for this session.
|
||||
- **Conversation history**: your messages + the assistant's messages for this session.
|
||||
- **Tool calls/results + attachments**: command output, file reads, images/audio, etc.
|
||||
|
||||
Context is _not the same thing_ as “memory”: memory can be stored on disk and reloaded later; context is what’s inside the model’s current window.
|
||||
Context is _not the same thing_ as "memory": memory can be stored on disk and reloaded later; context is what's inside the model's current window.
|
||||
|
||||
## Quick start (inspect context)
|
||||
|
||||
- `/status` → quick “how full is my window?” view + session settings.
|
||||
- `/context list` → what’s injected + rough sizes (per file + totals).
|
||||
- `/status` → quick "how full is my window?" view + session settings.
|
||||
- `/context list` → what's injected + rough sizes (per file + totals).
|
||||
- `/context detail` → deeper breakdown: per-file, per-tool schema sizes, per-skill entry sizes, and system prompt size.
|
||||
- `/usage tokens` → append per-reply usage footer to normal replies.
|
||||
- `/compact` → summarize older history into a compact entry to free window space.
|
||||
@@ -29,7 +29,7 @@ See also: [Slash commands](/tools/slash-commands), [Token use & costs](/referenc
|
||||
|
||||
## Example output
|
||||
|
||||
Values vary by model, provider, tool policy, and what’s in your workspace.
|
||||
Values vary by model, provider, tool policy, and what's in your workspace.
|
||||
|
||||
### `/context list`
|
||||
|
||||
@@ -83,7 +83,7 @@ Everything the model receives counts, including:
|
||||
- Tool calls + tool results.
|
||||
- Attachments/transcripts (images/audio/files).
|
||||
- Compaction summaries and pruning artifacts.
|
||||
- Provider “wrappers” or hidden headers (not visible, still counted).
|
||||
- Provider "wrappers" or hidden headers (not visible, still counted).
|
||||
|
||||
## How OpenClaw builds the system prompt
|
||||
|
||||
@@ -118,14 +118,14 @@ When truncation occurs, the runtime can inject an in-prompt warning block under
|
||||
|
||||
The system prompt includes a compact **skills list** (name + description + location). This list has real overhead.
|
||||
|
||||
Skill instructions are _not_ included by default. The model is expected to `read` the skill’s `SKILL.md` **only when needed**.
|
||||
Skill instructions are _not_ included by default. The model is expected to `read` the skill's `SKILL.md` **only when needed**.
|
||||
|
||||
## Tools: there are two costs
|
||||
|
||||
Tools affect context in two ways:
|
||||
|
||||
1. **Tool list text** in the system prompt (what you see as “Tooling”).
|
||||
2. **Tool schemas** (JSON). These are sent to the model so it can call tools. They count toward context even though you don’t see them as plain text.
|
||||
1. **Tool list text** in the system prompt (what you see as "Tooling").
|
||||
2. **Tool schemas** (JSON). These are sent to the model so it can call tools. They count toward context even though you don't see them as plain text.
|
||||
|
||||
`/context detail` breaks down the biggest tool schemas so you can see what dominates.
|
||||
|
||||
@@ -137,7 +137,7 @@ Slash commands are handled by the Gateway. There are a few different behaviors:
|
||||
- **Directives**: `/think`, `/verbose`, `/trace`, `/reasoning`, `/elevated`, `/model`, `/queue` are stripped before the model sees the message.
|
||||
- Directive-only messages persist session settings.
|
||||
- Inline directives in a normal message act as per-message hints.
|
||||
- **Inline shortcuts** (allowlisted senders only): certain `/...` tokens inside a normal message can run immediately (example: “hey /status”), and are stripped before the model sees the remaining text.
|
||||
- **Inline shortcuts** (allowlisted senders only): certain `/...` tokens inside a normal message can run immediately (example: "hey /status"), and are stripped before the model sees the remaining text.
|
||||
|
||||
Details: [Slash commands](/tools/slash-commands).
|
||||
|
||||
@@ -147,7 +147,7 @@ What persists across messages depends on the mechanism:
|
||||
|
||||
- **Normal history** persists in the session transcript until compacted/pruned by policy.
|
||||
- **Compaction** persists a summary into the transcript and keeps recent messages intact.
|
||||
- **Pruning** drops old tool results from the _in-memory_ prompt to free context-window space, but does not rewrite the session transcript — the full history is still inspectable on disk.
|
||||
- **Pruning** drops old tool results from the _in-memory_ prompt to free context-window space, but does not rewrite the session transcript - the full history is still inspectable on disk.
|
||||
|
||||
Docs: [Session](/concepts/session), [Compaction](/concepts/compaction), [Session pruning](/concepts/session-pruning).
|
||||
|
||||
@@ -165,13 +165,23 @@ pluggable interface, lifecycle hooks, and configuration.
|
||||
`/context` prefers the latest **run-built** system prompt report when available:
|
||||
|
||||
- `System prompt (run)` = captured from the last embedded (tool-capable) run and persisted in the session store.
|
||||
- `System prompt (estimate)` = computed on the fly when no run report exists (or when running via a CLI backend that doesn’t generate the report).
|
||||
- `System prompt (estimate)` = computed on the fly when no run report exists (or when running via a CLI backend that doesn't generate the report).
|
||||
|
||||
Either way, it reports sizes and top contributors; it does **not** dump the full system prompt or tool schemas.
|
||||
|
||||
## Related
|
||||
|
||||
- [Context Engine](/concepts/context-engine) — custom context injection via plugins
|
||||
- [Compaction](/concepts/compaction) — summarizing long conversations
|
||||
- [System Prompt](/concepts/system-prompt) — how the system prompt is built
|
||||
- [Agent Loop](/concepts/agent-loop) — the full agent execution cycle
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Context engine" href="/concepts/context-engine" icon="puzzle-piece">
|
||||
Custom context injection via plugins.
|
||||
</Card>
|
||||
<Card title="Compaction" href="/concepts/compaction" icon="compress">
|
||||
Summarizing long conversations to keep them inside the model window.
|
||||
</Card>
|
||||
<Card title="System prompt" href="/concepts/system-prompt" icon="message-lines">
|
||||
How the system prompt is built and what it injects each turn.
|
||||
</Card>
|
||||
<Card title="Agent loop" href="/concepts/agent-loop" icon="arrows-rotate">
|
||||
The full agent execution cycle from inbound message to final reply.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -101,8 +101,16 @@ surfaces, make sure the tone still fits the room.
|
||||
|
||||
Sharp is good. Annoying is not.
|
||||
|
||||
## Related docs
|
||||
## Related
|
||||
|
||||
- [Agent workspace](/concepts/agent-workspace)
|
||||
- [System prompt](/concepts/system-prompt)
|
||||
- [SOUL.md template](/reference/templates/SOUL)
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Agent workspace" href="/concepts/agent-workspace" icon="folder-open">
|
||||
Workspace files OpenClaw injects into the system prompt.
|
||||
</Card>
|
||||
<Card title="System prompt" href="/concepts/system-prompt" icon="message-lines">
|
||||
How `SOUL.md` is composed into the per-turn system prompt.
|
||||
</Card>
|
||||
<Card title="SOUL.md template" href="/reference/templates/SOUL" icon="file-lines">
|
||||
Starter template for a personality file.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -51,6 +51,14 @@ The tool accepts a single `input` string that wraps one or more file operations:
|
||||
|
||||
## Related
|
||||
|
||||
- [Diffs](/tools/diffs)
|
||||
- [Exec tool](/tools/exec)
|
||||
- [Code execution](/tools/code-execution)
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Diffs" href="/tools/diffs" icon="code-compare">
|
||||
Read-only diff viewer for change presentation.
|
||||
</Card>
|
||||
<Card title="Exec tool" href="/tools/exec" icon="terminal">
|
||||
Shell command execution from the agent.
|
||||
</Card>
|
||||
<Card title="Code execution" href="/tools/code-execution" icon="square-code">
|
||||
Sandboxed remote Python analysis with xAI.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -6,8 +6,6 @@ read_when:
|
||||
title: "Perplexity search"
|
||||
---
|
||||
|
||||
# Perplexity Search API
|
||||
|
||||
OpenClaw supports Perplexity Search API as a `web_search` provider.
|
||||
It returns structured results with `title`, `url`, and `snippet` fields.
|
||||
|
||||
@@ -104,7 +102,7 @@ Search query.
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="count" type="number" default="5">
|
||||
Number of results to return (1–10).
|
||||
Number of results to return (1-10).
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="country" type="string">
|
||||
@@ -116,7 +114,7 @@ ISO 639-1 language code (e.g. `en`, `de`, `fr`).
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="freshness" type="'day' | 'week' | 'month' | 'year'">
|
||||
Time filter — `day` is 24 hours.
|
||||
Time filter - `day` is 24 hours.
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="date_after" type="string">
|
||||
@@ -206,7 +204,17 @@ await web_search({
|
||||
|
||||
## Related
|
||||
|
||||
- [Web Search overview](/tools/web) -- all providers and auto-detection
|
||||
- [Perplexity Search API docs](https://docs.perplexity.ai/docs/search/quickstart) -- official Perplexity documentation
|
||||
- [Brave Search](/tools/brave-search) -- structured results with country/language filters
|
||||
- [Exa Search](/tools/exa-search) -- neural search with content extraction
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Web search overview" href="/tools/web" icon="globe">
|
||||
All providers and auto-detection rules.
|
||||
</Card>
|
||||
<Card title="Brave search" href="/tools/brave-search" icon="shield">
|
||||
Structured results with country and language filters.
|
||||
</Card>
|
||||
<Card title="Exa search" href="/tools/exa-search" icon="magnifying-glass">
|
||||
Neural search with content extraction.
|
||||
</Card>
|
||||
<Card title="Perplexity Search API docs" href="https://docs.perplexity.ai/docs/search/quickstart" icon="arrow-up-right-from-square">
|
||||
Official Perplexity Search API quickstart and reference.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
Reference in New Issue
Block a user