Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Features:
| Command | Key args | Description |
|---------|----------|-------------|
| `add` | `--content`(req) `--source` `--tags` | Write a context item, returns `{id, stage}` |
| `retrieve` | `--query`(req) `--k`(10) `--full` `--json` `--tags` | Ranked SearchHits; L1 summaries by default, `--full` for L0. `--tags a,b` requires returned items to carry all listed tags |
| `retrieve` | `--query`(req) `--k`(10) `--full` `--json` `--tags` `--tag-match` | Ranked SearchHits; L1 summaries by default, `--full` for L0. `--tags a,b` filters by tag; `--tag-match all` (default) requires every tag, `any` requires at least one |
| `expand` | `--ids`(req, comma-separated) | Expand retrieved ids to L0 full content |
| `items` | `--stage`(raw/extracted/knowledge/skill) | List all items in a scope |

Expand Down
7 changes: 4 additions & 3 deletions docs/en/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ See [DataPlugs](../guides/integrations/dataplugs.md) for available plug types.

## Read

### `retrieve(query, *, scope, k=10, full=False, stage=None, tags=None, filters=None, include_deleted=False) → RetrieveResponse`
### `retrieve(query, *, scope, k=10, full=False, stage=None, tags=None, tag_match='all', filters=None, include_deleted=False) → RetrieveResponse`

Ranked semantic search. Returns a `RetrieveResponse` iterable of `SearchHit` objects.

Expand All @@ -128,8 +128,9 @@ By default returns **L1 summaries** (token-efficient). Pass `full=True` to recei
| `k` | `10` | Maximum hits to return |
| `full` | `False` | `True` → L0 bodies; `False` → L1 summaries (call `expand()` for L0) |
| `stage` | `None` | Filter by `Stage` enum value |
| `tags` | `None` | All listed tags must match (AND filter) |
| `filters` | `None` | Dict bag: may include `stage`, `tags`, `min_confidence` |
| `tags` | `None` | Tag filter list; matching controlled by `tag_match` |
| `tag_match` | `'all'` | `'all'` — item must have every tag (AND); `'any'` — at least one tag (OR) |
| `filters` | `None` | Dict bag: may include `stage`, `tags`, `tag_match`, `min_confidence` |
| `include_deleted` | `False` | Whether soft-deleted items appear in results |

**Returns:** `RetrieveResponse` — iterable as `for hit in response`. Each `hit` has:
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ sync 会跳过写入时的冲突检测以保证批量导入速度;导入后用
| 命令 | 关键参数 | 说明 |
|------|----------|------|
| `add` | `--content`(必填) `--source` `--tags` | 写入一条上下文,返回 `{id, stage}` |
| `retrieve` | `--query`(必填) `--k`(10) `--full` `--json` `--tags` | 检索排序后的 SearchHit;默认 L1 摘要,`--full` 返回 L0 全文。`--tags a,b` 要求返回项同时包含列出的所有标签 |
| `retrieve` | `--query`(必填) `--k`(10) `--full` `--json` `--tags` `--tag-match` | 检索排序后的 SearchHit;默认 L1 摘要,`--full` 返回 L0 全文。`--tags a,b` 按标签过滤;`--tag-match all`(默认)要求包含所有标签,`any` 只需匹配一个 |
| `expand` | `--ids`(必填,逗号分隔) | 把已检索 id 升档到 L0 全文 |
| `items` | `--stage`(raw/extracted/knowledge/skill) | 列举 scope 内全部 item |

Expand Down
7 changes: 4 additions & 3 deletions docs/zh/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ctx.plug(RAGPlug(results=my_rag_results), scope="acme/kb/general")

## 读取

### `retrieve(query, *, scope, k=10, full=False, stage=None, tags=None, filters=None, include_deleted=False) → RetrieveResponse`
### `retrieve(query, *, scope, k=10, full=False, stage=None, tags=None, tag_match='all', filters=None, include_deleted=False) → RetrieveResponse`

排名语义检索,返回 `SearchHit` 的可迭代 `RetrieveResponse`。

Expand All @@ -127,8 +127,9 @@ ctx.plug(RAGPlug(results=my_rag_results), scope="acme/kb/general")
| `k` | `10` | 最多返回命中数 |
| `full` | `False` | `True` 返回 L0 正文;`False` 返回 L1 摘要 |
| `stage` | `None` | 按 Stage 枚举值过滤 |
| `tags` | `None` | AND 过滤:所有标签必须全部匹配 |
| `filters` | `None` | 字典包:可含 `stage`、`tags`、`min_confidence` |
| `tags` | `None` | 标签过滤列表,匹配方式由 `tag_match` 控制 |
| `tag_match` | `'all'` | `'all'`:条目必须包含所有标签(AND);`'any'`:至少匹配一个标签(OR) |
| `filters` | `None` | 字典包:可含 `stage`、`tags`、`tag_match`、`min_confidence` |
| `include_deleted` | `False` | 是否包含软删除条目 |

**返回:** `RetrieveResponse` — 可用 `for hit in response` 遍历。每个 `hit`:
Expand Down
Loading