agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Offload base64 image data from AgentStateStore to reduce history retrieval overhead

Offen
#2,852 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Java
Sterne
5.6k
Forks
1.3k
Ø Merge
4 T. 12 Std.
Gemergte PRs (30 T.)
77

Beschreibung

**Problem**
When `AgentStateStore` stores an `ImageBlock` that contains a base64-encoded image (transmitted in that format), it writes the full base64 string into `stateData`. This string is often very large, which significantly increases the time spent on retrieving or parsing historical messages.

**Solution**
Offload the base64-encoded image string to a new field or a separate table, and replace it with a placeholder in the original `ImageBlock`. Then, in the method that assembles historical messages for the model, add a step to restore the base64 data from the offloaded storage. This way, for routine history-reading operations, developers can choose not to query the base64 data.

**问题**
`AgentStateStore` 存储 base64 格式传输的图片消息 `ImageBlock` 时,会将图片的 base64 编码字符串存到 `stateData` 中,而这个字符串往往很大,这导致获取/解析历史消息的耗时显著变长。

**方案**
将图片的 base64 编码字符串卸载到一个新字段或者新表中,原 `ImageBlock` 中使用占位符替代,在模型组装历史消息的方法中增加还原 base64 编码的操作。这样一来,常规的历史消息读取处理时,开发者可以选择不查询 base64 编码信息。

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.