Files
nexus/wiki/concepts/Conversation-State-Persistence.md
2026-05-03 05:42:12 +08:00

28 lines
945 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Conversation-State-Persistence"
type: concept
tags: []
sources: [expose-hermes-agent-as-an-openai-compatible-api-for-any-frontend]
last_updated: 2026-05-02
---
## Definition
Conversation State Persistence 是服务端存储完整对话历史(含工具调用)的机制,使客户端无需自行管理上下文。
## Implementation in Hermes Agent
通过 `/v1/responses` API 实现有状态会话:
- **无状态**`/v1/chat/completions` 每次请求需传递完整对话历史
- **有状态**`/v1/responses` 支持 `previous_response_id` 链式调用,服务端保留完整上下文(含工具调用)
## Key Benefits
- 客户端无需存储和发送完整对话历史
- 服务端自动维护工具调用记录
- 支持多轮对话中的上下文连续性
## Use Case
长对话场景下,使用 Responses API 可以大幅减少客户端代码复杂度。
## Related
- [[ResponsesAPI]]
- [[System-Prompt-Layering]]