> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Memories

> Laravel Copilot SDK の ServerRpc で、セマンティックなメモリ JSONL を検証して取り込む実験的な memories.import の使用例です。

## Memories

対象: ServerRpc（Client に紐づくサーバー全体の操作）

RPC 全体の概要とページ一覧は [RPC](https://kawax.biz/jp/packages/laravel-copilot-sdk/rpc.md) を参照してください。

## memories.import（experimental）

`memories()->import()`はセマンティックなメモリ JSONL を検証し、サーバーのアカウント・リポジトリポリシーに従ってレコードを保存します。`jsonl`には入力全体、`workingDirectory`にはメモリサービスが使用するディレクトリを指定します。`onConflict`には`skip`または`error`を指定できます。

`dryRun: true`では検証のみを行い、レコードを送信しません。実際に取り込む場合は`dryRun: false`を指定します。

```php theme={null}
use Revolution\Copilot\Facades\Copilot;
use Revolution\Copilot\Types\Rpc\MemoriesImportParams;

// memories.import
$result = Copilot::client()->rpc()->memories()->import(new MemoriesImportParams(
    jsonl: $jsonl, // セマンティックなメモリ JSONL の全内容
    workingDirectory: '/path/to/project',
    dryRun: true,
    onConflict: 'skip',
));

// $result->ok, $result->code, $result->message, $result->dryRun
// $result->imported は total / imported / skipped / failed の件数
// $result->diagnostics は検証結果、$result->records は入力順の各レコードの結果
```

各診断には`line`、`code`、`message`、任意の`externalId`が含まれます。各レコードの結果にはこれらに加えて`status`が含まれます。引数は配列でも指定できます。


## Related topics

- [セッションメモリ](https://kawax.biz/jp/packages/laravel-copilot-sdk/rpc/session-memory.md)
- [ServerRpc 概要](https://kawax.biz/jp/packages/laravel-copilot-sdk/rpc/server-overview.md)
- [SessionConfig](https://kawax.biz/jp/packages/laravel-copilot-sdk/session-config.md)
- [2026年10月 Laravel アップデート](https://kawax.biz/jp/blog/changelog/202610.md)
- [ハッシュ(Hashing)](https://kawax.biz/jp/hashing.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.