# recall_context

세션 사이에서 작업을 계속하는 데 필요한 최근 project와 agent context를 복원합니다.

- Canonical: https://docs.xmemo.dev/ko/docs/tools/recall-context
- Locale: ko-KR
- Content-Locale: ko-KR
- Canonical-Content-Digest: 0767dc0a1fcb4e59857a76cce464ac0c81e3dccf483200c4310a35325dccee22
- Edition-Digest: 3e9fca150bb7a545ac446ce5451b9eacf3db0ee7671c7e5919f87529549e2876
- Source-Revision: sha256:0000db16929d847dd06d0f100593276843962eb54fb925e1a5f66997e039974c

## Tool Reference: `recall_context`

### Purpose

구조화된 item과 token-budgeted context text가 포함된 제한된 multi-memory context pack을 읽으며 아무것도 변경하지 않습니다.

### Parameters

- `query` (string, required): context pack을 구성할 대상 자연어 query입니다.
- `max_items` (integer, optional, default: 8): pack에 포함할 최대 memory 수입니다 (1-50).
- `max_tokens` (integer, optional, default: 1500): render된 context의 최대 token 길이입니다 (1-12000).

### Returns

Public MCP profile은 structured object가 아니라 text를 반환합니다. '### XMemo Context' heading과 'Items: <n>' line으로 시작하고, 결과가 삭제되거나 짧아진 경우 'Budget: ...' line을 추가한 다음, 각 item을 literal form 'Reference: <id> | Type: <type> | Location: <path>'의 한 줄로 표시하며, 마지막으로 bounded context body 앞에 'Context:' label을 둡니다. 일치하는 결과가 없으면 'No matching XMemo memory was found.'라고 표시합니다. reference는 opaque identifier로 처리합니다. Non-public profile은 structured pack (version, retrieval_plan, budget, items, context_text)을 반환할 수 있습니다.

### Errors

- 401/403: 요청에 memory:read가 없거나 해당되는 경우 temporary-memory read capability가 없습니다.
- 422: max_items, max_tokens 또는 명시적인 limit이 지원되는 budget/candidate 범위를 벗어났습니다.
- Validation failure: query 또는 optional filter 중 하나의 형식이 잘못되었습니다.

### Examples

#### task 전 context 복원



```typescript
recall_context({
  query: "recent decisions on the memory-os project",
  max_items: 6,
  max_tokens: 1200
})
```

### Related Tools

- [recall](/docs/tools/recall): 빠른 단일 answer에는 가벼운 best-effort 경로를 선택합니다.
- [search_memory](/docs/tools/search): weak result가 안전하지 않을 때 strict matching을 선택합니다.
- [remember](/docs/tools/remember): capture policy가 승인한 새 영구 context를 저장합니다.

## 실제로 사용된 budget 확인

응답은 used_items와 used_tokens를 보고하므로 정말 작은 응답인지 잘린 응답인지 구분할 수 있습니다.

```ts
recall_context({ query: "recent decisions", max_items: 6, max_tokens: 1200 })
```

