record_turn
Append the latest user-assistant exchange to a conversation's history so chat context persists across sessions. Call after every reply using a stable session_id.
Instructions
Persist the most recent (user, assistant) exchange.
Call this after EVERY response you give in a conversation, with the user's question and your reply, so the chat history accumulates across sessions. Each call APPENDS — prior turns are never overwritten. The same exchange is mirrored to a local JSON ledger under .context-broker/ chats/, and the chat cache is warmed automatically so the next load_chat_context is a cached hit.
Use a stable session_id per conversation (e.g. the editor's chat id
or the date). Different conversations should use different session_ids.
For dumping an entire conversation at once, prefer record_session.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>"
},
"name": "record_turn"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| project_root | No | ||
| user_message | No | ||
| user_peer_id | No | ||
| assistant_message | No | ||
| assistant_peer_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |